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

Vulkan: GPUParticles3D instantiate gives visual artifacts #65443

Closed
ncollie42 opened this issue Sep 6, 2022 · 2 comments · Fixed by #70418
Closed

Vulkan: GPUParticles3D instantiate gives visual artifacts #65443

ncollie42 opened this issue Sep 6, 2022 · 2 comments · Fixed by #70418

Comments

@ncollie42
Copy link

Godot version

4.0 alpha 15

System information

Fedora x11 NVIDIA GeForce GTX 970

Issue description

instantiating particles occasionally leaves visual artifacts and/or effects shadows for a single frame.
Screenshot from Screencast from 09-06-2022 01:17:45 PM webm - 1

instantiating a lot of GPUParticle3D at once makes it more obvious, bellow I instantiate 20 new GPUParticle3D on the left side every .05 seconds and queue_free after 1 second. Having the same total amount of active emitters running does not give the same artifacts as instancing and freeing.

Screencast.from.09-06-2022.02.27.49.PM.webm

Steps to reproduce

GPUparticle3D.zip

Minimal reproduction project

No response

@ncollie42 ncollie42 changed the title GPUParticle3D instantiate gives strange visual artifacts GPUParticle3D instantiate gives visual artifacts Sep 6, 2022
@Calinou Calinou changed the title GPUParticle3D instantiate gives visual artifacts Vulkan: GPUParticle3Ds instantiate gives visual artifacts Sep 6, 2022
@Calinou Calinou changed the title Vulkan: GPUParticle3Ds instantiate gives visual artifacts Vulkan: GPUParticles3D instantiate gives visual artifacts Sep 6, 2022
@Calinou
Copy link
Member

Calinou commented Sep 6, 2022

Related to #56691 (likely due to the same cause).

@henriquelalves
Copy link
Contributor

Just posting an ugly hack for this issue. Apparently this was fixed in a project I'm working in by restarting the GPUParticles (to delete all current particle geometries), and giving sufficient time between stop emitting particles and deleting the scene.

Ugly code:

func _kill() -> void:
	# This is a fix for the flickering problem of particles: https://github.com/godotengine/godot/issues/65443
	# We have to restart the particles and give sufficent amount of time before deleting the node,
	# so particles won't flicker on the last position they were rendered
	$Bullet/GPUParticles3D.restart()
	$Bullet/GPUParticles3D.emitting = false
	await get_tree().physics_frame
	await get_tree().physics_frame
	await get_tree().physics_frame
	
	queue_free()

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

Successfully merging a pull request may close this issue.

3 participants