diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-04-15 00:21:32 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-04-15 00:21:32 +0100 |
commit | a07d2024178106df99b82fe21a34402c5200e8f6 (patch) | |
tree | 78ec748448b2a1f16823358fd750c407f9a54cc5 /gfx/gl/shaders/dynamicPointInst.vs | |
parent | Rename lots of shader files (diff) | |
download | ilt-a07d2024178106df99b82fe21a34402c5200e8f6.tar.bz2 ilt-a07d2024178106df99b82fe21a34402c5200e8f6.tar.xz ilt-a07d2024178106df99b82fe21a34402c5200e8f6.zip |
Add the dynamicPoint shader for instancing
Same as dynamicPoint, but the model matrix is a vertex input
Diffstat (limited to 'gfx/gl/shaders/dynamicPointInst.vs')
-rw-r--r-- | gfx/gl/shaders/dynamicPointInst.vs | 21 |
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..016153a --- /dev/null +++ b/gfx/gl/shaders/dynamicPointInst.vs @@ -0,0 +1,21 @@ +#version 330 core + +include(`meshIn.glsl') +layout(location = 6) 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; +} |