summaryrefslogtreecommitdiff
path: root/servers/rendering/renderer_rd
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-02-21 21:16:07 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-02-21 21:16:07 +0100
commit1fc28fe31fe2b28d69e3a91c497b062dcc1fd9bf (patch)
tree7ae27eb45c96548f8bb2e10a1d78d08856c5d555 /servers/rendering/renderer_rd
parentae21832823f6cc72d5c4d11092456eb86dfe15e4 (diff)
parentdb9dfb7233e52e7c1249df06cf9fd5168e4e857a (diff)
Merge pull request #73698 from clayjohn/SS-bias
Increase SSAO and SSIL bias to account for variance in mipmap generation
Diffstat (limited to 'servers/rendering/renderer_rd')
-rw-r--r--servers/rendering/renderer_rd/shaders/effects/ssao.glsl4
-rw-r--r--servers/rendering/renderer_rd/shaders/effects/ssil.glsl4
2 files changed, 4 insertions, 4 deletions
diff --git a/servers/rendering/renderer_rd/shaders/effects/ssao.glsl b/servers/rendering/renderer_rd/shaders/effects/ssao.glsl
index ffaa6872c9..58efc68bc7 100644
--- a/servers/rendering/renderer_rd/shaders/effects/ssao.glsl
+++ b/servers/rendering/renderer_rd/shaders/effects/ssao.glsl
@@ -307,8 +307,8 @@ void generate_SSAO_shadows_internal(out float r_shadow_term, out vec4 r_edges, o
// edge mask for between this and left/right/top/bottom neighbor pixels - not used in quality level 0 so initialize to "no edge" (1 is no edge, 0 is edge)
vec4 edgesLRTB = vec4(1.0, 1.0, 1.0, 1.0);
- // Move center pixel slightly towards camera to avoid imprecision artifacts due to using of 16bit depth buffer; a lot smaller offsets needed when using 32bit floats
- pix_center_pos *= 0.9992;
+ // Move center pixel slightly towards camera to avoid imprecision artifacts due to using of 16bit depth buffer.
+ pix_center_pos *= 0.99;
if (!p_adaptive_base && (p_quality_level >= SSAO_DEPTH_BASED_EDGES_ENABLE_AT_QUALITY_PRESET)) {
edgesLRTB = calculate_edges(pix_z, pix_left_z, pix_right_z, pix_top_z, pix_bottom_z);
diff --git a/servers/rendering/renderer_rd/shaders/effects/ssil.glsl b/servers/rendering/renderer_rd/shaders/effects/ssil.glsl
index de7b97953f..fac13b0e3f 100644
--- a/servers/rendering/renderer_rd/shaders/effects/ssil.glsl
+++ b/servers/rendering/renderer_rd/shaders/effects/ssil.glsl
@@ -321,8 +321,8 @@ void generate_SSIL(out vec3 r_color, out vec4 r_edges, out float r_obscurance, o
// edge mask for between this and left/right/top/bottom neighbor pixels - not used in quality level 0 so initialize to "no edge" (1 is no edge, 0 is edge)
vec4 edgesLRTB = vec4(1.0, 1.0, 1.0, 1.0);
- // Move center pixel slightly towards camera to avoid imprecision artifacts due to using of 16bit depth buffer; a lot smaller offsets needed when using 32bit floats
- pix_center_pos *= 0.9992;
+ // Move center pixel slightly towards camera to avoid imprecision artifacts due to using of 16bit depth buffer.
+ pix_center_pos *= 0.99;
if (!p_adaptive_base && (p_quality_level >= SSIL_DEPTH_BASED_EDGES_ENABLE_AT_QUALITY_PRESET)) {
edgesLRTB = calculate_edges(pix_z, pix_left_z, pix_right_z, pix_top_z, pix_bottom_z);