-
-
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
Add finished
signal to GPUParticles
#76859
Add finished
signal to GPUParticles
#76859
Conversation
b7c9e83
to
090e751
Compare
when? |
There's no ETA for merging this. 4.1 is in feature freeze, and this pull request needs a review before this can be merged. |
emission_finished
signal to GPUParticles.
emission_finished
signal to GPUParticles.emission_finished
signal to GPUParticles
a6c3b07
to
dcff477
Compare
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.
This current iteration looks good to me. I have tested locally with GPUParticles2D and GPUParticles3D and the behaviour appears to match CPUParticles (with #76853)
As we discussed, it would be worth opening a new proposal/PR to deal with the awkwardness of particles not resetting when emitting is toggled off then on again.
Note for mergers, this PR should be merged at the same time as #76853
One thing I just realized after hitting "approve". Is "emission_finished" the best name for this signal? As it fires after the last particle dies rather than after the last particle is emitted. The way I see it, there are two stages for a one_shot particle 1) Particles emitting (and some active) and 2) no particles emit anymore, but some particles still active. This is fired after 2), but "emission_finished" seems to infer that it signals between 1) and 2) It would be nice to have feedback from the particles team CC @QbieShay |
I'd maybe just call it "finished" or "cycle done". What happens if it's not oneshot? will it still fire at the end of each cycle of emission? |
Im open to renaming the signal. I just took the name from the old implementation in #7887. The signal is one shot only so |
I can extend the documentation to mention that it is |
I like "finished". "cycle_done" seems like it would fire every time a cycle finished (which would match this behaviour for one_shot particles, but would fire many times for non one_shot particles). Let's do two things then:
|
Clarification: my proposal that everything has a "finished" signal is out of the scope of this PR. |
But we could start by naming this one |
My ideal resolution would be:
My only concern is the name "finished" might imply that it will signal whenever the particle system finishes, so some users may expect it to fire after a user turns emitting to false and the last particle dies. But I may be overthinking things at this point |
If that's the case we can find a way to emit the signal at that point too. I think it would make a lot of sense, but it doesn't need to be this PR. |
Fair enough. We should document that this only gets emitted with @HolonProduction To summarize, we have circled back to my earlier comment #76859 (comment) if you implement the two things there in this PR and the CPUParticles PR, we should be ready to merge :) |
dcff477
to
5322e25
Compare
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.
Both this and #76853 should be ready to merge now.
One note, since they both delete "emission_finished" from SceneStringNames, github require rebasing one of the PRs after the other has been merged. But it also might be able to gracefully handle this type of conflict
emission_finished
signal to GPUParticlesfinished
signal to GPUParticles
Thanks!
To my surprise it did! |
Co-authored-by: HolonProduction <holonproduction@gmail.com>
In 4.2 beta 1 should the Maybe this is more related to #79689? |
@Gatada In short, no. A signal is just a notification that something has happened. It doesn't impact the You seem to be describing desired functionality that is the subject of this proposal godotengine/godot-proposals#7322, I suggest you follow up there |
I suspect I wasn't clear: the finished signal is transmitted at what time? And has it been implemented in beta 1? In other words: when finished-signal is received, all particles are dead and |
Surely the signal isn't emitted without the emitter having changed state? The finished signal isn't very useful if I still risk interrupting or interfering with the particles life-span even after having received it. The docs states: "Emitted when all active particles have finished processing." Which I assume means: • emitting is false This however is not the case for beta 1, hence my question: is my assumption wrong? |
tl;dr Since we are talking about GPU particles here the answer is a little bit complicated. Those particles are processed on the GPU and querying the GPU every frame to find out whether the particles are still processing is to performance heavy. The signal is just fired based on a timer with a time estimated from you particle configuration. However I don't think you issue has something to do with this PR. While I was working on this I also had problems with restarting. If I recall correctly setting Setting |
Key point being: Documentation should reflect this. Currently it says "all active particles have finished processing", which is not actually the case. Clarifying this will also make it easier to understand why |
Made a doc PR to explain the signal more accurately. |
Followup to #76853.
bugsquad edit: Fixes: #54964