diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-08-23 01:28:04 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-08-23 01:28:04 +0200 |
commit | e9f5c273128e553a6ebc9d15f3a9a820faf2bbb4 (patch) | |
tree | 6dd46771bd34fe9a5d7762281ededc7bd358d329 /shaders/lightmap.vert | |
parent | 0fbb841c2dd5c76de867f47a9cf6d1d0fc83d9ee (diff) |
wip
Diffstat (limited to 'shaders/lightmap.vert')
-rw-r--r-- | shaders/lightmap.vert | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/shaders/lightmap.vert b/shaders/lightmap.vert index 479add5c..900038c4 100644 --- a/shaders/lightmap.vert +++ b/shaders/lightmap.vert @@ -9,21 +9,22 @@ layout (location = 5) uniform float intensity; layout (location = 6) uniform uint mode; layout (location = 7) uniform uint falloff; -layout (location = 0) flat out vec3 frag_color; -layout (location = 1) flat out float frag_intensity; +//layout (location = 0) out vec2 frag_texcoords; +//layout (location = 1) flat out vec2 frag_light_coord; -layout (location = 0) in vec2 position; +layout (location = 0) in vec3 position; void main() { vec2 pos = position.xy; - vec2 dir = pos - center_clip; - float len = length(dir); - if (len > 1e-6) + if (mode == 0) { - vec2 dir_norm = dir * (1/len); - pos += dir_norm * position.z * 4; + 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; + } } gl_Position = vec4(pos, 0, 1); - frag_intensity = color_intensity.a; - frag_falloff = uint(position_falloff.w); } |