godot icon indicating copy to clipboard operation
godot copied to clipboard

Add a project setting to control 3D line drawing thickness

Open Calinou opened this issue 1 year ago • 0 comments

  • Salvage of https://github.com/godotengine/godot/pull/74387. Thanks @myaaaaaaaaa for the original implementation :slightly_smiling_face:

This setting affects all lines drawn in 3D, including gizmos in the editor and debug draw options. This can be used to make debug drawing more visible, particularly when using a high-resolution viewport.

This relies on hardware support, so it's not available on all platforms and GPUs (see maximum supported line width). It's also only supported in the Forward+ and Mobile rendering methods.

This could technically be implemented in Compatibility with glLineWidth() (on desktop platforms only), but I haven't managed to do this yet.

  • This closes https://github.com/godotengine/godot-proposals/issues/9299.

Preview

Line width = 1

Screenshot_20240425_191230

Line width = 2

Screenshot_20240425_191206

Line width = 1 with half-resolution viewport

Effective line width is identical to line width = 2. This shows how thicker lines are helpful on high-resolution viewports, such as hiDPI displays.

Screenshot_20240425_191236

TODO

  • [ ] Expose an editor setting to control line width in the editor while keeping the project setting for the running project.

Calinou avatar Apr 25 '24 17:04 Calinou