[name]

Represents a third-order spherical harmonics (SH). Light probes use this class to encode lighting information.

Constructor

[name]()

Creates a new instance of [name].

Properties

.coefficients : Array

An array holding the (9) SH coefficients. A single coefficient is represented as an instance of [page:Vector3].

.isSphericalHarmonics3 : Boolean

Read-only flag to check if a given object is of type [name].

Methods

.add ( [param:SphericalHarmonics3 sh] ) : this

[page:SphericalHarmonics3 sh] - The SH to add.

Adds the given SH to this instance.

.addScaledSH ( [param:SphericalHarmonics3 sh], [param:Number scale] ) : this

[page:SphericalHarmonics3 sh] - The SH to add.
[page:Number scale] - The scale factor.

A convenience method for performing [page:.add]() and [page:.scale]() at once.

.clone () : SphericalHarmonics3

Returns a new instance of [name] with equal coefficients.

.copy ( [param:SphericalHarmonics3 sh] ) : this

[page:SphericalHarmonics3 sh] - The SH to copy.

Copies the given SH to this instance.

.equals ( [param:SphericalHarmonics3 sh] ) : Boolean

[page:SphericalHarmonics3 sh] - The SH to compare with.

Returns true if the given SH and this instance have equal coefficients.

.fromArray ( [param:Array array], [param:Number offset] ) : this

[page:Array array] - The array holding the numbers of the SH coefficients.
[page:Number offset] - (optional) The array offset.

Sets the coefficients of this instance from the given array.

.getAt ( [param:Vector3 normal], [param:Vector3 target] ) : Vector3

[page:Vector3 normal] - The normal vector (assumed to be unit length).
[page:Vector3 target] - The result vector.

Returns the radiance in the direction of the given normal.

.getIrradianceAt ( [param:Vector3 normal], [param:Vector3 target] ) : Vector3

[page:Vector3 normal] - The normal vector (assumed to be unit length).
[page:Vector3 target] - The result vector.

Returns the irradiance (radiance convolved with cosine lobe) in the direction of the given normal.

.lerp ( [param:SphericalHarmonics3 sh], [param:Number alpha] ) : this

[page:SphericalHarmonics3 sh] - The SH to interpolate with.
[page:Number alpha] - The alpha factor.

Linear interpolates between the given SH and this instance by the given alpha factor.

.scale ( [param:Number scale] ) : this

[page:Number scale] - The scale factor.

Scales this SH by the given scale factor.

.set ( [param:Array coefficients] ) : this

[page:Array coefficients] - An array of SH coefficients.

Sets the given SH coefficients to this instance.

.toArray ( [param:Array array], [param:Number offset] ) : Array

[page:Array array] - (optional) The target array.
[page:Number offset] - (optional) The array offset.

Returns an array with the coefficients, or copies them into the provided array. The coefficients are represented as numbers.

.zero () : this

Sets all SH coefficients to 0.

Static Methods

.getBasisAt ( [param:Vector3 normal], [param:Array shBasis] ) : undefined

[page:Vector3 normal] - The normal vector (assumed to be unit length).
[page:Array shBasis] - The resulting SH basis.

Computes the SH basis for the given normal vector.

Source

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]

SphericalHarmonics3 SphericalHarmonics3 SphericalHarmonics3 SphericalHarmonics3

SphericalHarmonics3 SphericalHarmonics3 SphericalHarmonics3 SphericalHarmonics3