Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak the editor environment defaults and its interface #49736

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/classes/Environment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@
<member name="tonemap_mode" type="int" setter="set_tonemapper" getter="get_tonemapper" enum="Environment.ToneMapper" default="0">
The tonemapping mode to use. Tonemapping is the process that "converts" HDR values to be suitable for rendering on a LDR display. (Godot doesn't support rendering on HDR displays yet.)
</member>
<member name="tonemap_white" type="float" setter="set_tonemap_white" getter="get_tonemap_white" default="1.0">
<member name="tonemap_white" type="float" setter="set_tonemap_white" getter="get_tonemap_white" default="6.0">
The white reference value for tonemapping (also called "whitepoint"). Higher values can make highlights look less blown out, and will also slightly darken the whole scene as a result. Only effective if the [member tonemap_mode] isn't set to [constant TONE_MAPPER_LINEAR]. See also [member tonemap_exposure].
</member>
<member name="volumetric_fog_albedo" type="Color" setter="set_volumetric_fog_albedo" getter="get_volumetric_fog_albedo" default="Color(1, 1, 1, 1)">
Expand Down
30 changes: 17 additions & 13 deletions editor/plugins/node_3d_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7582,7 +7582,7 @@ void Node3DEditor::_preview_settings_changed() {
environment->set_ssao_enabled(environ_ao_button->is_pressed());
environment->set_glow_enabled(environ_glow_button->is_pressed());
environment->set_sdfgi_enabled(environ_gi_button->is_pressed());
environment->set_tonemapper(environ_tonemap_button->is_pressed() ? Environment::TONE_MAPPER_FILMIC : Environment::TONE_MAPPER_LINEAR);
environment->set_tonemapper(environ_tonemap_button->is_pressed() ? Environment::TONE_MAPPER_ACES : Environment::TONE_MAPPER_LINEAR);
}
}

Expand All @@ -7603,8 +7603,8 @@ void Node3DEditor::_load_default_preview_settings() {
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_energy->set_value(1.0);
environ_glow_button->set_pressed(true);
environ_tonemap_button->set_pressed(true);
environ_glow_button->set_pressed(true);
environ_ao_button->set_pressed(false);
environ_gi_button->set_pressed(false);
sun_max_distance->set_value(250);
Expand Down Expand Up @@ -8251,23 +8251,27 @@ void fragment() {
HBoxContainer *fx_vb = memnew(HBoxContainer);
fx_vb->set_h_size_flags(SIZE_EXPAND_FILL);

environ_ao_button = memnew(Button);
environ_ao_button->set_text(TTR("AO"));
environ_ao_button->set_toggle_mode(true);
environ_ao_button->connect("pressed", callable_mp(this, &Node3DEditor::_preview_settings_changed), CONNECT_DEFERRED);
fx_vb->add_child(environ_ao_button);
environ_tonemap_button = memnew(Button);
environ_tonemap_button->set_text(TTR("ACES Tonemap"));
environ_tonemap_button->set_tooltip(TTR("Uses ACES tonemapping instead of linear tonemapping. This adjusts colors to avoid blowing out highlights.\nLow performance cost."));
environ_tonemap_button->set_toggle_mode(true);
environ_tonemap_button->connect("pressed", callable_mp(this, &Node3DEditor::_preview_settings_changed), CONNECT_DEFERRED);
fx_vb->add_child(environ_tonemap_button);
environ_glow_button = memnew(Button);
environ_glow_button->set_text(TTR("Glow"));
environ_glow_button->set_tooltip(TTR("Makes bright pixels \"bleed\" out, simulating real world vision.\nModerate performance cost."));
environ_glow_button->set_toggle_mode(true);
environ_glow_button->connect("pressed", callable_mp(this, &Node3DEditor::_preview_settings_changed), CONNECT_DEFERRED);
fx_vb->add_child(environ_glow_button);
environ_tonemap_button = memnew(Button);
environ_tonemap_button->set_text(TTR("Tonemap"));
environ_tonemap_button->set_toggle_mode(true);
environ_tonemap_button->connect("pressed", callable_mp(this, &Node3DEditor::_preview_settings_changed), CONNECT_DEFERRED);
fx_vb->add_child(environ_tonemap_button);
environ_ao_button = memnew(Button);
environ_ao_button->set_text(TTR("SSAO"));
environ_ao_button->set_tooltip(TTR("Enables screen-space ambient occlusion, which helps objects stand out from each other.\nModerate performance cost."));
environ_ao_button->set_toggle_mode(true);
environ_ao_button->connect("pressed", callable_mp(this, &Node3DEditor::_preview_settings_changed), CONNECT_DEFERRED);
fx_vb->add_child(environ_ao_button);
environ_gi_button = memnew(Button);
environ_gi_button->set_text(TTR("GI"));
environ_gi_button->set_text(TTR("SDFGI"));
environ_gi_button->set_tooltip(TTR("Provides semi-real-time global illumination for the scene using signed distance field global illumination.\nMeshes must have their GI Mode set to Static for them to contribute to SDFGI.\nHigh performance cost."));
environ_gi_button->set_toggle_mode(true);
environ_gi_button->connect("pressed", callable_mp(this, &Node3DEditor::_preview_settings_changed), CONNECT_DEFERRED);
fx_vb->add_child(environ_gi_button);
Expand Down
2 changes: 1 addition & 1 deletion scene/resources/environment.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class Environment : public Resource {
// Tonemap
ToneMapper tone_mapper = TONE_MAPPER_LINEAR;
float tonemap_exposure = 1.0;
float tonemap_white = 1.0;
float tonemap_white = 6.0;
bool tonemap_auto_exposure_enabled = false;
float tonemap_auto_exposure_min = 0.05;
float tonemap_auto_exposure_max = 8.0;
Expand Down