SiReflect function

littlelion

Newcomer
Does anybody have the source code for this function. I've got some example code here that uses it, but no function body.

Thx
 
Perhaps this is what you're looking for? The Si prefix stands for "Sushi Include" (Sushi is the name of ATI's demo engine).

Code:
////////////////////////////////////////////////////////////////////////////
// Compute the reflection vector given a view vector and normal.
////////////////////////////////////////////////////////////////////////////
float3 SiReflect (float3 viewVec, float3 normal)
{
   return normalize (2*dot (viewVec, normal)*normal - viewVec);
}

////////////////////////////////////////////////////////////////////////////
// Compute the reflection vector given a view vector, normal, and
// view dot normal
////////////////////////////////////////////////////////////////////////////
float3 SiReflect (float3 viewVec, float3 normal, float nDotV)
{
   return normalize ((2 * nDotV * normal) - viewVec);
}
 
Back
Top