From eb2094a1641c333a6e6f953e3b37aa962937cd59 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 13 Jan 2024 10:05:44 +0000 Subject: Update point light shaders for instancing --- gfx/gl/shaders/pointLight.gs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'gfx/gl/shaders/pointLight.gs') 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(); } -- cgit v1.2.3