diff options
author | Juan Linietsky <reduzio@gmail.com> | 2020-10-18 14:45:33 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-18 14:45:33 -0300 |
commit | 4467412c9f78f3ddaf7edd4627ec7d629a6234df (patch) | |
tree | 333ec1dbeec30dad994b1ba9bd16db030746a134 /servers | |
parent | d9e5c355e5738eb23d3208db5240240df4bd1226 (diff) | |
parent | 48a59e6c4aee952af7d5d1ce9a5234ded98f89d9 (diff) |
Merge pull request #38949 from puchik/ssr-fix-cutoff
Continue tracing screen space reflection after encountering sky
Diffstat (limited to 'servers')
-rw-r--r-- | servers/rendering/rasterizer_rd/shaders/screen_space_reflection.glsl | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/servers/rendering/rasterizer_rd/shaders/screen_space_reflection.glsl b/servers/rendering/rasterizer_rd/shaders/screen_space_reflection.glsl index a8ee33a664..06dc4b13de 100644 --- a/servers/rendering/rasterizer_rd/shaders/screen_space_reflection.glsl +++ b/servers/rendering/rasterizer_rd/shaders/screen_space_reflection.glsl @@ -155,18 +155,14 @@ void main() { depth = imageLoad(source_depth, ivec2(pos - 0.5)).r; - if (-depth >= params.camera_z_far) { //went beyond camera - break; - } - z_from = z_to; z_to = z / w; if (depth > z_to) { // if depth was surpassed - if (depth <= max(z_to, z_from) + params.depth_tolerance) { - // check the depth tolerance - //check that normal is valid + if (depth <= max(z_to, z_from) + params.depth_tolerance && -depth < params.camera_z_far) { + // check the depth tolerance and far clip + // check that normal is valid found = true; } break; |