Tweak appearance of 3D editor gizmo icons
- Use alpha scissor to resolve transparency sorting issues with gizmo icons relative to other transparent materials in the scene. This also makes gizmos visible in
screen_texture, which means gizmos can now be seen through refractive materials. Lastly, this reduces the amount of artifacts visible around gizmo outlines (although they are still present at times). - Make icons darker when not selected to be less intrusive (and easier to distinguish when selected).
- It's possible that the darkening effect is too strong, so this can be revisited later.
This isn't a perfect solution to all gizmo rendering problems by any means, but it should provide an usability upgrade already.
- This closes https://github.com/godotengine/godot/issues/24069. See https://github.com/godotengine/godot/issues/9935 and https://github.com/godotengine/godot/issues/82579.
Preview
All screenshots/videos performed with a 1920×1080 editor window. At higher resolutions, gizmos look better (both before and after this PR).
All gizmos
The RGB stripes are located behind the gizmos' position, and they use a transparent (Alpha) material.
| Before | After |
|---|---|
Selected gizmo comparison
| Before | After |
|---|---|
Gizmo visible behind refractive material
Gizmos are still refracted (as they are part of the screen texture), but it's better than nothing.
Transparency sorting
Before (incorrect)
The decal and camera gizmos appear behind the red toruses that are far away in the background, but they shouldn't.
https://github.com/godotengine/godot/assets/180032/5d3d764d-9295-4976-b44c-68af49813e1b
After (correct)
https://github.com/godotengine/godot/assets/180032/4336d291-b109-4dba-9318-8dd8467def80