diff options
author | Ptolemy <ptolemy@lindenlab.com> | 2022-07-27 10:21:34 -0700 |
---|---|---|
committer | Ptolemy <ptolemy@lindenlab.com> | 2022-08-02 09:44:45 -0700 |
commit | c7d61c417b0e7c9b7f56e29b82476dfe85c39b91 (patch) | |
tree | e8fe05d8659a391b8284dbdd308a89dafbe62c3e /indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl | |
parent | 9e036a17fa9d1fb3061eccf21e8f8ec4b24d3200 (diff) |
SL-17762: Cleanup dist_atten
Diffstat (limited to 'indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl')
-rw-r--r-- | indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl index f8655ccf3b..09a8dbd4f1 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl @@ -135,14 +135,7 @@ void main() vec3 n; vec4 norm = getNormalEnvIntensityFlags(tc, n, envIntensity); - float fa = falloff+1.0; - 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; - } + float dist_atten = 1.0 - (dist + falloff)/(1.0 + falloff); lv = proj_origin-pos.xyz; vec3 h, l, v = -normalize(pos); @@ -169,6 +162,13 @@ void main() } else { + dist_atten *= dist_atten; + dist_atten *= 2.0; + if (dist_atten <= 0.0) + { + discard; + } + float noise = texture2D(noiseMap, tc/128.0).b; if (proj_tc.z > 0.0 && proj_tc.x < 1.0 && |