diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-03-10 01:33:39 +0000 |
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-03-10 01:33:39 +0000 |
| commit | 61d6b49d5a4c5f58a2922a19a360e078a0aeacba (patch) | |
| tree | c192508c15d880ccb84003f3494aa2e26d36324b /gfx/gl/shaders/spotLight.vert | |
| parent | Specialise glTexture::savePosition (diff) | |
| download | ilt-61d6b49d5a4c5f58a2922a19a360e078a0aeacba.tar.bz2 ilt-61d6b49d5a4c5f58a2922a19a360e078a0aeacba.tar.xz ilt-61d6b49d5a4c5f58a2922a19a360e078a0aeacba.zip | |
Switch to floating point, camera relative position buffer
Diffstat (limited to 'gfx/gl/shaders/spotLight.vert')
| -rw-r--r-- | gfx/gl/shaders/spotLight.vert | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gfx/gl/shaders/spotLight.vert b/gfx/gl/shaders/spotLight.vert index 36d2ee5..83f3859 100644 --- a/gfx/gl/shaders/spotLight.vert +++ b/gfx/gl/shaders/spotLight.vert @@ -20,11 +20,11 @@ flat out float kq; void main() { - position = modelPos + ivec3(mat3(model) * v_position); + position = (modelPos - viewPoint) + ivec3(mat3(model) * v_position); direction = normalize(mat3(model) * v_direction); colour = v_colour; kq = v_kq; size = (8000 * sqrt(max(max(colour.r, colour.g), colour.b))) / sqrt(kq); arc = vec2(cos(v_arc / 2), tan(v_arc / 2)); - gl_Position = vec4(position - viewPoint, 0); + gl_Position = vec4(position, 0); } |
