Support Forum       G3D Web Page     
Public Member Functions | List of all members
glsl::octahedral_glsl Class Reference


Efficient GPU implementation of the octahedral unit vector encoding from More...

Public Member Functions

vec3 octDecode (vec2 o)
 Returns a unit vector. More...
 
vec2 octEncode (in vec3 v)
 Assumes that v is a unit vector. More...
 

Detailed Description


Efficient GPU implementation of the octahedral unit vector encoding from

Referenced Code: Cigolle, Donow, Evangelakos, Mara, McGuire, Meyer,
Referenced Code: A Survey of Efficient Representations for Independent Unit Vectors, Journal of Computer Graphics Techniques (JCGT), vol. 3, no. 2, 1-30, 2014
Referenced Code: Available online http://jcgt.org/published/0003/02/01/

Member Function Documentation

◆ octDecode()

vec3 glsl::octahedral_glsl::octDecode ( vec2  o)
inline

Returns a unit vector.

Argument o is an octahedral vector packed via octEncode, on the [-1, +1] square

◆ octEncode()

vec2 glsl::octahedral_glsl::octEncode ( in vec3  v)
inline

Assumes that v is a unit vector.

The result is an octahedral vector on the [-1, +1] square.


documentation generated on Wed Nov 24 2021 08:02:04 using doxygen 1.8.15