Add a debanding property to Viewport for GLES3

It can be enabled in the Project Settings
(`rendering/quality/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).

As a result, it should be enabled only when banding is noticeable enough.

Since debanding requires a HDR viewport to work, it's only supported
in the GLES3 backend.
This commit is contained in:
Hugo Locurcio 2020-10-20 18:58:07 +02:00
parent 150f9ce807
commit 2dbc329704
No known key found for this signature in database
GPG key ID: 39E8F8BE30B0A49C
21 changed files with 109 additions and 3 deletions

View file

@ -2478,7 +2478,7 @@ void SpatialEditorViewport::_notification(int p_what) {
viewport_container->set_stretch_shrink(shrink ? 2 : 1);
}
//update msaa if changed
// Update MSAA, FXAA, debanding and HDR if changed.
int msaa_mode = ProjectSettings::get_singleton()->get("rendering/quality/filters/msaa");
viewport->set_msaa(Viewport::MSAA(msaa_mode));
@ -2486,6 +2486,9 @@ void SpatialEditorViewport::_notification(int p_what) {
bool use_fxaa = ProjectSettings::get_singleton()->get("rendering/quality/filters/use_fxaa");
viewport->set_use_fxaa(use_fxaa);
bool use_debanding = ProjectSettings::get_singleton()->get("rendering/quality/filters/use_debanding");
viewport->set_use_debanding(use_debanding);
bool hdr = ProjectSettings::get_singleton()->get("rendering/quality/depth/hdr");
viewport->set_hdr(hdr);