Fix collided 3D GPU particles sometimes jittering #92474
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes an issue found by @RPicster in #87320.
What would happen is a particle will collide with a collider, the collision system would detect it and attempt to move the particle out of the collider. Sometime this would result in a particle that still touches the collider and other times not (When it touched was cause by a floating point precision error). If the particle did not touch the collider it would start moving again even though visually it is touching the collider. This causes "collided" particles to jitter. It is much more visible at lower Particle "Fixed FPS"
The solution I found was to introduce an EPSILON term in collision calculations. This ensures that collided particle will always "touch" the collider after the particle has been moved. This solution was applied to the Forward+ renderer as well as the OpenGL renderer.
An MRP showcasing the issue and solution for multiple collider types