PDA

View Full Version : different attenuation on 3 axis



Undertaker
04-16-2005, 11:49 PM
Attenuation doesn`t work if brightness is different on one of the 3 axis.

I use
texCoords=lightVector/(brightness*2)+0.5f;

where lightVector is the tangent space vector of the light.
brightness is a 3 float vector.
Now if x isn`t equal to y and z then the attenuation is not correct, what is wrong ?
Or how can I do variable attenuation on 3 axis ?

PS: this works if i don`t put the light vector in tangent space ( and yes, tangent space IS calculated correct )

Overmind
04-17-2005, 01:09 AM
You either have to convert your attenuation to tangent space, too, or you have to use the world space light vector for attenuation calculation...

Undertaker
04-18-2005, 10:52 AM
If I use the world space light vec for attenuation then the bump mapping doesn`t work right, and if I put the attenuation in tangent space it doesn`t work again , or maybe i`m not doing it right

Undertaker
04-18-2005, 12:54 PM
nevermind, i got it working, thanx