summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred
diff options
context:
space:
mode:
authorPtolemy <ptolemy@lindenlab.com>2022-08-24 17:21:32 -0700
committerPtolemy <ptolemy@lindenlab.com>2022-08-24 17:21:32 -0700
commitbecdf08d0f79a1a676fdc51d5c889dbab5954832 (patch)
treee0c14fb1b59cd1e23fa2a81c31030f8518944eab /indra/newview/app_settings/shaders/class1/deferred
parent5b7d8b61e0720aee1ef6c7d6e44ada87ca556d54 (diff)
SL-17702: PBR: Use legacy attenuation for point lights
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl8
1 files changed, 8 insertions, 0 deletions
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