Class SphericalHarmonics
Index
Constructors
constructor
-
Returns SphericalHarmonics
Properties
l00
The l0,0 coefficients of the spherical harmonics
l1_ 1
The l1,-1 coefficients of the spherical harmonics
l10
The l1,0 coefficients of the spherical harmonics
l11
The l1,1 coefficients of the spherical harmonics
l2_ 1
The l2,-1 coefficients of the spherical harmonics
l2_ 2
The l2,-2 coefficients of the spherical harmonics
l20
The l2,0 coefficients of the spherical harmonics
l21
The l2,1 coefficients of the spherical harmonics
l22
The l2,2 coefficients of the spherical harmonics
pre Scaled
Defines whether or not the harmonics have been prescaled for rendering.
Methods
add Light
convert Incident Radiance To Irradiance
-
Convert from incident radiance (Li) to irradiance (E) by applying convolution with the cosine-weighted hemisphere.
E_lm = A_l * L_lmIn spherical harmonics this convolution amounts to scaling factors for each frequency band. This corresponds to equation 5 in "An Efficient Representation for Irradiance Environment Maps", where the scaling factors are given in equation 9.
Returns void
convert Irradiance To Lambertian Radiance
-
Convert from irradiance to outgoing radiance for Lambertian BDRF, suitable for efficient shader evaluation.
L = (1/pi) * E * rhoThis is done by an additional scale by 1/pi, so is a fairly trivial operation but important conceptually.
Returns void
pre Scale For Rendering
-
Integrates the reconstruction coefficients directly in to the SH preventing further required operations at run time.
This is simply done by scaling back the SH with Ylm constants parameter. The trigonometric part being applied by the shader at run time.
Returns void
scale In Place
-
Scales the spherical harmonics by the given amount
Parameters
- scale: number
the amount to scale
Returns void
- scale: number
update From Array
-
update the spherical harmonics coefficients from the given array
Parameters
- data: ArrayLike<ArrayLike<number>>
defines the 9x3 coefficients (l00, l1-1, l10, l11, l2-2, l2-1, l20, l21, l22)
Returns SphericalHarmonics
the spherical harmonics (this)
- data: ArrayLike<ArrayLike<number>>
update From Floats Array
-
update the spherical harmonics coefficients from the given floats array
Parameters
- data: ArrayLike<number>
defines the 9x3 coefficients (l00, l1-1, l10, l11, l2-2, l2-1, l20, l21, l22)
Returns SphericalHarmonics
the spherical harmonics (this)
- data: ArrayLike<number>
StaticFrom Array
-
Constructs a spherical harmonics from an array.
Parameters
- data: ArrayLike<ArrayLike<number>>
defines the 9x3 coefficients (l00, l1-1, l10, l11, l2-2, l2-1, l20, l21, l22)
Returns SphericalHarmonics
the spherical harmonics
- data: ArrayLike<ArrayLike<number>>
StaticFrom Polynomial
-
Gets the spherical harmonics from polynomial
Parameters
- polynomial: SphericalPolynomial
the spherical polynomial
Returns SphericalHarmonics
the spherical harmonics
- polynomial: SphericalPolynomial
Class representing spherical harmonics coefficients to the 3rd degree