Documentation / base / SH
Class: SH
Defined in: libs/base/src/math/sh.ts:8
Spherical harmonics utilities
Constructors
Constructor
new SH():
SH
Returns
SH
Properties
MIN_ORDER
readonlystaticMIN_ORDER:2=2
Defined in: libs/base/src/math/sh.ts:10
Minimum supported harmonics order
MAX_ORDER
readonlystaticMAX_ORDER:3=3
Defined in: libs/base/src/math/sh.ts:12
Maximum supported harmonics order
Methods
evalBasis()
staticevalBasis(direction,order):number[]
Defined in: libs/base/src/math/sh.ts:21
Evaluate SH basis for specific order
Parameters
direction
Direction to evaluate, must be normalized
order
number
SH order
Returns
number[]
The SH basis evaluate at given direction
evalDirectionLight()
staticevalDirectionLight(direction,color,order):Vector3[]
Defined in: libs/base/src/math/sh.ts:62
Evaluates a directional light and returns spectral SH data
Parameters
direction
Direction of the light
color
Light color
order
number
SH order
Returns
Vector3[]
Evaluated SH data