Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gpu_shader_fx_depth_resolve.glsl « shaders « gpu « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 468908b858ca8dcdea515cb8e78ba48b0bb83c8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
uniform sampler2D depthbuffer;

#if __VERSION__ == 120
	varying vec4 uvcoordsvar;
#else
	in vec4 uvcoordsvar;
	#define texture2D texture
#endif

void main(void)
{
	float depth = texture2D(depthbuffer, uvcoordsvar.xy).r;

	/* XRay background, discard */
	if (depth >= 1.0) {
		discard;
	}

	gl_FragDepth = depth;
}