Skip to content
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

QueueFree on GPUParticles causes visual artifacts #78898

Closed
LasseSchnepel opened this issue Jul 1, 2023 · 4 comments · Fixed by #82431
Closed

QueueFree on GPUParticles causes visual artifacts #78898

LasseSchnepel opened this issue Jul 1, 2023 · 4 comments · Fixed by #82431

Comments

@LasseSchnepel
Copy link

LasseSchnepel commented Jul 1, 2023

Godot version

v4.1.rc2.mono.official [4642448]

System information

Godot v4.1.rc2.mono - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1070 Ti (NVIDIA; 31.0.15.1694) - AMD Ryzen 7 2700X Eight-Core Processor (16 Threads)

Issue description

When I use QueueFree on a GPUParticles3D, sometimes weird artifacts show up at other locations. These artifacts are purple to green, in completely off shapes. This only happens when I set vertex_color_use_as_albedo to true in the draw pass material. All other settings are default.
gpuparticleissue

Steps to reproduce

Create GPUParticle3D, set vertex_color_use_as_albedo to true and call QueueFree on it.

Minimal reproduction project

IssueMRP.zip

Run Test.tscn. Spawner will periodically spawn new "Cannonballs" which include a GPUParticle3D. The auto-run animation in Cannonball::AnimationPlayer will call QueueFree on the Cannonball. As the issue does not show at every QueueFree, you may need to run the scene a little bit. It is intended, that you cannot see the particles themselves, but you'll see the artifact.

@fracteed
Copy link

fracteed commented Jul 1, 2023

Have you tried using call_defered("queue_free") instead of the standard queue_free?

@LasseSchnepel
Copy link
Author

Hi Fracteed, thank you for the quick reply! I added a script to the cannonball with a method "Die" that calls call_defered("queue_free") on itself, as I found better way to call this from the animation player. The animation player then calls "Die" instead of QueueFree. Same result, I still get the artifacts.

@fracteed
Copy link

fracteed commented Jul 1, 2023

I guess it was worth a try. You could also try calling the method from a script rather than animation player. I have a ton of particle systems in my game and haven't seen this glitch on node freeing.

But in general, there are still issues with particles at the end of their life, so maybe that is what you are seeing? The transforms of particles do sometimes get reset to the world center upon their death instead of just disappearing, so you will get a sudden flashing effect in the world center for a frame. This was meant to have been fixed recently, but I still see it randomly, as have other devs.

I think this may be due to particles that scale down to zero over their lifetime, but I am not totally sure.

@Calinou
Copy link
Member

Calinou commented Jul 1, 2023

I suggest testing #78852 locally 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants