summaryrefslogtreecommitdiff
path: root/assets/fragment.glsl
blob: 91d89a2d269b4e1ceb769e2a47ec879660a47efe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#version 430 core

in vec2 fTexCoord;
in vec3 fPos;
in noperspective vec2 fDepthTexCoord;

out vec4 oColor;

uniform sampler2D materialTexture;
//uniform sampler2DShadow prevDepth;
//uniform sampler2DMS prevDepth;
uniform sampler2D prevDepth;

void main()
{
	//if (texture(prevDepth, vec3(fDepthTexCoord, gl_FragCoord.z + 0.000005)) == 1)
	if (gl_FragCoord.z + 0.000005 >= texelFetch(prevDepth, ivec2(gl_FragCoord.xy), gl_SampleID).r)
		discard;
	oColor = vec4(fPos, 0.5);
}