summaryrefslogtreecommitdiffstats
path: root/scene/2d/cpu_particles_2d.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Core: Drop custom `copymem`/`zeromem` definesRémi Verschelde2021-04-271-2/+2
| | | | | | | | We've been using standard C library functions `memcpy`/`memset` for these since 2016 with 67f65f66391327b2967a20a89c3627e1dd6e84eb. There was still the possibility for third-party platform ports to override the definitions with a custom header, but this doesn't seem useful anymore.
* Use Array for node configuration warningsNathan Franke2021-04-111-6/+3
| | | | Previously, the warnings were passed as a string and delimitation of which were hard coded at each implementation.
* Use real_t in non-physics 2D nodesAaron Franke2021-03-191-55/+55
|
* Refactored cpu_particles_2d.cpp _notification MethodKyle2021-02-281-53/+51
| | | | Refactors the _notification method in cpu_particles_2d.cpp to use a switch statement for readability and to bring it inline with other classes like node.cpp and timer.cpp.
* Removed _change_notifyreduz2021-02-101-2/+2
| | | | | | -For inspector refresh, the inspector now detects if a property change by polling a few times per second and then does update the control if so. This process is very cheap. -For property list refresh, a new signal (property_list_changed) was added to Object. _change_notify() is replaced by notify_property_list_changed() -Changed all objects using the old method to the signal, or just deleted the calls to _change_notify(<property>) since they are unnecesary now.
* Make Servers truly Thread Safereduz2021-02-101-1/+1
| | | | | | | | | -Rendering server now uses a split RID allocate/initialize internally, this allows generating RIDs immediately but initialization to happen later on the proper thread (as rendering APIs generally requiere to call on the right thread). -RenderingServerWrapMT is no more, multithreading is done in RenderingServerDefault. -Some functions like texture or mesh creation, when renderer supports it, can register and return immediately (so no waiting for server API to flush, and saving staging and command buffer memory). -3D physics server changed to be made multithread friendly. -Added PhysicsServer3DWrapMT to use 3D physics server from multiple threads. -Disablet Bullet (too much effort to make multithread friendly, this needs to be fixed eventually).
* Initialize class variables with default values in scene/ [1/2]Rafał Mikrut2021-02-071-25/+0
|
* Merge pull request #45496 from Chaosus/fix_particlesRémi Verschelde2021-02-031-15/+19
|\ | | | | Fix particles not properly updated by their lifetime
| * Fix particles not properly modified by their lifetimeYuri Roubinsky2021-01-271-15/+19
| |
* | Use Math_TAU and deg2rad/rad2deg in more places and optimize codeAaron Franke2021-01-091-4/+4
|/
* Update copyright statements to 2021Rémi Verschelde2021-01-011-2/+2
| | | | | | | | | | | | | | Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
* Rename Vector2.tangent() to Vector2.orthogonal()Marcel Admiraal2020-12-061-2/+2
|
* Rename Particles/ParticlesMaterial "Flags" enum to "ParticleFlags"Aaron Franke2020-12-041-18/+18
| | | "Flags" was a bit too ambiguous, and in 3D it hid GeometryInstance.Flags
* 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