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.
sh — The SH to add.
scale — The scale factor.
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.
array — The array holding the numbers of the SH coefficients.
offset — (optional) The array offset.
Sets the coefficients of this instance from the given array.
normal — The normal vector (assumed to be unit length).
target — The result vector.
Returns the radiance in the direction of the given normal.
normal — The normal vector (assumed to be unit length).
target — The result vector.
Returns the irradiance (radiance convolved with cosine lobe) in the direction of the given normal.
sh — The SH to interpolate with.
alpha — The alpha factor.
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.
array — (optional) The target array.
offset — (optional) The array offset.
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
.
normal — The normal vector (assumed to be unit length).
shBasis — The resulting SH basis.
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.