make greenscreen invert work with infinite distance

This commit is contained in:
Xonk committed 2026-04-19 00:32:29 -04:00
1 parent a006877513
commit 7cab950c51
1 file changed
+12 -5
+12 -5
View File
@@ -200,12 +200,19 @@ void doCameraGridLines(inout vec3 color, in vec2 texcoord){
if(linearDistance > 0.0) color = vec3(COLOR_KEY_R,COLOR_KEY_G,COLOR_KEY_B);
#else
// composite
#ifdef USING_LOD_MOD
if(min(texelFetch(LOD_DEPTHTEX0,ivec2(gl_FragCoord.xy),0).r,texelFetch(depthtex0,ivec2(gl_FragCoord.xy),0).r) >= 1.0) color = vec3(COLOR_KEY_R,COLOR_KEY_G,COLOR_KEY_B);
#ifdef COLOR_KEY_INVERT
#ifdef USING_LOD_MOD
if(min(texelFetch(LOD_DEPTHTEX0,ivec2(gl_FragCoord.xy),0).r,texelFetch(depthtex0,ivec2(gl_FragCoord.xy),0).r) < 1.0) color = vec3(COLOR_KEY_R,COLOR_KEY_G,COLOR_KEY_B);
#else
if(texelFetch(depthtex0,ivec2(gl_FragCoord.xy),0).r < 1.0) color = vec3(COLOR_KEY_R,COLOR_KEY_G,COLOR_KEY_B);
#endif
#else
if(texelFetch(depthtex0,ivec2(gl_FragCoord.xy),0).r >= 1.0) color = vec3(COLOR_KEY_R,COLOR_KEY_G,COLOR_KEY_B);
#endif
#ifdef USING_LOD_MOD
if(min(texelFetch(LOD_DEPTHTEX0,ivec2(gl_FragCoord.xy),0).r,texelFetch(depthtex0,ivec2(gl_FragCoord.xy),0).r) >= 1.0) color = vec3(COLOR_KEY_R,COLOR_KEY_G,COLOR_KEY_B);
#else
if(texelFetch(depthtex0,ivec2(gl_FragCoord.xy),0).r >= 1.0) color = vec3(COLOR_KEY_R,COLOR_KEY_G,COLOR_KEY_B);
#endif
#endif
#endif
}
#endif