summaryrefslogtreecommitdiff
path: root/gfx/gl/shaders
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/gl/shaders')
-rw-r--r--gfx/gl/shaders/shadowStencil.fs16
-rw-r--r--gfx/gl/shaders/shadowStencil.vs7
2 files changed, 23 insertions, 0 deletions
diff --git a/gfx/gl/shaders/shadowStencil.fs b/gfx/gl/shaders/shadowStencil.fs
index e69de29..f149c23 100644
--- a/gfx/gl/shaders/shadowStencil.fs
+++ b/gfx/gl/shaders/shadowStencil.fs
@@ -0,0 +1,16 @@
+#version 330 core
+#extension GL_ARB_shading_language_420pack : enable
+
+layout(binding = 0) uniform sampler2D textureAlbedo;
+
+include(`materialInterface.glsl')
+include(`materialCommon.glsl')
+
+void
+main()
+{
+ if (getTextureColour(Material, TexCoords).a < 0.5) {
+ discard;
+ }
+ gl_FragDepth = gl_FragCoord.z;
+}
diff --git a/gfx/gl/shaders/shadowStencil.vs b/gfx/gl/shaders/shadowStencil.vs
index 4f4c250..45a0867 100644
--- a/gfx/gl/shaders/shadowStencil.vs
+++ b/gfx/gl/shaders/shadowStencil.vs
@@ -1,11 +1,18 @@
#version 330 core
#extension GL_ARB_shading_language_420pack : enable
+layout(binding = 1) uniform usampler2DRect materialData;
+
include(`meshIn.glsl')
+include(`materialInterface.glsl')
+include(`getMaterialDetail.glsl')
uniform mat4 viewProjection;
void
main()
{
+ TexCoords = texCoord;
+ Material = getMaterialDetail(material);
+
gl_Position = viewProjection * vec4(position, 1);
}