-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
Particle shaders are 10x as slow as they could be #2176
Comments
Could you upload a minimal reproduction project, please? Ideally, this should be compared with another engine that uses only OpenGL ES so we can understand whether the thing you're trying to achieve is actually feasible. |
In 4.0 you already have access to computer shaders. So you won't have to rely on hacking your way through the particle shader, or a canvas item shader. Keep in mind, the particle shader is not a flexible GPU shader and is deeply embedded into the particle API. So it's really not designed to do general purpose calculations. |
An example project based on a canvas only shader can be found here This project uses around 1/2 million particles and uses around 7% of my GPU. As soon as I add even the most basic |
Thanks for the feedback! Yes I'm aware of the particle shaders problems, I'm using a simple canvas shader to perform complex multi-stage algos :) |
As I understand it this use case is fulfilled in the upcoming Godot 4.0 by Compute shaders, which are designed specifically for this. The Godot 3.x renderers and shading language won't receive major changes, so unless we see low hanging fruits to improve the performance of particle shaders specifically, I suggest that this proposal could be closed as solved by Godot 4.0? |
@akien-mga I see, the particle shaders will use the new compute pipeline? In that case I would like to test 500,000 particles in the new 4.x version and check the cpu/gpu usage. Unfortunately I'm as of yet unable to do so as the 4.x nightly builds crash on my machine (MacBook pro 2019) If it's significantly lower than currently that would be a huge win, and we can certainly close this. |
Closing, as there is nothing actionable we can do from this proposal. In general, performance issues should be reported on the main Godot repository with reproducible benchmarks included. We have a "Make X run faster" is rarely a good proposal subject, as it's not actionable for contributors – especially when the proposal doesn't describe how to make X run faster. You could test the |
Describe the project you are working on
A water depth & velocity simulation shader in 2D (from above).
Describe the problem or limitation you are having in your project
I've run into many issues while dealing with Godot's shader language, and I wanted to start this post as part of my documentation of such. When dealing with the current shader implementation I feel like my hands are tied many times, which leads me to believe that the current shader implementation keeps Godot far behind other engines.
Particle shaders are slow
When trying to create my water simulation in a particle shader (seems like a good idea), the simulation uses 10x more CPU time than a simple Canvas shader. Therefore I must work more strictly within the bounds of the Godot canvas shader.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
See above
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
See above
If this enhancement will not be used often, can it be worked around with a few lines of script?
This enhancement will affect anyone who has more than a passing interest in shaders.
Is there a reason why this should be core and not an add-on in the asset library?
Shader language improvements must be core.
The text was updated successfully, but these errors were encountered: