-
-
Notifications
You must be signed in to change notification settings - Fork 99
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
Add a level of detail system for GPUParticles3D and CPUParticles3D #2743
Comments
I like this idea! It could be done by LOD'ing both the particle number and the material for the particles (switch from alpha to cutout?) |
The issue with switching materials is that you need to introduce a second material for each type of particle that needs LOD. Not only this would require more work from the user, but it'd also kind of negate the performance benefit. This is why I proposed solutions that don't require creating a new material, such as reducing the particle number or reducing the particle opacity. (Particles' color can already be adjusted with the color ramp in each material, so it should be possible to multiply this color by an opacity set by the LOD system.) |
Would it be possible to use scale for LOD? I have a rain particle that could benefit from being bigger in the back and smaller closer to the camera, so that it's almost uniform (but not quite) in size. |
I'm concerned that this proposal is too limited. I echo Qbie's and Zireael's concerns, proper LODs will need to tweak more than just emission rate. Good particle LODs will need to change emission rate and process material (or even mesh and mesh material as well. I think the only solution is to have something like HLODs for particles. Where one node fades out and another fades in based on distance with a specified hysteresis. |
With the implementation of visibility ranges and distance fade in Testing project: test_particle_lod.zip How to set up visibility ranges for particles:
particles.mp4I'll close this proposal as visibility ranges cover the original need in the proposal well enough. (In fact, it's more powerful than the solution proposed here, since it lets you adjust materials, meshes and process materials as well. For Godot 3.x, you can use the Level of Detail add-on as always. |
@Calinou: This is an excellent explanation worth documenting somewhere more accessible than Godot proposals... godot documentation itself...? |
See also #2744 which is for light nodes and #2784 for reflection probes.
Describe the project you are working on
The Godot editor 🙂
Describe the problem or limitation you are having in your project
Particles currently don't feature a built-in LOD system.
When you use many particles nodes (e.g. for torches in a room), you don't want those to emit particles if the player is too far away to see the torches. This is especially true with small particles like sparks.
For the record, the Decal node (new in 4.0) features a built-in LOD system with configurable distance and fade distance.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Add emission range and fade distance properties to GPUParticles3D and CPUParticles3D.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
If we find out a way to allow changing the number of particles emitted without resetting emission, this would likely be the ideal way to do LOD for particles as it will likely look the most seamless in action.
Alterntively, we can:
emitting
property, so that it doesn't interfere with toggling it from a script). This is better than toggling the visibility (which causes visible pop-ins), but due to the "all or nothing" nature of toggling emission, it's still worse than the proposed alternatives.If this enhancement will not be used often, can it be worked around with a few lines of script?
Kind of. It's possible to toggle particle emission in a script. The Godot LOD add-on I wrote provides such a feature.
Is there a reason why this should be core and not an add-on in the asset library?
Implementing this LOD system in C++ would lead to better performance when using large amounts of particle nodes (hundreds or more).
The text was updated successfully, but these errors were encountered: