summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2019-02-06 18:08:48 +0000
committerRider Linden <rider@lindenlab.com>2019-02-06 18:08:48 +0000
commit95e9b9d2d284c50b1f31b86d012b22a06ebd5e34 (patch)
tree4db7c44716c62b129df7a25983766530c1e8d406 /indra
parentdfc80120ccb01a011eba1c686e7803bd7d88398d (diff)
parentf8171a909cb2a18fcca47f6a0317919ece802aef (diff)
Merged in graham_linden/viewer-eep-fixes (pull request #269)
SL-10461
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl8
1 files changed, 4 insertions, 4 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index 772859576f..9883ece648 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -86,9 +86,7 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 diffuse, vec3 v, vec3 n, vec
//get distance
float d = length(lv);
-
float da = 1.0;
-
vec3 col = vec3(0);
if (d > 0.0 && fa > 0.0)
@@ -100,7 +98,7 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 diffuse, vec3 v, vec3 n, vec
da = max(0.0, dot(norm, lv));
//distance attenuation
- float dist = d;
+ float dist = d/la;
float dist_atten = clamp(1.0-(dist-1.0*(1.0-fa))/fa, 0.0, 1.0);
dist_atten *= dist_atten;
dist_atten *= 2.0;
@@ -109,9 +107,11 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 diffuse, vec3 v, vec3 n, vec
float spot = max(dot(-ln, lv), is_pointlight);
da *= spot*spot; // GL_SPOT_EXPONENT=2
+ // to match spotLight (but not multiSpotLight) *sigh*
float lit = max(da * dist_atten,0.0);
+ col = lit * light_col * diffuse;
- float amb_da = (da*da*0.5 + 0.5) * ambiance;
+ float amb_da = (da*da*0.5 + 0.25) * ambiance;
amb_da *= dist_atten;
amb_da = min(amb_da, 1.0f - lit);