diff options
author | Max Hilbrunner <mhilbrunner@users.noreply.github.com> | 2022-08-19 21:16:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-19 21:16:32 +0200 |
commit | 117c530e1da02d3037004d695966efff64b384f3 (patch) | |
tree | 2763977e5fbee9e44d7d83373bfcbf112a06bcca /servers | |
parent | b35ff86c176fef561557f2dd96b597c9c27c4e5e (diff) | |
parent | 7d6287f616270270a117ff7d66726847f0374de3 (diff) |
Merge pull request #64342 from clayjohn/DOF-scale
Properly scale depth in bokeh_dof effect
Diffstat (limited to 'servers')
-rw-r--r-- | servers/rendering/renderer_rd/shaders/effects/bokeh_dof.glsl | 2 | ||||
-rw-r--r-- | servers/rendering/renderer_rd/shaders/effects/bokeh_dof_raster.glsl | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/servers/rendering/renderer_rd/shaders/effects/bokeh_dof.glsl b/servers/rendering/renderer_rd/shaders/effects/bokeh_dof.glsl index 0438671dd2..0b43af7738 100644 --- a/servers/rendering/renderer_rd/shaders/effects/bokeh_dof.glsl +++ b/servers/rendering/renderer_rd/shaders/effects/bokeh_dof.glsl @@ -30,7 +30,7 @@ layout(set = 1, binding = 0) uniform sampler2D source_bokeh; #ifdef MODE_GEN_BLUR_SIZE float get_depth_at_pos(vec2 uv) { - float depth = textureLod(source_depth, uv, 0.0).x; + float depth = textureLod(source_depth, uv, 0.0).x * 2.0 - 1.0; if (params.orthogonal) { depth = ((depth + (params.z_far + params.z_near) / (params.z_far - params.z_near)) * (params.z_far - params.z_near)) / 2.0; } else { diff --git a/servers/rendering/renderer_rd/shaders/effects/bokeh_dof_raster.glsl b/servers/rendering/renderer_rd/shaders/effects/bokeh_dof_raster.glsl index a3b3938ee9..a06cacfabe 100644 --- a/servers/rendering/renderer_rd/shaders/effects/bokeh_dof_raster.glsl +++ b/servers/rendering/renderer_rd/shaders/effects/bokeh_dof_raster.glsl @@ -52,7 +52,7 @@ layout(set = 2, binding = 0) uniform sampler2D original_weight; #ifdef MODE_GEN_BLUR_SIZE float get_depth_at_pos(vec2 uv) { - float depth = textureLod(source_depth, uv, 0.0).x; + float depth = textureLod(source_depth, uv, 0.0).x * 2.0 - 1.0; if (params.orthogonal) { depth = ((depth + (params.z_far + params.z_near) / (params.z_far - params.z_near)) * (params.z_far - params.z_near)) / 2.0; } else { |