diff options
author | Geenz <geenz@geenzo.com> | 2013-07-11 19:46:20 -0400 |
---|---|---|
committer | Geenz <geenz@geenzo.com> | 2013-07-11 19:46:20 -0400 |
commit | 3a8ad62d9b13335b29bcc5a1419ac8712bc3626b (patch) | |
tree | 720c2a3e14e792d569b4b208d90d4177c92ab006 /indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl | |
parent | d68f254c66cc2c971cda14c59f8d16e8c44586d6 (diff) | |
parent | 6060e5e46acbeb20a301070a0fd0efea029d33d0 (diff) |
Merge with latest viewer-release.
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl')
-rwxr-xr-x | indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl index c634f50577..28432dac9a 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/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; } @@ -202,8 +202,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; @@ -282,10 +284,7 @@ void main() //col += spec.rgb; } } - - - - + if (envIntensity > 0.0) { |