SirKnight

03-22-2002, 08:42 PM

I have in my program used a tangent space light vector for the z part of my attenuation and used it in the selfshadow term and i have implemented it without really understanding why it works the way it does which is actually unusual for me and i now have decided to ask why. http://www.opengl.org/discussion_boards/ubb/smile.gif Ok here goes (my lighting engine is based from Ron Frazier's paper btw), why would using a tangent space light vector (scaled for brightness in this case) work as the z part of the attenuation (after being squared and then added to the XY radial texture of course)? I just dont see how that can substitute for the z part.

Second question, When doing selfshadow it works nicely to use 8*(N.L) but i noticed in Ron's code he just does this (where tsL is the tangent space light): 8*expand(tsL.z). How does using the z part of the tangent light substitute for N.L? I have looked at all the presentations and everything that talks about tangent space and i just cant figure these two questions of mine out. I understand how to compute tangent space though. That part isnt bad.

Well, i hope you can understand what im asking here, its late and i can hardly keep my eyes open so if something makes no sence i wouldnt be suprised. http://www.opengl.org/discussion_boards/ubb/smile.gif

Thanks.

-SirKnight

Second question, When doing selfshadow it works nicely to use 8*(N.L) but i noticed in Ron's code he just does this (where tsL is the tangent space light): 8*expand(tsL.z). How does using the z part of the tangent light substitute for N.L? I have looked at all the presentations and everything that talks about tangent space and i just cant figure these two questions of mine out. I understand how to compute tangent space though. That part isnt bad.

Well, i hope you can understand what im asking here, its late and i can hardly keep my eyes open so if something makes no sence i wouldnt be suprised. http://www.opengl.org/discussion_boards/ubb/smile.gif

Thanks.

-SirKnight