summaryrefslogtreecommitdiff
path: root/gfx/gl/shaders/shadowDynamicPointStencil.frag
blob: d6b8a0e89b3dfd02d4dc2f510f7c838046a4e2d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#version 460 core

layout(binding = 0) uniform sampler2DArray stencilDepth;
flat in vec3 scale;
in vec3 texCoord;

void
main()
{
	float stDepth = texture(stencilDepth, texCoord).r;
	if (stDepth >= 1) {
		discard;
	}
	gl_FragDepth = gl_FragCoord.z + ((stDepth - 0.5) * scale.z);
}