Fermat
Functions
Spherical Mappings

Detailed Description

Functions

CUGAR_HOST CUGAR_DEVICE Vector3f cugar::from_spherical_coords (const Vector2f &uv)
 
CUGAR_HOST CUGAR_DEVICE Vector2f cugar::to_spherical_coords (const Vector3f &vec)
 
CUGAR_HOST CUGAR_DEVICE Vector2f cugar::square_to_unit_disk (const Vector2f uv)
 
CUGAR_HOST CUGAR_DEVICE Vector2f cugar::unit_disk_to_square (const Vector2f disk)
 
CUGAR_HOST CUGAR_DEVICE Vector3f cugar::square_to_cosine_hemisphere (const Vector2f &uv)
 
CUGAR_HOST CUGAR_DEVICE Vector2f cugar::cosine_hemisphere_to_square (const Vector3f &dir)
 
CUGAR_HOST CUGAR_DEVICE Vector3f cugar::uniform_square_to_sphere (const Vector2f &uv)
 
CUGAR_HOST CUGAR_DEVICE Vector2f cugar::uniform_sphere_to_square (const Vector3f &vec)
 
CUGAR_HOST CUGAR_DEVICE Vector2f cugar::hemisphere_to_hemioct (Vector3f v)
 
CUGAR_HOST CUGAR_DEVICE Vector3f cugar::hemioct_to_hemisphere (Vector2f e)
 
CUGAR_HOST CUGAR_DEVICE Vector2f cugar::sphere_to_oct (Vector3f v)
 
CUGAR_HOST CUGAR_DEVICE Vector3f cugar::oct_to_sphere (Vector2f e)
 

Function Documentation

◆ cosine_hemisphere_to_square()

CUGAR_HOST CUGAR_DEVICE Vector2f cugar::cosine_hemisphere_to_square ( const Vector3f dir)
inline

inverts the square to cosine-weighted hemisphere mapping

Parameters
dir3d direction

◆ from_spherical_coords()

CUGAR_HOST CUGAR_DEVICE Vector3f cugar::from_spherical_coords ( const Vector2f uv)
inline

maps a point in spherical coordinates to the unit sphere

Parameters
uvuv coordinates

◆ hemioct_to_hemisphere()

CUGAR_HOST CUGAR_DEVICE Vector3f cugar::hemioct_to_hemisphere ( Vector2f  e)
inline

maps a 2d vector to a 3d vector on the +Z hemisphere, using the 2d hemioct representation described in "A Survey of Efficient Representations for Independent Unit Vectors" by Cigolle et al.

◆ hemisphere_to_hemioct()

CUGAR_HOST CUGAR_DEVICE Vector2f cugar::hemisphere_to_hemioct ( Vector3f  v)
inline

maps normalized 3d input on +Z hemisphere to the 2d hemioct representation described in "A Survey of Efficient Representations for Independent Unit Vectors" by Cigolle et al. Output is on [-1, 1]^2.

◆ oct_to_sphere()

CUGAR_HOST CUGAR_DEVICE Vector3f cugar::oct_to_sphere ( Vector2f  e)
inline

maps a 2d vector to a 3d vector on the sphere, using the 2d oct representation described in "A Survey of Efficient Representations for Independent Unit Vectors" by Cigolle et al.

◆ sphere_to_oct()

CUGAR_HOST CUGAR_DEVICE Vector2f cugar::sphere_to_oct ( Vector3f  v)
inline

maps normalized 3d input to the 2d oct representation described in "A Survey of Efficient Representations for Independent Unit Vectors" by Cigolle et al. Output is on [-1, 1]^2.

◆ square_to_cosine_hemisphere()

CUGAR_HOST CUGAR_DEVICE Vector3f cugar::square_to_cosine_hemisphere ( const Vector2f uv)
inline

maps the unit square to the hemisphere with a cosine-weighted distribution

Parameters
uvuv coordinates

◆ square_to_unit_disk()

CUGAR_HOST CUGAR_DEVICE Vector2f cugar::square_to_unit_disk ( const Vector2f  uv)
inline

map a point on [0,1]^2 to a uniformly distributed point on a disk of radius 1

Parameters
uvuv coordinates

◆ to_spherical_coords()

CUGAR_HOST CUGAR_DEVICE Vector2f cugar::to_spherical_coords ( const Vector3f vec)
inline

computes the spherical coordinates of a 3d point

Parameters
vec3d direction

◆ uniform_sphere_to_square()

CUGAR_HOST CUGAR_DEVICE Vector2f cugar::uniform_sphere_to_square ( const Vector3f vec)
inline

maps the sphere to a unit square with a uniform distribution

Parameters
dir3d direction

◆ uniform_square_to_sphere()

CUGAR_HOST CUGAR_DEVICE Vector3f cugar::uniform_square_to_sphere ( const Vector2f uv)
inline

maps the unit square to the sphere with a uniform distribution

Parameters
uvuv coordinates

◆ unit_disk_to_square()

CUGAR_HOST CUGAR_DEVICE Vector2f cugar::unit_disk_to_square ( const Vector2f  disk)
inline

diskx, disky is point on radius 1 disk. x, y is point on [0,1]^2

Parameters
diskdisk point