(L) [2018/02/12] [ost
by josh247] [Basis Construction with Tangent Vector] Wayback!Wanted to post this simple example for constructing an orthonormal basis that takes two vectors, and uses SIMD instructions. There are a couple of great papers ([LINK http://jcgt.org/published/0006/01/01/] and [LINK http://jcgt.org/published/0006/01/02/]) on the subject which came out recently. These however just take a normal vector and do not accept a tangent that can be used for anisotropic distributions.
Couldn't find an implementation that uses SIMD instructions online, so thought this might be helpful for someone. If you run the program it gives a comparison of a standard implementation and the vectorised equivalent.
[LINK https://github.com/joshbainbridge/orthonormal-tangent-basis]