GPU Particles 3D doesn't apply tangential acceleration for particles moving on a straight line
Godot version
v4.1.2.stable; v4.2.beta3
System information
Godot v4.2.beta3 - Windows 10.0.19045 - Vulkan (Forward+, Mobile) - GLES3 (Compatibility) - dedicated NVIDIA GeForce GTX 1650 (NVIDIA; 31.0.15.4584) - Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz (8 Threads)
Issue description
Tangential acceleration in 3D requires for the particle's spawn position and movement to not be perfectly aligned with any axis of the particle node position.
The best workaround I've found is to add a small spread of 0.01 to velocity, so the particles won't be at the perfect center.
It works as expected on 2D, but I understand that 3D has more rotation axis that make it more complex. Is this a limitation? Similar to not being able to have linear acceleration on stationary particles or radial/tangential acceleration on particles at the center of their emission point?
Steps to reproduce
The reproduction project has the "main_3d" scene to show the issue, even in the editor. There is also a "main_2d" scene to show how it works on 2D.
Minimal reproduction project
cc @QbieShay
Is this a regression introduced in 4.2, or was the case in 4.1 as well?
Is this a regression introduced in 4.2, or was the case in 4.1 as well?
It also happens on 4.1.2. This is another one of the edge cases I've been finding in the GPU particles while digging for bugs and regressions 😅
Thank you for all your work! I've seen the incoming bug reports and you're helping Godot a lot :pray:
Knowing whether this is a regression or not helps me prioritize, since we're very close to 4.2 release.
Knowing whether this is a regression or not helps me prioritize, since we're very close to 4.2 release.
No worries, at this point in time (beta) I presume that regressions and bugs from the new features are probably the ones with higher priorities than bugs that are already around, like this one.
I've been exploring around and found some extra information about this issue:
- Tangential only works in the axes dictated by gravity, by default or zero (0,0,0) it will use the -Y axis.
- The main bug shown in the MRP is happening because the particles are moving on a default gravity (or none) while only moving in the Y axis, making the calculation not know which direction to move the particle.
- Multiple gravity axis results in the tangential force being applied in them.
- Negative values will inverse the tangential flow.
- Although I reported "perfectly aligned with any axis", it was because I used gravity to test the axis while I didn't test velocity enough to see the difference (ops).
If this is confirmed, my suggestion to fix this would be to improve the tangential acceleration to always work on all axes, as if the gravity vector was (1,1,1).
Additionally, the tangential curve would also accept a CurveXYZ to control the effect on each axis individually. This could maintain some backward compatibility, with minor adjustments.
Alternatively, it could accept a Vector3 to replace what gravity is doing, but I imagine that a CurveXYZ could give more creative control over the effect.
Tested in v4.3-stable and v4.4-dev6. The issue is still the same.
Thank you for the reminder, this slipped through the cracks
Thank you for the reminder, this slipped through the cracks
No problem, I'm just reviewing the issues I opened to see if some might have been fixed or worsened as a side effect of other implementations.