summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-05-30 14:27:25 +0200
committerGitHub <noreply@github.com>2019-05-30 14:27:25 +0200
commit603bb983403d4b081204f4898d7fdc70ceef1fe9 (patch)
treeddc29e291c50e546333d88bb07a718ad16899212
parent0c74aae57616fb91dd348cb485404486a95a2064 (diff)
parenteb0cced3c0267372381b4bb441475a18d59973ff (diff)
Merge pull request #29188 from Calinou/improve-ssao-performance-quality
Improve SSAO performance and quality
-rw-r--r--drivers/gles3/shaders/ssao.glsl6
-rw-r--r--scene/resources/environment.cpp6
2 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gles3/shaders/ssao.glsl b/drivers/gles3/shaders/ssao.glsl
index be44365169..d9cdc3fc1f 100644
--- a/drivers/gles3/shaders/ssao.glsl
+++ b/drivers/gles3/shaders/ssao.glsl
@@ -16,15 +16,15 @@ void main() {
#define TWO_PI 6.283185307179586476925286766559
#ifdef SSAO_QUALITY_HIGH
-#define NUM_SAMPLES (80)
+#define NUM_SAMPLES (16)
#endif
#ifdef SSAO_QUALITY_LOW
-#define NUM_SAMPLES (15)
+#define NUM_SAMPLES (8)
#endif
#if !defined(SSAO_QUALITY_LOW) && !defined(SSAO_QUALITY_HIGH)
-#define NUM_SAMPLES (40)
+#define NUM_SAMPLES (12)
#endif
// If using depth mip levels, the log of the maximum pixel offset before we need to switch to a lower
diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp
index 17609ed505..52dfffda5b 100644
--- a/scene/resources/environment.cpp
+++ b/scene/resources/environment.cpp
@@ -1294,8 +1294,8 @@ void Environment::_bind_methods() {
Environment::Environment() :
bg_mode(BG_CLEAR_COLOR),
tone_mapper(TONE_MAPPER_LINEAR),
- ssao_blur(SSAO_BLUR_DISABLED),
- ssao_quality(SSAO_QUALITY_LOW),
+ ssao_blur(SSAO_BLUR_3x3),
+ ssao_quality(SSAO_QUALITY_MEDIUM),
glow_blend_mode(GLOW_BLEND_MODE_ADDITIVE),
dof_blur_far_quality(DOF_BLUR_QUALITY_LOW),
dof_blur_near_quality(DOF_BLUR_QUALITY_LOW) {
@@ -1346,7 +1346,7 @@ Environment::Environment() :
ssao_ao_channel_affect = 0.0;
ssao_blur = SSAO_BLUR_3x3;
set_ssao_edge_sharpness(4);
- set_ssao_quality(SSAO_QUALITY_LOW);
+ set_ssao_quality(SSAO_QUALITY_MEDIUM);
glow_enabled = false;
glow_levels = (1 << 2) | (1 << 4);