SeskaPeel

10-06-2003, 07:38 AM

about the reflection vector, computed in the fragment program. Reading various sources on computing this vector, two questions arise :

1/ To compute it, one need an incoming light vector (or rather a vector that starts at the vertex/fragment and points to the camera), and a normal. Lengyel explains in his book that both vectors have to be normalized. As I don't need a normalized reflection vector (for cube map), isn't there a way to have non normalized input vectors ? At least the vector vertex -> camera could be left unnormalized, and I will get a reflection vector of the same norm, right ? Is it extendable with an unnormalized normal ?

2/ Lengyel states in his book how to compute the reflection vector in range [0, PI/2]. How can you get a correct reflection vector for a range that goes from 0 to PI ? I want this because when the surface is bumped map, maximum angle can go up to PI ...

Thanks,

SeskaPeel.

1/ To compute it, one need an incoming light vector (or rather a vector that starts at the vertex/fragment and points to the camera), and a normal. Lengyel explains in his book that both vectors have to be normalized. As I don't need a normalized reflection vector (for cube map), isn't there a way to have non normalized input vectors ? At least the vector vertex -> camera could be left unnormalized, and I will get a reflection vector of the same norm, right ? Is it extendable with an unnormalized normal ?

2/ Lengyel states in his book how to compute the reflection vector in range [0, PI/2]. How can you get a correct reflection vector for a range that goes from 0 to PI ? I want this because when the surface is bumped map, maximum angle can go up to PI ...

Thanks,

SeskaPeel.