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

GPU Particles 2D/3D spawn subemitters "At End" earlier than expected #83641

Open
WagnerGFX opened this issue Oct 19, 2023 · 3 comments
Open

GPU Particles 2D/3D spawn subemitters "At End" earlier than expected #83641

WagnerGFX opened this issue Oct 19, 2023 · 3 comments

Comments

@WagnerGFX
Copy link

WagnerGFX commented Oct 19, 2023

Godot version

v4.1.2; v4.2-beta2

System information

Godot v4.2.beta2 - Windows 10.0.19045 - Vulkan (Forward+, Mobile) - dedicated NVIDIA GeForce GTX 1650 (NVIDIA; 31.0.15.3742) - Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz (8 Threads)

Issue description

Setting sub-emission "At End" fires before the particle dies. This bug is stretched together with the main particle's lifetime.

The expected behavior would be for the main particle to die and for the subemitter's particle to spawn, both at the same frame.

A workaround I've found is setting an Alpha Curve to hide the particle just before it dies.
But, if you use random lifetime, it doesn't work well on versions prior to 4.2-beta2. (maybe it was fixed in PR #83488 ?)

Steps to reproduce

The reproduction project has "main_2d" and "main_3d" scenes that show the issue, even in the editor.

Minimal reproduction project

GPUParticles Subemitter.zip

@WagnerGFX WagnerGFX changed the title GPU Particles 2D spawn subemitters "At End" earlier than expected GPU Particles 2D/3D spawn subemitters "At End" earlier than expected Oct 24, 2023
@WagnerGFX
Copy link
Author

Updated the description and reproduction project with 3D examples of the same issue.

@warriormaster12
Copy link
Contributor

Seems to still happen in godot 4.3-stable. Although it can only be triggered once after opening the scene containing particles after which it doesn't seem to trigger at all.

@WagnerGFX
Copy link
Author

I've re-tested my sample with v4.2, v4.3 and v4.4 dev6. Here is what I've noticed for v4.3+:

  • The sub-particles are now spawning in the expected timings for every particle.
  • It still feels like there is a consistent 1 or 2 frames of difference between spawning the sub-particle and killing the main particle.
    • This difference is more visible in the 3D particles.
  • 2D and 3D sub-emitters sometimes emit double the amount.
  • 3D sub-emitters sometimes don't spawn for the normal lifetime particle when using 30fps.
  • I could not reproduce the issue mentioned by warriormaster12 with my sample project.

From my tests, I can say that the spawn timing issue has been mostly fixed. It would be nice for them to spawn on the same frame, if it's not technically possible, then this issue is the most fixed it can be.

I'm not exactly sure if the spawning amount inconsistency is related to this issue, or if I should open a separate one about it. But I'm sure it was introduced in v4.3.

I'm re-uploading the sample for 4.4 as there seems to be some changes to the particle system. I also removed the Alpha Curve workaround, since it's no longer needed.

GPUParticles Subemitter (v4.4_dev6).zip

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

No branches or pull requests

3 participants