From 75532cda084c34c09b759eb120d00bfcc7d61ea5 Mon Sep 17 00:00:00 2001 From: Geenz Date: Thu, 19 May 2016 20:52:28 -0400 Subject: [PATCH] Document evalLightAttenuation's parameters. --- libraries/model/src/model/Light.slh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/model/src/model/Light.slh b/libraries/model/src/model/Light.slh index 6211505090..46eb352d16 100644 --- a/libraries/model/src/model/Light.slh +++ b/libraries/model/src/model/Light.slh @@ -98,6 +98,9 @@ float getLightShowContour(Light l) { return l._control.w; } +// Light is the light source its self, d is the light's distance, and ulightvec is the unnormalized light vector. +// Note that ulightvec should be calculated as light position - fragment position. +// Additionally, length(light position) != dot(light position, light position). float evalLightAttenuation(Light l, float d, vec3 ulightvec) { float radius = getLightRadius(l); float denom = d / radius + 1.0;