-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GPU usage increases considerably only enabling 2D particles turbulence #76501
Comments
By how much is it increasing, exactly? This looks like less than a millisecond, which isn't great but sounds about right to me. |
Every Particles node increase it about 0.4ms |
IIRC turbulence uses noise, and IIRC 3d noise at that, which isn't free - 0.4ms sounds just about in the right ballpark |
ah, ok, I thouht an increase of 0,4ms for each node was much |
So, should this be closed? We can always argue whether 0.4ms is a "considerable" increase for adding a bunch of noise lookups in a shader, but I'm inclined to file this under "works as expected". Texture lookups aren't cheap. |
Yes |
I remember seeing this being reported elsewhere, but I can't find it right now. Either way, 0.4 mspf on a RTX 3070 isn't a huge increase for something that you'll probably use with a few particle systems at once on screen at most. (Turbulence is not something you should enable on every particle system after all.) This may be improved by #64606, although its main focus is making it more flexible. Feel free to test that PR locally 🙂 |
But on mobile is that high? Because I wanted to use them in a mobile game
I will try it |
On mobile everything is high. Turbulence might not even work on mobile platforms at all, at least not in the Compatibility renderer. Have you ever exported and tested your project on a mobile device yet? |
Nevermind, I tried, it make the game crash |
Both the generation of the 3D noise and the calculation of the gradient (curl formula?) of the noise are known to be expensive operations. If you can tell a bit more about the effects you want to achieve, we can think about solutions together. I think overall this is a documentation issue. Perhaps the engine can warn when enabling turbulence that it's an expensive feature. |
I want to make a fire effect, like this 2023-04-30.11-22-25.mp4 |
Turbulence sounds like a bad fit here. Using linear/angular velocity/acceleration and perhaps some damping should get you a convincing effect already. At a small scale like this, you could also simulate a turbulence effect by rotating the particles node using an AnimationPlayer, as long as Local Coords is disabled. |
I checked several times and there does not seem to be, I think there should be also written in the documentation that does not work on mobile (at least it doesn’t work on phones where i tried it) |
thanks, damping made it look very similar, it was the setting I was missing |
Slowdown's been documented, OP seem to have achieved the effect they were looking for. Good work everyone! |
One thing about this Issue brought up a thought. Is there some way of testing this? I reopened the issue - if that is something we should put in another issue or discuss somewhere else - feel free to close it ;) |
You could copy the shader from an older project and then you could compare them side-by-side (i.e. by creating a ParticlesProcessMaterial and converting to a shader material) |
@RPicster we did perf test at the times when K made the new turbulence and there wasn't any perf impact that we could see |
Perfect, I remembered it. Just though I'd bring it up again in case it was related. |
Godot version
4.x
System information
Windows 10, RTX 3070
Issue description
Using 2D particles when enabling turbulence GPU usage increases dramatically.
Without Turbulence:
With Turbulence:
Steps to reproduce
Add GPUParticles2D, add particle process material and enable turbulence
Minimal reproduction project
see steps
The text was updated successfully, but these errors were encountered: