From a54e8206faeb7c689bae0e3731ca90a58d3e298c Mon Sep 17 00:00:00 2001 From: Geenz Date: Thu, 19 May 2016 20:10:49 -0400 Subject: [PATCH] Switch back to using the light's radius + spacing --- libraries/model/src/model/Light.slh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/model/src/model/Light.slh b/libraries/model/src/model/Light.slh index 51c78b9a4d..6211505090 100644 --- a/libraries/model/src/model/Light.slh +++ b/libraries/model/src/model/Light.slh @@ -99,12 +99,14 @@ float getLightShowContour(Light l) { } float evalLightAttenuation(Light l, float d, vec3 ulightvec) { - float radius = getLightSquareRadius(l); + float radius = getLightRadius(l); float denom = d / radius + 1.0; float attenuation = 1.0 / (denom * denom); + // "Fade" the edges of light sources to make things look a bit more attractive. // Note: this tends to look a bit odd at lower exponents. attenuation *= clamp(0, 1, mix(0, 1, getLightCutoffSquareRadius(l) - dot(ulightvec, ulightvec))); + return attenuation; }