diff options
author | callum_linden <none@none> | 2013-06-28 13:36:41 -0700 |
---|---|---|
committer | callum_linden <none@none> | 2013-06-28 13:36:41 -0700 |
commit | bd41392b7ec1dd90cd0039d87bbbef8beda1796a (patch) | |
tree | aa01ba89c055c5ed427c25227f894fd41b55a220 /indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl | |
parent | 4696eeeb30ce4d01c3bcbe74c9024f05d848968a (diff) | |
parent | b6b4b5913827ca864dac94c72a127f520288ef8e (diff) |
Merge with viewer-bear which was just merged with viewer-release
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl')
-rwxr-xr-x | indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl | 12 |
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; |