From 8ca1605bbbb865befc0ce1de99c1e21e53e155c5 Mon Sep 17 00:00:00 2001 From: Stayd Date: Tue, 3 Dec 2024 02:34:33 -0700 Subject: [PATCH] Fix default preview environment sky. Fixes the horizon color being grey even when both the sky and ground colors are set to black, and makes the energy slider affect both hemispheres rather than only affecting the top "sky" portion. --- editor/plugins/node_3d_editor_plugin.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index e0da52687db..5d11cc7bc5a 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -8534,8 +8534,10 @@ void Node3DEditor::_preview_settings_changed() { } { //preview env - sky_material->set_sky_energy_multiplier(environ_energy->get_value()); - Color hz_color = environ_sky_color->get_pick_color().lerp(environ_ground_color->get_pick_color(), 0.5).lerp(Color(1, 1, 1), 0.5); + sky_material->set_energy_multiplier(environ_energy->get_value()); + Color hz_color = environ_sky_color->get_pick_color().lerp(environ_ground_color->get_pick_color(), 0.5); + float hz_lum = hz_color.get_luminance() * 3.333; + hz_color = hz_color.lerp(Color(hz_lum, hz_lum, hz_lum), 0.5); sky_material->set_sky_top_color(environ_sky_color->get_pick_color()); sky_material->set_sky_horizon_color(hz_color); sky_material->set_ground_bottom_color(environ_ground_color->get_pick_color());