Skip to main content

Module sh

Module sh 

Source

Structs§

SH2
2nd order spherical harmonics (L=0,1,2 => 9 coefficients).
SH3
3rd order spherical harmonics (L=0,1,2,3 => 16 coefficients).
SHProbe
SH irradiance probe.

Functions§

cosine_lobe_sh
SH representation of a clamped cosine lobe (for diffuse transfer).
legendre_p
Associated Legendre polynomial P_l^m(x).
sh_add
Add two SH2.
sh_basis_2
Evaluate 2nd order SH basis at a direction. Returns 9 values.
sh_basis_3
Evaluate 3rd order SH basis at a direction. Returns 16 values.
sh_convolve
Convolve SH with a zonal harmonic kernel.
sh_dot
Inner product of two SH2.
sh_evaluate
Evaluate SH at a direction given coefficients.
sh_project_function
Project a function into 2nd order SH via Monte Carlo sampling.
sh_rotate
Rotate SH by a rotation matrix. Uses the ZYZ Euler angle decomposition.
sh_scale
Scale SH2.
sh_to_color_9
Evaluate 3-channel irradiance from 3 sets of SH2 coefficients.