summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
diff options
context:
space:
mode:
authormaksymsproductengine <maksymsproductengine@lindenlab.com>2013-07-02 20:07:56 +0300
committermaksymsproductengine <maksymsproductengine@lindenlab.com>2013-07-02 20:07:56 +0300
commit7c2f835a506e53b430ce645b0f005a0cc1692d09 (patch)
treec008bc652f6358379cfe571b15b71601435039c2 /indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
parent9da29e2ccc9d51553434ff6975287602420ac08f (diff)
parent6060e5e46acbeb20a301070a0fd0efea029d33d0 (diff)
Pull merge lindenlab/viewer-release
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl')
-rwxr-xr-xindra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl12
1 files changed, 7 insertions, 5 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
index 36fb4afa52..97bf49a605 100755
--- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
@@ -177,9 +177,9 @@ void main()
vec3 pos = getPosition(frag.xy).xyz;
vec3 lv = center.xyz-pos.xyz;
- float dist2 = dot(lv,lv);
- dist2 /= size;
- if (dist2 > 1.0)
+ float dist = length(lv);
+ dist /= size;
+ if (dist > 1.0)
{
discard;
}
@@ -201,8 +201,10 @@ void main()
proj_tc.xyz /= proj_tc.w;
float fa = falloff+1.0;
- float dist_atten = min(1.0-(dist2-1.0*(1.0-fa))/fa, 1.0);
- dist_atten = pow(dist_atten, 2.2) * 2.2;
+ float dist_atten = min(1.0-(dist-1.0*(1.0-fa))/fa, 1.0);
+ dist_atten *= dist_atten;
+ dist_atten *= 2.0;
+
if (dist_atten <= 0.0)
{
discard;