Skip to content

Commit

Permalink
Check if screen space reflection has passed far clip
Browse files Browse the repository at this point in the history
Before "accepting" the reflection, check if it's within our view (prevent tracing environment and creating artifacts).
  • Loading branch information
puchik committed Jun 4, 2020
1 parent 8cf450c commit 48ffd3d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gles3/shaders/screen_space_reflection.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ void main() {

if (depth > z_to) {
// if depth was surpassed
if (depth <= max(z_to, z_from) + depth_tolerance) {
// check the depth tolerance
if ((depth <= max(z_to, z_from) + depth_tolerance) && (-depth < camera_z_far)) {
// check the depth tolerance and far clip
found = true;
}
break;
Expand Down

0 comments on commit 48ffd3d

Please sign in to comment.