You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After adding a GPUParticles2D node to our project, I was surprised to find it suddenly running at 10FPS on Android. Disabling particle turbulence brought the FPS back to the normal 90. Turns out the real culprit is not the turbulence itself, but this conditional check for collision in the particle shader:
This check gets generated even when collision is disabled. Luckily I don't need collision and simply removing it solved the issue (I've included this fixed version of the particles in the MRP). However, it's still odd that this is so slow in the first place. Replacing the if statement with a ternary or a step expression did not help.
The problem is not only on mobile - running the example project on my M1 Mac, I get a drop from 1500 FPS to 600 after enabling turbulence on a default particle system emitting only 1 particle. Also happens regardless of rendering backend. Have not confirmed on iOS or Windows.
I assume it applies to 3D too, but didn't check.
Steps to reproduce
Run MRP scene, should run well at first.
Then enable turbulence and observe FPS drop.
Looks like if COLLISION in a 2D particles shader it flags for the engine to enable the screen SDF automatically. So the cost you are seeing is not from the particles per se, but from generating the screen SDF, which is expected to be super slow on mobile. Avoiding adding the COLLISION built in should be enough to fix the issue.
@djrain I got an FPS drop from 4800+ to 3900+ on enabling the collision, but now I think this will do it. I got also another error don't know if it's related or not:
:436 - Unknown identifier in expression: 'noise_direction'.
Shader compilation failed.
This happens in the above MRP when I change the collision mode from DISABLED to RIGID as below:
Godot version
4.1.2 stable
System information
macOS, Android. All renderers
Issue description
After adding a GPUParticles2D node to our project, I was surprised to find it suddenly running at 10FPS on Android. Disabling particle turbulence brought the FPS back to the normal 90. Turns out the real culprit is not the turbulence itself, but this conditional check for collision in the particle shader:
This check gets generated even when collision is disabled. Luckily I don't need collision and simply removing it solved the issue (I've included this fixed version of the particles in the MRP). However, it's still odd that this is so slow in the first place. Replacing the if statement with a ternary or a step expression did not help.
The problem is not only on mobile - running the example project on my M1 Mac, I get a drop from 1500 FPS to 600 after enabling turbulence on a default particle system emitting only 1 particle. Also happens regardless of rendering backend. Have not confirmed on iOS or Windows.
I assume it applies to 3D too, but didn't check.
Steps to reproduce
Run MRP scene, should run well at first.
Then enable turbulence and observe FPS drop.
Minimal reproduction project
SlowParticleTurbulenceIssue.zip
The text was updated successfully, but these errors were encountered: