From becdf08d0f79a1a676fdc51d5c889dbab5954832 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Wed, 24 Aug 2022 17:21:32 -0700 Subject: SL-17702: PBR: Use legacy attenuation for point lights --- .../app_settings/shaders/class1/deferred/deferredUtil.glsl | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/newview/app_settings/shaders/class1/deferred') diff --git a/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl b/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl index d1b9418ee9..a49713afce 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl @@ -48,6 +48,14 @@ const float ONE_OVER_PI = 0.3183098861; vec3 srgb_to_linear(vec3 cs); +float calcLegacyDistanceAttenuation(float distance, float falloff) +{ + float dist_atten = 1.0 - clamp((distance + falloff)/(1.0 + falloff), 0.0, 1.0); + dist_atten *= dist_atten; + dist_atten *= 2.0; + return dist_atten; +} + // In: // lv unnormalized surface to light vector // n normal of the surface -- cgit v1.2.3