godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.17k stars 98 forks source link

Add option to disable Path2D/3D fish bone debug visuals #9459

Open smix8 opened 8 months ago

smix8 commented 8 months ago

Describe the project you are working on

Godot

Describe the problem or limitation you are having in your project

The fish bone debug, while valuable for some uses, adds a lot of visual noise to a scene and can not be disabled without disabling the entire path debug. This makes scenes with many (crossing) paths very hard to view.

In 2D the fish bone debug is also (very) bad for performance if there are many paths as it uses draw_polyline() for every single sample point instead of e.g. using a mesh.

fishbone

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

Add a ProjectSetting in the debug->shapes menu like for other debug. Add a editor->debug menu setting to toggle / disable the fish bone part of the debug.

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

Add a ProjectSetting in the debug->shapes menu like for other debug. Add a Editor->debug menu setting to toggle / disable the fish bone part of the debug.

Also add a setting for the fish bone length as it is currently hardcoded.

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

Debug is core.

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

Debug is core.

Calinou commented 7 months ago

I'd increase the distance between fishbones (which will also help with performance), but I wouldn't add yet another option that can be toggled in the Debug menu. That menu is already getting lengthy, and each option needs its own CLI argument to be added (which further bloats --help).

We can probably double the distance between fishbones and have the line be just as informative (if not more, as fishbones that are too close to each other can be hard to parse visually).

AyyZerrAsa commented 7 months ago

My PR is intended to aid the performance for curve drawing. https://github.com/godotengine/godot/pull/90357 I agree that there should be some options for the fishbone visuals, however. I'd say just a length parameter per-curve does the job. Depending on the world size of the curve, fishbones can end up being tiny/invisible so it shouldn't be an editor-wide value. A size of 0 can just disable them on the curve. Fishbones should also probably be off if the up-vector of the curve is turned off?