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.
This commit is contained in:
Stayd 2024-12-03 02:34:33 -07:00
parent 0f20e67d8d
commit 8ca1605bbb

View file

@ -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());