diff options
author | Howard Stearns <howard.stearns@gmail.com> | 2022-09-01 13:38:59 -0700 |
---|---|---|
committer | Howard Stearns <howard.stearns@gmail.com> | 2022-09-01 13:38:59 -0700 |
commit | 3cf349c4fa1c1879babab23536baff8e4e5421fc (patch) | |
tree | 61e6af4eb66a3ed754f14743bd08ece4dcdf6a30 /indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl | |
parent | 01d03edd8512580575da515401a42021577c3c57 (diff) | |
parent | d2d257cfa99b685160e16ed93c163018e9fe3c50 (diff) |
Merge branch 'DRTVWR-559' of bitbucket.org:lindenlab/viewer into SL-17967
Diffstat (limited to 'indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl')
-rw-r--r-- | indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl index 769589eff1..8cdf9e49b4 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl @@ -85,6 +85,7 @@ uniform mat4 inv_proj; vec3 BRDFLambertian( vec3 reflect0, vec3 reflect90, vec3 c_diff, float specWeight, float vh ); vec3 BRDFSpecularGGX( vec3 reflect0, vec3 reflect90, float alphaRoughness, float specWeight, float vh, float nl, float nv, float nh ); void calcHalfVectors(vec3 lv, vec3 n, vec3 v, out vec3 h, out vec3 l, out float nh, out float nl, out float nv, out float vh, out float lightDist); +float calcLegacyDistanceAttenuation(float distance, float falloff); bool clipProjectedLightVars(vec3 center, vec3 pos, out float dist, out float l_dist, out vec3 lv, out vec4 proj_tc ); vec3 getLightIntensitySpot(vec3 lightColor, float lightRange, float lightDistance, vec3 v); vec4 getNormalEnvIntensityFlags(vec2 screenpos, out vec3 n, out float envIntensity); @@ -129,9 +130,7 @@ void main() vec3 n; vec4 norm = getNormalEnvIntensityFlags(tc, n, envIntensity); // need `norm.w` for GET_GBUFFER_FLAG() - float dist_atten = 1.0 - (dist + falloff)/(1.0 + falloff); - dist_atten *= dist_atten; - dist_atten *= 2.0; + float dist_atten = calcLegacyDistanceAttenuation(dist, falloff); if (dist_atten <= 0.0) { discard; |