summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2020-04-20 23:34:47 +0200
committerHugo Locurcio <hugo.locurcio@hugo.pro>2020-08-14 23:12:33 +0200
commit88915790681c7a76c4b6b76aca6b811b17055a33 (patch)
treeebfcf46557c2a0eb51a4a3b00f78b86b0cf32c4f /editor/plugins
parentaded76cb84fd1081279d2ed11fd73b553c6e6b4e (diff)
Add a debanding property to Viewport
It can be enabled in the Project Settings (`rendering/quality/screen_filters/use_debanding`). It's disabled by default as it has a small performance impact and can make PNG screenshots much larger (due to how dithering works). It will also slightly brighten the scene's dark areas. As a result, it should be enabled only when banding is noticeable enough. This closes #17006.
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index b4b81cc7f0..ed77e6e3c4 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -2447,12 +2447,14 @@ void Node3DEditorViewport::_notification(int p_what) {
subviewport_container->set_stretch_shrink(shrink ? 2 : 1);
}
- //update msaa if changed
+ // Update MSAA, screen-space AA and debanding if changed
- int msaa_mode = ProjectSettings::get_singleton()->get("rendering/quality/screen_filters/msaa");
+ const int msaa_mode = ProjectSettings::get_singleton()->get("rendering/quality/screen_filters/msaa");
viewport->set_msaa(Viewport::MSAA(msaa_mode));
- int ssaa_mode = GLOBAL_GET("rendering/quality/screen_filters/screen_space_aa");
+ const int ssaa_mode = GLOBAL_GET("rendering/quality/screen_filters/screen_space_aa");
viewport->set_screen_space_aa(Viewport::ScreenSpaceAA(ssaa_mode));
+ const bool use_debanding = GLOBAL_GET("rendering/quality/screen_filters/use_debanding");
+ viewport->set_use_debanding(use_debanding);
bool show_info = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_INFORMATION));
if (show_info != info_label->is_visible()) {