godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.14k stars 94 forks source link

Hide the GPUParticles3D Visibility AABB gizmo by default #9591

Open Arnklit opened 5 months ago

Arnklit commented 5 months ago

Describe the project you are working on

Various 3D games

Describe the problem or limitation you are having in your project

The AABB box gizmo on the particles is distracting and many users don't know what it does. It also interferes with adding emission shape gizmos which @paddy-exe is currently working on here. https://github.com/godotengine/godot/pull/86902

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

Hide the gizmo by default

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

Add a dropdown to the Drawing section that defaults to "Automatic Visibility AABB", where you cannot edit the AABB. but it automatically does the Generate AABB function when saving the scene (Maybe the AABB can automatically go to a large size when the particles are edited in the inspector, so it doesn't suddenly is larger than the AABB before recalculating on save). Then you can set the drop down to "Custom Visibility AABB" and get back the full controls.

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

This would be used often.

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

Particles are in Core.

paddy-exe commented 5 months ago

To underline the problem have a look at the following screenshot from my feature PR branch. It is (currently) not clear which handles belong to the emission shape gizmo and which to the AABB.

image

If you have the AABB in its normal size it is even worse:

image
Calinou commented 5 months ago

This PR is going the opposite direction for 3D meshes that have a custom AABB set (it's not shown if the default automatically generated AABB is used): https://github.com/godotengine/godot/pull/89538

Instead of removing the AABB gizmo entirely, I'd make it less visible by removing the "filled" shape and perhaps removing its handles as well. I assume most users should be relying on AABB generation form the editor anyway, so having the handles present isn't that useful as far as I can tell.

Either way, It's important that you can visualize how this AABB is set, as having it set incorrectly will either be inefficient or will result in the particles being culled when off-screen too early.

Unlike CPUParticles, it isn't technically feasible to automatically compute a GPUParticles AABB, so this is why it needs to be manually specified or generated by waiting for the particle simulation to occur in the editor.

but it automatically does the Generate AABB function when saving the scene

This makes sense, but this operation is slow for particles with a long lifetime. We could speed it up by temporarily increasing the simulation speed, but doing so makes the simulation less accurate (depending on editor FPS). This can potentially lead to an inaccurate AABB.

Arnklit commented 5 months ago

Yaeh I think removing the handles and the fill would be a good option as well.