Skip to content
Snippets Groups Projects
Commit 280a9d98 authored by David Parks's avatar David Parks
Browse files

MATBUG-78 Fix for alpha lighting falloff not matching opaque lighting falloff (again).

parent 8817ecc1
No related branches found
No related tags found
No related merge requests found
...@@ -101,7 +101,7 @@ vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float ...@@ -101,7 +101,7 @@ vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float
float dist = d/la; float dist = d/la;
da = clamp(1.0-(dist-1.0*(1.0-fa))/fa, 0.0, 1.0); da = clamp(1.0-(dist-1.0*(1.0-fa))/fa, 0.0, 1.0);
da *= da; da *= da;
da *= 1.4; da *= 2.0;
// spotlight coefficient. // spotlight coefficient.
......
...@@ -142,7 +142,7 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spe ...@@ -142,7 +142,7 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spe
float dist = d/la; float dist = d/la;
float dist_atten = clamp(1.0-(dist-1.0*(1.0-fa))/fa, 0.0, 1.0); float dist_atten = clamp(1.0-(dist-1.0*(1.0-fa))/fa, 0.0, 1.0);
dist_atten *= dist_atten; dist_atten *= dist_atten;
dist_atten *= 1.4; dist_atten *= 2.0;
// spotlight coefficient. // spotlight coefficient.
float spot = max(dot(-ln, lv), is_pointlight); float spot = max(dot(-ln, lv), is_pointlight);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment