diff options
author | Ptolemy <ptolemy@lindenlab.com> | 2022-08-11 11:21:02 -0700 |
---|---|---|
committer | Ptolemy <ptolemy@lindenlab.com> | 2022-08-11 11:21:02 -0700 |
commit | 9e1692ace915b495047678bd5a8f3acdf22d291a (patch) | |
tree | d7f7786a577f64e20ca23527e796b13c84c2aee5 /indra/newview/app_settings/shaders/class3/deferred | |
parent | 291350e00f40fab1072a78ea92d5ea5aafcf5d32 (diff) |
SL-17763: Make dist_atten consistent between PBR and Legacy
Diffstat (limited to 'indra/newview/app_settings/shaders/class3/deferred')
4 files changed, 16 insertions, 18 deletions
diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl index b27b171122..399948459b 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl @@ -106,6 +106,8 @@ void main() { float dist = lightDist / lightSize; float dist_atten = 1.0 - (dist + falloff)/(1.0 + falloff); + dist_atten *= dist_atten; + dist_atten *= 2.0; vec3 intensity = dist_atten * getLightIntensityPoint(lightColor, lightSize, lightDist); colorDiffuse += intensity * nl * BRDFLambertian (reflect0, reflect90, c_diff , specWeight, vh); colorSpec += intensity * nl * BRDFSpecularGGX(reflect0, reflect90, alphaRough, specWeight, vh, nl, nv, nh); diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl index f28619b11a..fdbeb34116 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl @@ -160,6 +160,12 @@ void main() vec4 norm = getNormalEnvIntensityFlags(tc, n, envIntensity); float dist_atten = 1.0 - (dist + falloff)/(1.0 + falloff); + dist_atten *= dist_atten; + dist_atten *= 2.0; + if (dist_atten <= 0.0) + { + discard; + } lv = proj_origin-pos.xyz; vec3 h, l, v = -normalize(pos); @@ -294,13 +300,6 @@ 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 && diff --git a/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl index b4640187c7..42d7407456 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl @@ -90,6 +90,8 @@ void main() float dist = lightDist / size; float dist_atten = 1.0 - (dist + falloff)/(1.0 + falloff); + dist_atten *= dist_atten; + dist_atten *= 2.0; if (GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_PBR)) { @@ -129,9 +131,6 @@ void main() discard; } - dist_atten *= dist_atten; - dist_atten *= 2.0; - float noise = texture2D(noiseMap, tc/128.0).b; float lit = nl * dist_atten * noise; diff --git a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl index 25622d4f83..d82baf0804 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl @@ -127,6 +127,12 @@ void main() 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; + if (dist_atten <= 0.0) + { + discard; + } lv = proj_origin-pos.xyz; // NOTE: Re-using lv vec3 h, l, v = -normalize(pos); @@ -194,14 +200,6 @@ 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 && |