summaryrefslogtreecommitdiff
path: root/assets/fragment.glsl
blob: 3e67b83ec78a80cef5255b095515945479599bc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#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)
	if (gl_FragCoord.z + 0.000005 < texelFetch(prevDepth, ivec2(gl_FragCoord.xy), gl_SampleID).r)
		oColor = vec4(fPos, 0.5);
		//oColor = texelFetch(prevDepth, ivec2(gl_FragCoord.xy), gl_SampleID);
	else
		discard;
	//if (texture(prevDepth, vec3(fDepthTexCoord, )) < 1)
	//	discard;

}