Class representing spherical harmonics coefficients to the 3rd degree
The l0,0 coefficients of the spherical harmonics
The l1,0 coefficients of the spherical harmonics
The l1,1 coefficients of the spherical harmonics
The l1,-1 coefficients of the spherical harmonics
The l2,0 coefficients of the spherical harmonics
The l2,1 coefficients of the spherical harmonics
The l2,2 coefficients of the spherical harmonics
The l2,-1 coefficients of the spherical harmonics
The l2,-2 coefficients of the spherical harmonics
ScaledSearch playground for preScaled
Defines whether or not the harmonics have been prescaled for rendering.
LightSearch playground for addLight
Incident Radiance ToIrradianceSearch playground for convertIncidentRadianceToIrradiance
Convert from incident radiance (Li) to irradiance (E) by applying convolution with the cosine-weighted hemisphere.
E_lm = A_l * L_lm
In 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.
Irradiance ToLambertian RadianceSearch playground for convertIrradianceToLambertianRadiance
Convert from irradiance to outgoing radiance for Lambertian BDRF, suitable for efficient shader evaluation.
L = (1/pi) * E * rho
This is done by an additional scale by 1/pi, so is a fairly trivial operation but important conceptually.
Scale For RenderingSearch playground for preScaleForRendering
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.
InPlaceSearch playground for scaleInPlace
Scales the spherical harmonics by the given amount
the amount to scale
ArraySearch playground for FromArray
Constructs a spherical harmonics from an array.
defines the 9x3 coefficients (l00, l1-1, l10, l11, l2-2, l2-1, l20, l21, l22)
the spherical harmonics