From 50d6f63fb28c82a35e68914fe941b685d26f6e89 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 23 Nov 2022 19:07:18 +0000 Subject: Add rendering support for point lights --- gfx/gl/shaders/pointLight.vs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 gfx/gl/shaders/pointLight.vs (limited to 'gfx/gl/shaders/pointLight.vs') diff --git a/gfx/gl/shaders/pointLight.vs b/gfx/gl/shaders/pointLight.vs new file mode 100644 index 0000000..6236c33 --- /dev/null +++ b/gfx/gl/shaders/pointLight.vs @@ -0,0 +1,18 @@ +#version 330 core + +layout(location = 0) in vec3 position; + +uniform vec3 colour; +uniform float kq; +uniform mat4 viewProjection; + +out vec3 centre; +out float size; + +void +main() +{ + centre = position; + size = sqrt(256 * max(max(colour.r, colour.g), colour.b) / kq); + gl_Position = viewProjection * vec4(centre, 1); +} -- cgit v1.2.3