diff options
author | Oz Linden <oz@lindenlab.com> | 2013-07-16 11:50:03 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2013-07-16 11:50:03 -0400 |
commit | cf33a9a7b31b19d0f87e11997aaba938a8ee950d (patch) | |
tree | f64996ebb904ec562447be92b2e5273b9261d41c /indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl | |
parent | 1108cd0e5c052176f9dacc69b04d702a06b744de (diff) | |
parent | e12b6caaa0596eae2fad43636663dd4e14a1949c (diff) |
merge changes for storm-1951
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl')
-rwxr-xr-x | indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl | 12 |
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; |