Represents a third-order spherical harmonics (SH). Light probes use this class to encode lighting information.
Creates a new instance of SphericalHarmonics3.
An array holding the (9) SH coefficients. A single coefficient is represented as an instance of Vector3.
Read-only flag to check if a given object is of type SphericalHarmonics3.
sh — the SH to add.
Adds the given SH to this instance.
A convenience method for performing .add() and .scale() at once.
Returns a new instance of SphericalHarmonics3 with equal coefficients.
sh — the SH to copy.
Copies the given SH to this instance.
sh — the SH to compare with.
Returns true if the given SH and this instance have equal coefficients.
Sets the coefficients of this instance from the given array.
Returns the radiance in the direction of the given normal.
Returns the irradiance (radiance convolved with cosine lobe) in the direction of the given normal.
Linear interpolates between the given SH and this instance by the given alpha factor.
scale — the scale factor.
Scales this SH by the given scale factor.
coefficients — an array of SH coefficients.
Sets the given SH coefficients to this instance.
Returns an array with the coefficients, or copies them into the provided array. The coefficients are represented as numbers.
Sets all SH coefficients to 0.
Computes the SH basis for the given normal vector.
For more info on how to obtain the source code of this module see this page.