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.frag | |
| parent | 0fbb841c2dd5c76de867f47a9cf6d1d0fc83d9ee (diff) | |
wip
Diffstat (limited to 'shaders/lightmap.frag')
| -rw-r--r-- | shaders/lightmap.frag | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/shaders/lightmap.frag b/shaders/lightmap.frag index 5e380596..8865e48e 100644 --- a/shaders/lightmap.frag +++ b/shaders/lightmap.frag @@ -14,19 +14,15 @@ out vec4 color; //layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord; void main() { - if (mode == 0) - { - color = vec4(0, 0, 0, 1); - } - else if (mode == 1) // draw + if (mode == 1) { float L = intensity; vec2 pos = gl_FragCoord.xy; float dist = distance(pos, center_fragcoord); float A = 1; - if (frag_falloff == 0) // linear + if (falloff == 0) // linear A = max(0, (L - dist) / L); - else if (frag_falloff == 2) // quadratic + else if (falloff == 2) // quadratic { float tmp = max(0, L - dist); A = tmp*tmp / (L*L); |
