summaryrefslogtreecommitdiffstats
path: root/editor
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2023-10-23 23:29:25 +0200
committerHugo Locurcio <hugo.locurcio@hugo.pro>2024-10-18 22:52:50 +0200
commit8e0c0d78377b5e0403f572e73351778671be5350 (patch)
tree36ba1d6c17616d38698b58fd88ec4e3d333cbbef /editor
parent58a7f9b4d838b9e1c346a936feb5d1e54fcdf554 (diff)
downloadredot-engine-8e0c0d78377b5e0403f572e73351778671be5350.tar.gz
Improve display for lightmap probes in the editor
- Use the default Back cull mode to improve performance slightly and prevent obstructing the camera. - Fade probes when the camera gets close as to be less intrusive.
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/gizmos/lightmap_gi_gizmo_plugin.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/editor/plugins/gizmos/lightmap_gi_gizmo_plugin.cpp b/editor/plugins/gizmos/lightmap_gi_gizmo_plugin.cpp
index 748f770d4d..007cc0636a 100644
--- a/editor/plugins/gizmos/lightmap_gi_gizmo_plugin.cpp
+++ b/editor/plugins/gizmos/lightmap_gi_gizmo_plugin.cpp
@@ -44,7 +44,10 @@ LightmapGIGizmoPlugin::LightmapGIGizmoPlugin() {
Ref<StandardMaterial3D> mat = memnew(StandardMaterial3D);
mat->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
- mat->set_cull_mode(StandardMaterial3D::CULL_DISABLED);
+ // Fade out probes when camera gets too close to them.
+ mat->set_distance_fade(StandardMaterial3D::DISTANCE_FADE_PIXEL_DITHER);
+ mat->set_distance_fade_min_distance(0.5);
+ mat->set_distance_fade_max_distance(1.5);
mat->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
mat->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, false);
mat->set_flag(StandardMaterial3D::FLAG_DISABLE_FOG, true);