summaryrefslogtreecommitdiffstats
path: root/scene/2d/cpu_particles_2d.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Refactored 2D shader and lighting systemreduz2020-10-241-19/+1
| | | | | | | | | | -Removed normal/specular properties from nodes -Create CanvasTexture, which can contain normal/specular channels -Refactored, optimized and simplified 2D shaders -Use atlas for light textures. -Use a shadow atlas for shadow textures. -Use both items aboves to make light rendering stateless (faster). -Reorganized uniform sets for more efficiency.
* Merge pull request #38743 from arrowinaknee/node-config-warningsRémi Verschelde2020-10-011-1/+1
|\ | | | | Update all get_configuration_warning() to retrieve warnings from the parent
| * Update all get_configuration_warning to retrieve warnings from the parentArrowInAKnee2020-05-161-1/+1
| |
* | Fixes updating CPUParticles emmision shape valuesbooer2020-09-231-1/+1
| |
* | Fix 2D Particle velocity with directed emission maskPouleyKetchoupp2020-08-091-1/+5
|/ | | | | | | | | | | | Changed CPU velocity calculation for EMISSION_SHAPE_DIRECTED_POINTS to follow the same logic as in the GPU version: mat2 rotm; rotm[0] = texelFetch(emission_texture_normal, emission_tex_ofs, 0).xy; rotm[1] = rotm[0].yx * vec2(1.0, -1.0); VELOCITY.xy = rotm * VELOCITY.xy; Now both CPUParticles2D & CPUParticles3D (z disabled) show the same results as their GPU counterparts and take the initial velocity settings into account.
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-18/+35
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: Enforce separation line between function definitionsRémi Verschelde2020-05-141-0/+18
| | | | | | | | | | | | | | | | | | | | | | | I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-79/+0
| | | | | | | | | | | | | | Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
* Style: clang-format: Disable AllowShortIfStatementsOnASingleLineRémi Verschelde2020-05-101-2/+4
| | | | | | | Part of #33027, also discussed in #29848. Enforcing the use of brackets even on single line statements would be preferred, but `clang-format` doesn't have this functionality yet.
* Replace NULL with nullptrlupoDharkael2020-04-021-1/+1
|
* doc: Update classref with node renamesRémi Verschelde2020-03-301-1/+1
| | | | A few extra renames for classes which were missed in last week's PRs.
* Renaming of servers for coherency.Juan Linietsky2020-03-271-23/+23
| | | | | | | | | | VisualServer -> RenderingServer PhysicsServer -> PhysicsServer3D Physics2DServer -> PhysicsServer2D NavigationServer -> NavigationServer3D Navigation2DServer -> NavigationServer2D Also renamed corresponding files.
* Rename more 2D and 3D nodes to follow conventionRémi Verschelde2020-03-271-3/+3
| | | | Rename editor plugins to match the new node names.
* Signals: Manually port most of remaining connect_compat usesRémi Verschelde2020-02-281-4/+3
| | | | | | | | It's tedious work... Some can't be ported as they depend on private or protected methods of different classes, which is not supported by callable_mp (even if it's a class inherited by the current one).
* Signals: Port connect calls to use callable_mpRémi Verschelde2020-02-281-4/+3
| | | | | | | | | Remove now unnecessary bindings of signal callbacks in the public API. There might be some false positives that need rebinding if they were meant to be public. No regular expressions were harmed in the making of this commit. (Nah, just kidding.)
* Reimplement Mutex with C++'s <mutex>Pedro J. Estébanez2020-02-261-87/+64
| | | | | | | | | | | | | | | | Main: - It's now implemented thanks to `<mutex>`. No more platform-specific implementations. - `BinaryMutex` (non-recursive) is added, as an alternative for special cases. - Doesn't need allocation/deallocation anymore. It can live in the stack and be part of other classes. - Because of that, it's methods are now `const` and the inner mutex is `mutable` so it can be easily used in `const` contexts. - A no-op implementation is provided if `NO_THREADS` is defined. No more need to add `#ifdef NO_THREADS` just for this. - `MutexLock` now takes a reference. At this point the cases of null `Mutex`es are rare. If you ever need that, just don't use `MutexLock`. - Thread-safe utilities are therefore simpler now. Misc.: - `ScopedMutexLock` is dropped and replaced by `MutexLock`, because they were pretty much the same. - Every case of lock, do-something, unlock is replaced by `MutexLock` (complex cases where it's not straightfoward are kept as as explicit lock and unlock). - `ShaderRD` contained an `std::mutex`, which has been replaced by `Mutex`.
* Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.Juan Linietsky2020-02-251-32/+32
| | | | | | | | | | | | | | | | | | | | | - Renames PackedIntArray to PackedInt32Array. - Renames PackedFloatArray to PackedFloat32Array. - Adds PackedInt64Array and PackedFloat64Array. - Renames Variant::REAL to Variant::FLOAT for consistency. Packed arrays are for storing large amount of data and creating stuff like meshes, buffers. textures, etc. Forcing them to be 64 is a huge waste of memory. That said, many users requested the ability to have 64 bits packed arrays for their games, so this is just an optional added type. For Variant, the float datatype is always 64 bits, and exposed as `float`. We still have `real_t` which is the datatype that can change from 32 to 64 bits depending on a compile flag (not entirely working right now, but that's the idea). It affects math related datatypes and code only. Neither Variant nor PackedArray make use of real_t, which is only intended for math precision, so the term is removed from there to keep only float.
* Reworked signal connection system, added support for Callable and Signal ↵Juan Linietsky2020-02-201-5/+5
| | | | objects and made them default.
* PoolVector is gone, replaced by VectorJuan Linietsky2020-02-181-27/+27
| | | | | Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
* Fixed 2D and 3D CPU ParticlesJuan Linietsky2020-02-111-14/+14
|
* Several fixes to 3D rendering, and multimesh implementation.Juan Linietsky2020-02-111-2/+2
|
* Texture refactorJuan Linietsky2020-02-111-6/+6
| | | | | | | | -Texture renamed to Texture2D -TextureLayered as base now inherits 2Darray, cubemap and cubemap array -Removed all references to flags in textures (they will go in the shader) -Texture3D gone for now (will come back later done properly) -Create base rasterizer for RenderDevice, RasterizerRD
* Merge pull request #32496 from bitstopper/masterRémi Verschelde2020-02-071-5/+33
|\ | | | | Fixes broken CPUParticles2D AtlasTextures usage
| * Fixes broken CPUParticles2D AtlasTextures usagebitstopper2019-10-071-5/+33
| |
* | doc: Misc updates for AnimationNode* and othersRémi Verschelde2020-01-231-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | - Add some missing descriptions. - Add links to tutorials for ARVR and AnimationTree. - Style fixes. - Engine changes: * Make `AnimationNodeTransition.input_<number>` properties internal so that they don't appear in the docs. They still appear in the inspector based on the actual number of inputs requested. * Drop unimplemented `CPUParticles.flatness`. It's only used for 3D particles in `ParticlesMaterial`, and thus only relevant for `CPUParticles3D`.
* | Validate input in (CPU)Particles set_emission_shape()Rémi Verschelde2020-01-161-1/+5
| | | | | | | | | | | | Fixes #29777. Co-authored-by: Cameron Reikes <cameronreikes@gmail.com>
* | Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* | Fixed disconnecting not connected signalMikolaj Kaczmarek2019-10-291-1/+3
| |
* | Fixed emitting not initialized correctly in cpu particles 2d/3dPouleyKetchoupp2019-10-241-2/+4
| | | | | | | | Fixes uninitialized variable caused by PR #32921
* | Fixed delay when CPUParticles & CPUParticles2D start being emittedPouleyKetchoupp2019-10-201-65/+76
|/ | | | | | Particles were processed only on the next frame after the emission started, causing a one frame delay in rendering. Now the first process cycle is started during the same frame, which makes them consistent with Particles & Particles2D. Fixes #32890
* Revert "Fixes CPUParticles2D not making use of AtlasTextures"Rémi Verschelde2019-10-021-14/+4
|
* Fixes CPUParticles2D not making use of AtlasTexturesbitstopper2019-10-011-4/+14
| | | | Fixes CPUParticles2D not making use of AtlasTextures #2
* Merge pull request #32051 from qarmin/some_error_explanationRémi Verschelde2019-09-251-3/+4
|\ | | | | Added some obvious errors explanations
| * Added some obvious errors explanationsqarmin2019-09-251-3/+4
| |
* | fix particles scale randomizationclayjohn2019-09-241-2/+2
|/
* toggle CPUParticles2D visibility when redrawingclayjohn2019-07-281-0/+4
|
* Merge pull request #30576 from qarmin/lgtm_coverageRémi Verschelde2019-07-201-3/+0
|\ | | | | Changed some code reported by LGTM and Coverity
| * Changed some code showed in LGTM and Coverageqarmin2019-07-201-3/+0
| |
* | added individual particle random lifetimeclayjohn2019-07-141-0/+20
|/
* cpu_particles: Return uniform density spheres.Simon Puchert2019-07-061-2/+3
| | | | | The current implementation normalizes points from a uniform distribution on a cube. This creates a non-uniform distribution on the sphere.
* Merge pull request #26613 from KoBeWi/direction_of_particlesRémi Verschelde2019-07-021-2/+19
|\ | | | | Add a Direction property to ParticlesMaterial
| * Add a Direction property to ParticlesMaterialTomasz Chabora2019-06-261-2/+19
| |
* | CPUParticles2D: Fix gravity to be the same as in Particles2D and Area2DRémi Verschelde2019-06-301-1/+1
| | | | | | | | | | This was likely a typo, 10 times the standard gravity is 98.0665 (ca. 98), not 98.8.
* | Merge pull request #29937 from clayjohn/particles-one-shot-bugRémi Verschelde2019-06-271-1/+2
|\ \ | | | | | | Update emitting status on one-shot particles
| * | update emitting status on one-shot particlesclayjohn2019-06-251-1/+2
| | |
* | | Merge pull request #29974 from clayjohn/particles_restartRémi Verschelde2019-06-241-0/+2
|\ \ \ | | | | | | | | Properly set emitting when particles restart
| * | | properly set emitting when particles restartclayjohn2019-06-211-0/+2
| |/ /
* | | CPUParticles: Set linear velocity to 0, like GPU ParticlesRémi Verschelde2019-06-211-1/+1
| | |
* | | Particles: Properly initialize angular velocity parameterRémi Verschelde2019-06-211-1/+1
|/ / | | | | | | | | Right now it would take garbage values when loading scenes, which could end up written to the scene file.
* | change emit shape circle to sphere in CPUParticles2Dclayjohn2019-06-171-4/+5
| |