summaryrefslogtreecommitdiff
path: root/gfx/gl/shaders/pointLight.vs
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/gl/shaders/pointLight.vs')
-rw-r--r--gfx/gl/shaders/pointLight.vs18
1 files changed, 18 insertions, 0 deletions
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);
+}