-
-
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
Particles: can't control actual emission rate (trying to do so through "lifetime" is prone to misbehavior) #26963
Comments
@aqnuep I think that's a problem with your system. I just reproduced it on my local machine and it's working absolutely fine. @akien-mga Please review this. |
The version is 20 days old and there were some changes on particles and materials, can you try a more recent build? |
I'm really curious to hear what in my "system" could cause a lower frame rate when setting emitting=false vs when also deleting the entire node after it... (both should stop updates of the particles)
Tested it with latest master, plus also with both "release_debug" (editor) and "release" (export) builds, but the issue persists. Looks like the transform feedback particle processor shader is not stopped from continuing to execute even after emitting is disabled and pending particles have come to the end of their lifetime (confirmed with RenderDoc). |
Okay, so I went a bit further and dug up the conditions used by the engine to stop continuing to update the particles and I found this:
Which is not too surprising (except for the magic constant 1.2 which really should probably be something like 1 + EPSILON), but that made me realize the repro instructions I've provided are not entirely complete. Thing is, in the test I conducted I needed control over the emission rate in some way and due to lack of direct support (see #4294), I achieved that effect by manipulating However, it looks like even though that's possible to do, it doesn't interact well with the engine's way of deciding when a particle emitter became inactive and thus does not need further processing. Messing around with the value of Now the question is what is the intended behavior here. Is the engine supposed to allow manipulating the Not sure about the answer and I'm fine if this is not considered a bug after all, but this may cause suprises to other users trying to achieve similar effects like I did. |
Emitting just determines how long particles will be emitted. It has no bearing on when a particle updates. The expected behaviour is that a particle updates for its entire lifetime after having been emitted. If you want to change the rate of emission within the liftetime you should use the explosiveness property. The expected behaviour is that a particle will update for its lifetime. It does seem that there is some issues around setting the lifetime of particles that have been emitted. It sounds like there may be a bug in there somewhere, i would expect that lifetime could be updated anytime and it would affect the life of the particles without issue. |
Of course it has. Updating happens as long as there are live particles which happens while emitting is active or for
That's not exactly what explosiveness is about. Explosiveness only controls the distribution of emissions across the lifetime, but the actual emission rate over the course of The root of the problem I encountered is that even though you can change the various parameters of the emitter, really some of them are sort of assumed to be immutable, as other logic depends on it, like it's the case with the inactive detection (which stops further updates), that depends on the current value of
Anyway, adjusting the |
I think we are actually in agreement here. The issue you are currently experiencing is a result of expected behaviour that resulted in unexpected results when you tried to get the particles to do something it wasn't made to do. It is expected behaviour that the particles lifetime would adjust when you change the The core of the issue here is that there should be some way to control particle emission based purely on emission rate. I agree with that. It would be great if you would change the title of the issue to reflect the fact that we need to add an |
This bug report is a feature proposal on disguise. It is essentially proposing that we add an As a particles feature request, it should be tracked here godotengine/godot-proposals#815 as all feature requests need to go through the proposals process. |
Godot version:
Master 75c89aa
OS/device including version:
Win7 / Radeon 7870
Issue description:
Particles cause quite a bit of a dip in frame rate when emitting, but the problem is that even after they are stopped the frame rate doesn't go back up to to rate before emission has been started.
Deleting the entire Particles node after stopping it does restore the frame rate so I suspect that some of the processing continues to happen even after the emitter has been stopped and there are no more visible particles.
Steps to reproduce:
Edit: The issue only happens if the script manipulates the
lifetime
property while the emitter is active, see #26963 (comment) below.Minimal reproduction project:
Should be trivial to reproduce.
The text was updated successfully, but these errors were encountered: