ParticleEmitter:Emit() causes huge lag spikes when camera is close to ParticleEmitter

System Information
Ryzen 7 5800X
RTX 3080
32 GB of ram
Windows 11

Details
The lag spikes are caused by the Id_Transparent label:

I also managed to create a situation where the issue didn’t happen unless the Size property was set to a NumberSequence:

Reproduction

  1. Parent an Attachment to Workspace.Terrain
  2. Parent a ParticleEmitter to the attachment.
  3. Set Enabled = false and Lifetime = 1
  4. Move camera close to the attachment and run workspace.Terrain.Attachment.ParticleEmitter:Emit(10000)
7 Likes

This causes it to render 10000 full-screen transparent quads. The performance drop from this is inevitable. Are you expecting something different?

1 Like

Does increasing the on-screen size of a transparent quad cost more to render? If so, I wouldn’t consider this a bug. The reason I made this bug report though is because this is causing performance issues at a much lower particle count, somewhere around 300 causing around 18ms Id_Transparent spikes and not all of those particles are near the screen.

1 Like

Total number of pixels (re)rendered is very important for performance. If you render the entire screen 10000 times, that can easily overwhelm even the fastest GPUs.

While it might be something else, it is hard to know what you are seeing exactly based on just the data in this thread. If this explanation doesn’t help you, please provide a specific simplified reproduction case in form of a rbxl file that shows the problem when ran, and attach it here. Thanks.

1 Like