Skip to content
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

Reduce maintainance cost of particle nodes #7344

Open
QbieShay opened this issue Jul 21, 2023 · 2 comments
Open

Reduce maintainance cost of particle nodes #7344

QbieShay opened this issue Jul 21, 2023 · 2 comments

Comments

@QbieShay
Copy link

QbieShay commented Jul 21, 2023

Describe the project you are working on

Godot engine

Describe the problem or limitation you are having in your project

Godot has 4 ways of doing particles:

  1. GPUParticles 3D
  2. GPUParticles 2D
  3. CPUParticles 3D
  4. CPUParticles 2D

Every time I make an improvement to particle nodes I have to

  1. implement it on process material
  2. test it on gpuparticles3D
  3. fix it fror gpuparticles3D
  4. iterate
  5. test on gpuparticles2D
  6. fix it for gpuparticles2D
  7. iterate
  8. reimplement it for CPUParticles3D
  9. test on CPUParticles3D
  10. add conversion code from gpu to cpu particles
  11. fix it
  12. reimplement for CPUPartilces2D
  13. add conversion code to CPUParticles2D
  14. test it
  15. Maybe then merge the PR
    And if changed are made with the rendering infrastructure
    Also implement it for vulkan and gles3. ( see Particle internal refactor and additions for more artistic control godot#79527 )

This cost me A TON of energy that I don't have, and it adds a 2x bug surface on Particles.

I think for all the ways Godot is easy to pick up and contribute to, particles go in the opposite direction.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

I can see multiple ways to go about this

  1. Implement Add support for particle recording and playback #7085, and make cpuparticles playback only.

  2. Use a glsl to C++ converter
    It's important that it goes this way and not the other way so that people more versed in glsl than c++ can contribute as well. I think perhaps there's a way to make CPUParticles execute a process material on CPU and some automatic step to convert it.

  3. Remove them since the renderer update in 4.x makes them a bit redundant (Deprecate CPUParticles #7517)

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

I would prefer option 2 of the option specified above, even if it means we have to do our own code generation. particles are something very important for artists and it being one of the most laborious nodes to maintain, considering it's an artist feature, makes it incredibly hard to get new contributors on, leaving higher bus factor and maintainance cost.

If this enhancement will not be used often, can it be worked around with a few lines of script?

No

Is there a reason why this should be core and not an add-on in the asset library?

Seems like particles cannot be addons due to the way they need deep engine core interaction.

@webredraptors
Copy link

webredraptors commented Jul 28, 2023

  1. Use a glsl to C++ converter
    It's important that it goes this way and not the other way so that people more versed in glsl than c++ can contribute as
    well. I think perhaps there's a way to make CPUParticles execute a process material on CPU and some automatic step to convert it.

Could you elaborate on how you think the CPU could execute ParticleProcessMaterial? I was under the impression that PPMs were essentially just shaders that the user can program without using shader code. Implementing and maintaining a full GLSL to C++ converter sounds like a monumental task.

@QbieShay
Copy link
Author

QbieShay commented Aug 3, 2023

Implementing and maintaining a full GLSL to C++ converter sounds like a monumental task.

This is what I'm suggesting, and it doesn't really need to be a full blown glsl to c++, it just needs to be the subset that gdshaders use in particle process. However i do not know effectively how big of a task that is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants