diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-08-23 03:51:59 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-08-23 03:51:59 +0200 |
commit | 8e4781b3103f68965b2aba4e914f7c3281ccbc59 (patch) | |
tree | fe140971aa60c4a7d018c3c3f5cd7a9e9dbebf24 /shaders/lightmap.vert | |
parent | e659a6f6edc857fa424b1aafe319f1a9be74a840 (diff) |
ok so shadows aren't very slow anymore
Diffstat (limited to 'shaders/lightmap.vert')
-rw-r--r-- | shaders/lightmap.vert | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/shaders/lightmap.vert b/shaders/lightmap.vert index 900038c4..1f49404f 100644 --- a/shaders/lightmap.vert +++ b/shaders/lightmap.vert @@ -16,15 +16,12 @@ layout (location = 0) in vec3 position; void main() { vec2 pos = position.xy; - if (mode == 0) + vec2 dir = pos - center_clip; + float len = length(dir); + if (len > 1e-6) { - vec2 dir = pos - center_clip; - float len = length(dir); - if (len > 1e-6) - { - vec2 dir_norm = dir * (1/len); - pos += dir_norm * position.z * 4; - } + vec2 dir_norm = dir * (1/len); + pos += dir_norm * position.z * 4; } gl_Position = vec4(pos, 0, 1); } |