godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.56k stars 21.27k forks source link

Handles of custom gizmos rendered as only a single pixel #75680

Open blackears opened 1 year ago

blackears commented 1 year ago

Godot version

v4.0.stable.official [92bee43ad]

System information

Windows 10, Compatability

Issue description

I stated exploring using gizmos for a plugin I'm working on. The handles that are rendered are so tiny, they look like they're only a single pixel big. I double checked with Godot 3.5.2 and it's equivalent of the plugin renders handles at a visible size. I tried using a custom texture too, but that id not help. The code I'm using here is pretty close to what appears on the Godot website as a tutorial Maybe I missed something, but I think this is a problem with the engine.

Steps to reproduce

Write a simple plugin using the code described on this page: https://docs.godotengine.org/en/stable/tutorials/plugins/editor/3d_gizmos.html

The handles will be drawn so tiny you won't be able to see them. (You can still click and drag on them though).

Minimal reproduction project

simpleGizmoTest.zip

Zireael07 commented 1 year ago

IIRC Compatibility renderer (GLES 3) has no concept of line width, leading to this issue.

blackears commented 1 year ago

I just tried Mobile and Forward+ and am getting the same issue.

AThousandShips commented 1 year ago

Do you still get this on 4.0.2?

It looks like handles are drawn as points to me, and that should be fixed in latest release for compatibility

Calinou commented 1 year ago

The issue about OpenGL point size is fixed by https://github.com/godotengine/godot/pull/73966, which is in 4.0.2.

The documentation is likely not setting point size correctly on the handle material, or the engine is not doing so on script-created handle materials for some reason.

blackears commented 1 year ago

I'm still getting the issue in 4.0.2.

It might be related to my graphics card. I can't run Vulkan and am relying on whatever Godot is using to run on older hardware. My graphics card is a FirePro™ W2100.

image

Calinou commented 1 year ago

AMD OpenGL on Windows has a tendency not to support line width and point size greater than 1, so I doubt this can be fixed unless we make gizmos use billboarded quads.

blackears commented 1 year ago

Wouldn't that be an option? At least for compatibility with older systems?

I mean, systems that don't support point size? There must be a lot of AMD users.

Calinou commented 1 year ago

I mean, systems that don't support point size? There must be a lot of AMD users.

Is it an issue on recent AMD graphics cards on Windows though? The FirePro W2100 is a 2014 graphics card and is based on a GPU that came out in early 2013 (Oland). Its drivers are no longer being updated as AMD ended its support years ago.

Billboarded quads have some downsides compared to actual point rendering, and may also perform worse (though this depends on how the hardware implements them).

AThousandShips commented 1 year ago

Using the tutorial and creating handle material sets the correct point size on master at least from GDScript

Okxa commented 1 year ago

I can reproduce this using the MRP on linux with a Vulkan capable AMD GPU, but on engine version 4.1.2. Same result as shown in this issue before, happens with Forward+ and compability_gl EDIT: https://github.com/godotengine/godot/issues/75680#issuecomment-1796118182

GPU: AMD RX5700XT Godot version: v4.1.2.stable.arch_linux Drivers and whatnot from godot output: OpenGL API 4.6 (Core Profile) Mesa 23.2.1-arch1.2 - Compatibility - Using Device: AMD - AMD Radeon RX 5700 XT (navi10, LLVM 16.0.6, DRM 3.54, 6.5.8-arch1-1)

image

EDIT: Also happens on Godot_v4.2-beta3_linux.x86_64

Zireael07 commented 1 year ago

Handles likely need similar treatment as origin lines got in #83895

FailMelon commented 1 year ago

Make sure you set the point size in the material.

Godot_v4 1 1-stable_mono_win64_0KEGgj459m

https://github.com/godotengine/godot/assets/3711395/5c32b26b-cfa6-486e-8b32-98de399c5155

Okxa commented 1 year ago

On further inspection, handles show up in the MRP for me. (Either by setting the materials point size, or by using the create_handle_material() function)

However, an addon I made following the 3D gizmo tutorial, does not show the handles when under a specific project:

In fact when I make a copy of the original project, and delete .godot folder, the handles show up again, but of course introduces some additional work otherwise (Editor UI resets etc.)

This indicates there is something cached somewhere that breaks the handles. Is there any specific file that would cache something about this?

Anyways, consider my specific issue solved.

EDIT: It's this: https://github.com/godotengine/godot/issues/78193