summaryrefslogtreecommitdiff
path: root/gfx/gl/shaders/dynamicPointInst.vs
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-04-22 19:06:42 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2023-04-22 19:06:42 +0100
commitd1f79b4c438ebf0822741e103b2cb06bdee4514e (patch)
treea4d574d12cd81d5e33886ce7ca961f7dbe872fcf /gfx/gl/shaders/dynamicPointInst.vs
parentRename lots of shader files (diff)
parentKeep the instance unused vector sorted and binary search it (diff)
downloadilt-d1f79b4c438ebf0822741e103b2cb06bdee4514e.tar.bz2
ilt-d1f79b4c438ebf0822741e103b2cb06bdee4514e.tar.xz
ilt-d1f79b4c438ebf0822741e103b2cb06bdee4514e.zip
Merge branch 'instancing'
Diffstat (limited to 'gfx/gl/shaders/dynamicPointInst.vs')
-rw-r--r--gfx/gl/shaders/dynamicPointInst.vs21
1 files changed, 21 insertions, 0 deletions
diff --git a/gfx/gl/shaders/dynamicPointInst.vs b/gfx/gl/shaders/dynamicPointInst.vs
new file mode 100644
index 0000000..1c66979
--- /dev/null
+++ b/gfx/gl/shaders/dynamicPointInst.vs
@@ -0,0 +1,21 @@
+#version 330 core
+
+include(`meshIn.glsl')
+layout(location = 5) in mat4 model;
+include(`materialInterface.glsl')
+
+uniform mat4 viewProjection;
+
+void
+main()
+{
+ vec4 worldPos = model * vec4(position, 1.0);
+
+ FragPos = worldPos.xyz;
+ TexCoords = texCoord;
+ Normal = (model * vec4(normal, 0.0)).xyz;
+ Colour = colour;
+ Material = material;
+
+ gl_Position = viewProjection * worldPos;
+}