summaryrefslogtreecommitdiff
path: root/gfx/gl/shaders/pointLight.vs
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-01-13 11:31:13 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-01-13 11:31:13 +0000
commit332355a9f4a4199e0ddb51852546d44ec54e176f (patch)
tree4998cde56004f53a0218dc5f00d578f939ffea08 /gfx/gl/shaders/pointLight.vs
parentInteger support in persistence (diff)
parentOnly create VAOs for the light type(s) in use (diff)
downloadilt-332355a9f4a4199e0ddb51852546d44ec54e176f.tar.bz2
ilt-332355a9f4a4199e0ddb51852546d44ec54e176f.tar.xz
ilt-332355a9f4a4199e0ddb51852546d44ec54e176f.zip
Merge branch 'model-lights'
Diffstat (limited to 'gfx/gl/shaders/pointLight.vs')
-rw-r--r--gfx/gl/shaders/pointLight.vs22
1 files changed, 14 insertions, 8 deletions
diff --git a/gfx/gl/shaders/pointLight.vs b/gfx/gl/shaders/pointLight.vs
index 00a34a3..c538207 100644
--- a/gfx/gl/shaders/pointLight.vs
+++ b/gfx/gl/shaders/pointLight.vs
@@ -1,18 +1,24 @@
#version 330 core
-layout(location = 0) in vec3 position;
+layout(location = 0) in vec3 v_position;
+layout(location = 1) in vec3 v_colour;
+layout(location = 2) in float v_kq;
+layout(location = 3) in mat4 model;
+layout(location = 7) in ivec3 modelPos;
-uniform vec3 colour;
-uniform float kq;
uniform ivec3 viewPoint;
-out vec3 centre;
-out float size;
+flat out vec3 position;
+flat out vec3 colour;
+flat out float size;
+flat out float kq;
void
main()
{
- centre = position;
- size = (8000 * sqrt(max(max(colour.r, colour.g), colour.b))) / sqrt(kq);
- gl_Position = vec4(centre - viewPoint, 0);
+ position = modelPos + ivec3(mat3(model) * v_position);
+ kq = v_kq;
+ size = (8000 * sqrt(max(max(v_colour.r, v_colour.g), v_colour.b))) / sqrt(v_kq);
+ colour = v_colour;
+ gl_Position = vec4(position - viewPoint, 0);
}