diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 1fe0be893e19..6851b55c41fe 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -2407,7 +2407,7 @@ The thread model to use for rendering. Rendering on a thread may improve performance, but synchronizing to the main thread can cause a bit more jitter. - + Default background clear color. Overridable per [Viewport] using its [Environment]. See [member Environment.background_mode] and [member Environment.background_color] in particular. To change this default color programmatically, use [method RenderingServer.set_default_clear_color]. diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index b787563d64b8..fa8211ce81e3 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -6136,6 +6136,7 @@ Dictionary Node3DEditor::get_state() const { pd["sun_rotation"] = sun_rotation; pd["environ_sky_color"] = environ_sky_color->get_pick_color(); + pd["environ_hz_color"] = environ_hz_color->get_pick_color(); pd["environ_ground_color"] = environ_ground_color->get_pick_color(); pd["environ_energy"] = environ_energy->get_value(); pd["environ_glow_enabled"] = environ_glow_button->is_pressed(); @@ -7887,6 +7888,7 @@ void Node3DEditor::_update_theme() { sun_color->set_custom_minimum_size(Size2(0, get_theme_constant(SNAME("color_picker_button_height"), EditorStringName(Editor)))); environ_sky_color->set_custom_minimum_size(Size2(0, get_theme_constant(SNAME("color_picker_button_height"), EditorStringName(Editor)))); + environ_hz_color->set_custom_minimum_size(Size2(0, get_theme_constant(SNAME("color_picker_button_height"), EditorStringName(Editor)))); environ_ground_color->set_custom_minimum_size(Size2(0, get_theme_constant(SNAME("color_picker_button_height"), EditorStringName(Editor)))); context_toolbar_panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SNAME("ContextualToolbar"), EditorStringName(EditorStyles))); @@ -8383,7 +8385,7 @@ 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); + Color hz_color = environ_sky_color->get_pick_color().lerp(environ_ground_color->get_pick_color(), 0.5).lerp(environ_hz_color->get_pick_color(), 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()); @@ -8410,8 +8412,9 @@ void Node3DEditor::_load_default_preview_settings() { sun_angle_altitude->set_value(-Math::rad_to_deg(sun_rotation.x)); sun_angle_azimuth->set_value(180.0 - Math::rad_to_deg(sun_rotation.y)); sun_direction->queue_redraw(); - environ_sky_color->set_pick_color(Color(0.385, 0.454, 0.55)); - environ_ground_color->set_pick_color(Color(0.2, 0.169, 0.133)); + environ_sky_color->set_pick_color(Color(0.141, 0.289, 0.447)); + environ_hz_color->set_pick_color(Color(0.447, 0.443, 0.612)); + environ_ground_color->set_pick_color(Color(0.333, 0.333, 0.333)); environ_energy->set_value(1.0); if (OS::get_singleton()->get_current_rendering_method() != "gl_compatibility") { environ_glow_button->set_pressed(true); @@ -9070,6 +9073,11 @@ void fragment() { environ_sky_color->connect("color_changed", callable_mp(this, &Node3DEditor::_preview_settings_changed).unbind(1)); environ_sky_color->get_popup()->connect("about_to_popup", callable_mp(EditorNode::get_singleton(), &EditorNode::setup_color_picker).bind(environ_sky_color->get_picker())); environ_vb->add_margin_child(TTR("Sky Color"), environ_sky_color); + environ_hz_color = memnew(ColorPickerButton); + environ_hz_color->set_edit_alpha(false); + environ_hz_color->connect("color_changed", callable_mp(this, &Node3DEditor::_preview_settings_changed).unbind(1)); + environ_hz_color->get_popup()->connect("about_to_popup", callable_mp(EditorNode::get_singleton(), &EditorNode::setup_color_picker).bind(environ_hz_color->get_picker())); + environ_vb->add_margin_child(TTR("Horizon Color"), environ_hz_color); environ_ground_color = memnew(ColorPickerButton); environ_ground_color->connect("color_changed", callable_mp(this, &Node3DEditor::_preview_settings_changed).unbind(1)); environ_ground_color->set_edit_alpha(false); diff --git a/editor/plugins/node_3d_editor_plugin.h b/editor/plugins/node_3d_editor_plugin.h index 9e7d46c5e853..11f2c5065909 100644 --- a/editor/plugins/node_3d_editor_plugin.h +++ b/editor/plugins/node_3d_editor_plugin.h @@ -807,6 +807,7 @@ class Node3DEditor : public VBoxContainer { Label *environ_title = nullptr; VBoxContainer *environ_vb = nullptr; ColorPickerButton *environ_sky_color = nullptr; + ColorPickerButton *environ_hz_color = nullptr; ColorPickerButton *environ_ground_color = nullptr; EditorSpinSlider *environ_energy = nullptr; Button *environ_ao_button = nullptr; diff --git a/main/main.cpp b/main/main.cpp index dbd975294871..04a019f49caa 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -2944,7 +2944,7 @@ Error Main::setup2(bool p_show_boot_logo) { DisplayServer::get_singleton()->window_set_flag(DisplayServer::WINDOW_FLAG_ALWAYS_ON_TOP, true); } - Color clear = GLOBAL_DEF_BASIC("rendering/environment/defaults/default_clear_color", Color(0.3, 0.3, 0.3)); + Color clear = GLOBAL_DEF_BASIC("rendering/environment/defaults/default_clear_color", Color(0.155, 0.151, 0.236)); RenderingServer::get_singleton()->set_default_clear_color(clear); if (p_show_boot_logo) {