PDA

View Full Version : ppl attenuation on 3 axis



Undertaker
04-16-2005, 08:13 AM
Attenuation doesn`t work if brightness is different on one of the 3 axis.

I use
texCoords.x = lightVector.x/(light->brightness.x * 8) + 0.5f;
texCoords.y = lightVector.y/(light->brightness.y * 2) + 0.5f;
texCoords.z = lightVector.z/(light->brightness.z * 2) + 0.5f;

where lightVector is the tangent space vector of the light ( non tangent light vec = ligh.origin - vertex )

Now if x isn`t equal to y and z the attenuation is not correct, what is wrong ?

dorbie
04-17-2005, 07:32 PM
You don't attenuate light by changing the length of the light vector.

You use attenuation as a factor to modulate either the light illumination or the final dot product.