Fix sub_emitter does not process during request_particles_process
#111915
+224
−146
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue Description
This issue caused by processing order. When we config a
sub_emitter, we want thesub_emitterwill process just after every parent step.But when we use
request_particles_processto skip a short of time,ParticlesStorageprocess first parent before sub_emitter. That means if we want to delay 1 second before render particles,ParticlesStoragefirst let parent particles process 1 seconds, then handle the sub_emitter, so sub_emitter always start from parent particles ended. The sub_emitter can only be emitted from the parent's last position ofrequest_particles_processtime.What we want is processing parent and sub_emitter one by one during the
request_particles_processtime.Solution
After the '_particles_process' is executed, if there is a
sub_emtter, it will continue to execute thesub_emitterand save it in theprocessed_particles. If it is found that the particles have already been processed, it will jump out to avoid duplicate processing.particles.webm
Etc
I am not sure the
processed_particles.has(particles->particle_buffer)is suitable forHashSetmatching. Any advice?