Template Function TRAP::Math::Refract#

Function Documentation#

template<u32 L, typename T>
constexpr Vec<L, T> TRAP::Math::Refract(const Vec<L, T> &I, const Vec<L, T> &N, T eta)#

Calculate the refraction direction for an incident vector.

Parameters:
  • I – Specifies the incident vector.

  • N – Specifies the normal vector.

  • eta – Specifies the ratio of indices of refraction.

Returns:

For the incident vector I and surface normal N, and the ratio of indices of refraction eta, returns the refraction vector.