CPU/GPU usage spiking in script editor when scene contains GPU particles

Godot Version

v4.2.1.stable.official [b09f793f5]

Question

Hello!

Noticing that the computer starts heating up, the fan gets going, and the editor update spinner spins consistently when showing the script editor for a scene containing GPUParticles2D. It doesn’t help if I switch the visibility of the particles node off in the scene tree, but if I toggle Emitting off and on in the Inspector view (regardless of the final value) the fan goes back down to normal and the update spinner stops spinning continuously.

This happens again if I switching to a different script tab and come back to the one with particles.

Does anyone know if there is a way to switch off particle previews in the editor?

I think this started happening with the update to 4.2.

This is expected, as having anything animated visible in the scene tree will cause the editor to redraw continuously. This also applies to active AnimationPlayer/AnimationTree nodes, AnimatedTextures and shaders using TIME. Switching to the Script tab does not clear the scene tree, so continuous redrawing will keep happening.

It might be possible to prevent unnecessary redrawing when on tabs other than the one with the animation without changing anything in the scene tree, but it’s not trivial.

Add editor vital redraws only option by lawnjelly · Pull Request #53463 · godotengine/godot · GitHub addresses this for 3.x with the Vital Redraws Only editor setting, but this hasn’t been ported to 4.x yet.

As a last resort, increase Low Processor Mode Sleep Usec in the Editor Settings to decrease the maximum FPS the editor can render at (try 33000).

It doesn’t help if I switch the visibility of the particles node off in the scene tree

I can’t reproduce this on 4.3.dev4 with CPUParticles2D, CPUParticles3D, GPUParticles2D and GPUParticles3D. I tested this with both Forward+ and Compatibility rendering methods.

Does anyone know if there is a way to switch off particle previews in the editor?

The easiest way to do this is to hide particle nodes in the editor and assign them a script with visible = true in _ready().

1 Like

Thanks for the tips!

Increasing the low processor mode sleep usec does mitigate things.

For whatever reason the visibility toggle doesn’t seem to have an effect. Only the emitting property - and it still needs to be toggled on/off each time the scene is switched to.

I should say, this is on a Mac running big sur (11.5.2), and using the Mobile rendering method, though I did try Forward+ and got the same results.