summaryrefslogtreecommitdiff
path: root/gfx/gl/shaders/shadowDynamicPointStencil.vs
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-08-28 03:48:19 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2024-08-28 03:48:19 +0100
commitae9087aea7aa2b19bf78daa6593d14dfba98183d (patch)
tree0263fd2580239c9ac55a4cc775b2a3c3e3f14eb7 /gfx/gl/shaders/shadowDynamicPointStencil.vs
parentSet stencil texture min/mag filters (diff)
downloadilt-ae9087aea7aa2b19bf78daa6593d14dfba98183d.tar.bz2
ilt-ae9087aea7aa2b19bf78daa6593d14dfba98183d.tar.xz
ilt-ae9087aea7aa2b19bf78daa6593d14dfba98183d.zip
Initial cut of shadow map creation with support for billboard shadows
Diffstat (limited to 'gfx/gl/shaders/shadowDynamicPointStencil.vs')
-rw-r--r--gfx/gl/shaders/shadowDynamicPointStencil.vs17
1 files changed, 17 insertions, 0 deletions
diff --git a/gfx/gl/shaders/shadowDynamicPointStencil.vs b/gfx/gl/shaders/shadowDynamicPointStencil.vs
new file mode 100644
index 0000000..dadf9c2
--- /dev/null
+++ b/gfx/gl/shaders/shadowDynamicPointStencil.vs
@@ -0,0 +1,17 @@
+#version 330 core
+#extension GL_ARB_shading_language_420pack : enable
+
+layout(location = 0) in mat3 model;
+layout(location = 3) in ivec3 worldPos;
+uniform ivec3 viewPoint;
+uniform vec3 centre;
+
+out mat3 vmodel;
+out ivec3 vworldPos;
+
+void
+main()
+{
+ vmodel = model;
+ vworldPos = worldPos - viewPoint + ivec3(centre);
+}