-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GPUParticles3D: Translate inactive particles to -INF #75162
GPUParticles3D: Translate inactive particles to -INF #75162
Conversation
Thank you for the PR! Could you test with trails enabled? |
Trails will most likely exhibit the issue where they appear to go towards negative infinity (this already occurs with Hide on Contact collision). This needs a special case to avoid connecting the trail somehow, but I don't know how this could be done. |
I tried to setup a scene with trails enabled:
Results before this change: Results after this change: It doesn't appear that they are connecting to negative infinity or the origin, but I'm not totally sure what I'm seeing or if I've set them up properly. I'm not too familiar with the particles trails feature, or particles as a whole tbh. @QbieShay do you have a scene I can use for regression or point me to more information on |
There's an extra trail property in the drawing tab of the particle system. Additionally trails need a skinned mesh. Setting them up is a bit complicated right now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! The same change is needed for the OpenGL renderer here:
mat4 txform = mat4(vec4(0.0), vec4(0.0), vec4(0.0), vec4(0.0)); // zero scale, becomes invisible. |
I think once the fix is added to OpenGL we can go ahead and merge. I am not 100% sure this will fix the issue on all devices as -1.0 / 0.0
is not guaranteed to be inf
it is simply undefined.
If we have issues with this fix we can switch to using #define FLT_MAX 3.402823466e+38
instead
a5352ef
to
6229c2a
Compare
I actually did some research on the correctness of this method of generating an infinity before using it and it is correct for the GLSL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Thanks! And congrats for your first merged Godot contribution 🎉 |
Cherry-picked for 4.0.3. |
Resolves #72650 by translating inactive particles to negative infinity. This solution was proposed by @Calinou in this comment. Note that this is an alternate to #75090 and only one is needed.