summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2013-06-28 11:44:10 -0400
committerOz Linden <oz@lindenlab.com>2013-06-28 11:44:10 -0400
commit290882cda8abfa72ee2f25288b3748d4adecc7dc (patch)
tree94e94bce483ada5ac4f1782301fd5b5720d95e80 /indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
parent2ca2b28dfdca94200d93dfa47952953481d20989 (diff)
parent6060e5e46acbeb20a301070a0fd0efea029d33d0 (diff)
merge changes for 3.6.1-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 bdb713d682..fc0e6b2388 100755
--- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
@@ -178,9 +178,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;
}
@@ -212,8 +212,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;