Open Calinou opened 4 years ago
Related proposal that would make implementing this easier: https://github.com/godotengine/godot-proposals/issues/936
Related Godot issue: https://github.com/godotengine/godot/issues/27911
Does it apply only to meshes or will it be implemented to all kind of entities? For example collision shapes and CSG objects have already some kind of wireframe implemented. Their different style (color, line type) can still be useful while in that outline mode.
If possible it'd be useful to have the wireframe of the selected mesh on a different color, in complex scenes like the TPS demo you can have the origin of a large object outside your view or the bounding box can be visually lost inside all that stuff. Being a silhoutte effect for the selection probably difficult to implement this could be an option to partially improve seeing the selection (don't know if could be a thing outside the outline mode too).
@vagrantG I presume it will only change how world geometry is affected, not gizmos. That's probably what it should do, at least :slightly_smiling_face:
As for the selection, we need to improve the bounding box appearance so it's a bit more visible (and possibly add a silhouette in addition to the bounding box).
Edit: Pull request opened (https://github.com/godotengine/godot/pull/40106).
https://github.com/fire/godot/tree/wireframe-shaded Here's a 3.2 branch. I had difficulties porting to 4.0.
Was not able to turn the line color white.
@fire the wireframe color is somehow linked to the environment background color, so setting the background to a custom color and setting that to white sets the wireframe color to white as well.
Describe the project you are working on:
The Godot editor :slightly_smiling_face:
Describe the problem or limitation you are having in your project:
To visualize a 3D scene's polygon layout, Godot currently offers a wireframe mode:
However, this rendering mode can become difficult to read in more complex scenes due to the lack of occlusion. The background color can also make individual lines difficult to notice.
Describe the feature / enhancement and how it helps to overcome the problem or limitation:
Similar to what's offered in most Quake-derived engines (
r_showtris 1
), an outline mode could be added. It would keep the original scene's shading but draw colored lines on top (with occlusion provided by the original scene). The line color could be made configurable in the 3D viewport settings, ideally with an adjustable alpha component for translucent lines. The default color would probably be translucent white (or some shade of light gray if transparency isn't available).Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
This mode displays materials as usual, but displays a wireframe on top of them. The color should be settable by the user, but probably should default to a white or light gray color.
Example use case: Displaying geometry complexity while still being able to freelook through a level easily. If this mode ends up being accessible during gameplay, it could be used to debug procedural geometry generation more efficient as well.
If this enhancement will not be used often, can it be worked around with a few lines of script?:
It would require a few hundreds of lines of script, if it's even possible (see below).
Is there a reason why this should be core and not an add-on in the asset library?:
I don't think this is possible, especially in a performant way.
PS: The screenshots come from Cube 2: Sauerbraten. I'm not currently working on an implementation of these modes in Godot.