summaryrefslogtreecommitdiff
path: root/gfx/gl/shaders/pointLight.gs
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-01-13 10:05:44 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-01-13 10:05:44 +0000
commiteb2094a1641c333a6e6f953e3b37aa962937cd59 (patch)
tree01908d3a3d5bf28a96784bbb2e931e46a53a5090 /gfx/gl/shaders/pointLight.gs
parentAdd model support for point lights (diff)
downloadilt-eb2094a1641c333a6e6f953e3b37aa962937cd59.tar.bz2
ilt-eb2094a1641c333a6e6f953e3b37aa962937cd59.tar.xz
ilt-eb2094a1641c333a6e6f953e3b37aa962937cd59.zip
Update point light shaders for instancing
Diffstat (limited to 'gfx/gl/shaders/pointLight.gs')
-rw-r--r--gfx/gl/shaders/pointLight.gs15
1 files changed, 10 insertions, 5 deletions
diff --git a/gfx/gl/shaders/pointLight.gs b/gfx/gl/shaders/pointLight.gs
index 9c41ed4..fc1d7c3 100644
--- a/gfx/gl/shaders/pointLight.gs
+++ b/gfx/gl/shaders/pointLight.gs
@@ -20,19 +20,24 @@ const vec3[] cube = vec3[]( // http://www.cs.umd.edu/gvil/papers/av_ts.pdf
);
uniform mat4 viewProjection;
uniform ivec3 viewPoint;
-
-in vec3 centre[];
-in float size[];
+flat in vec3 position[];
+flat in vec3 colour[];
+flat in float size[];
+flat in float kq[];
layout(points) in;
layout(triangle_strip, max_vertices = cube.length()) out;
-out vec4 geo_centre;
+flat out vec4 geo_centre;
+flat out vec3 geo_colour;
+flat out float geo_kq;
void
doVertex(int idx)
{
gl_Position = viewProjection * (gl_in[0].gl_Position + vec4(cube[idx] * size[0], 1));
- geo_centre = vec4(centre[0], size[0]);
+ geo_centre = vec4(position[0], size[0]);
+ geo_colour = colour[0];
+ geo_kq = kq[0];
EmitVertex();
}