Skip to content

Conversation

@xuhuisheng
Copy link
Contributor

Issue Description

This issue caused by processing order. When we config a sub_emitter, we want the sub_emitter will process just after every parent step.

But when we use request_particles_process to skip a short of time, ParticlesStorage process first parent before sub_emitter. That means if we want to delay 1 second before render particles, ParticlesStorage first 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 of request_particles_process time.

  • fixed_fps: 30 (30 frame per seconds)
  • request_particles_process(1.0) (process particles 1 second before start)
  • first, let parent particles process 30 frames
  • second, let sub_emitter particles process 30 frames.

What we want is processing parent and sub_emitter one by one during the request_particles_process time.

Solution

After the '_particles_process' is executed, if there is a sub_emtter, it will continue to execute the sub_emitter and save it in the processed_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 for HashSet matching. Any advice?

@xuhuisheng xuhuisheng requested a review from a team as a code owner October 22, 2025 12:20
@AThousandShips AThousandShips added this to the 4.6 milestone Oct 22, 2025
@xuhuisheng xuhuisheng marked this pull request as draft October 22, 2025 15:38
@xuhuisheng
Copy link
Contributor Author

After detailed testing, the particles system is more complicated than I thought. Current PR maybe result as a duplicated processing to looks like correct.

Marked this PR as draft, until confirmed new behaviors equals as before.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GPUParticles2D.request_particles_process does not process sub_emitters

2 participants