diff options
Diffstat (limited to 'gfx/gl/shaders/pointLight.vs')
-rw-r--r-- | gfx/gl/shaders/pointLight.vs | 22 |
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); } |