Files
test/source/blender/gpu/shaders/gpu_shader_fx_depth_resolve.glsl
2017-03-15 13:17:49 +01:00

20 lines
287 B
GLSL

uniform sampler2D depthbuffer;
#if __VERSION__ == 120
varying vec4 uvcoordsvar;
#else
in vec4 uvcoordsvar;
#endif
void main(void)
{
float depth = texture2D(depthbuffer, uvcoordsvar.xy).r;
/* XRay background, discard */
if (depth >= 1.0) {
discard;
}
gl_FragDepth = depth;
}