summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
diff options
context:
space:
mode:
authorGeenz <geenz@geenzo.com>2013-07-11 19:46:20 -0400
committerGeenz <geenz@geenzo.com>2013-07-11 19:46:20 -0400
commit3a8ad62d9b13335b29bcc5a1419ac8712bc3626b (patch)
tree720c2a3e14e792d569b4b208d90d4177c92ab006 /indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
parentd68f254c66cc2c971cda14c59f8d16e8c44586d6 (diff)
parent6060e5e46acbeb20a301070a0fd0efea029d33d0 (diff)
Merge with latest viewer-release.
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl')
-rwxr-xr-xindra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl12
1 files changed, 7 insertions, 5 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
index 7fc46b814c..9bdee15541 100755
--- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
@@ -179,9 +179,9 @@ void main()
vec3 pos = getPosition(frag.xy).xyz;
vec3 lv = trans_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;
}
@@ -213,8 +213,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;