瀏覽代碼

Merge pull request #38954 from puchik/ssr-far-clip

Check if screen space reflection has passed far clip
Rémi Verschelde 4 年之前
父節點
當前提交
4a92d2111b
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      drivers/gles3/shaders/screen_space_reflection.glsl

+ 2 - 2
drivers/gles3/shaders/screen_space_reflection.glsl

@@ -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;