SphericalHarmonics

Class representing spherical harmonics coefficients to the 3rd degree

Hierarchy

  • SphericalHarmonics

Index

Properties

l00

Find examples in Playground
l00: Vector3

The l0,0 coefficients of the spherical harmonics

l10

Find examples in Playground
l10: Vector3

The l1,0 coefficients of the spherical harmonics

l11

Find examples in Playground
l11: Vector3

The l1,1 coefficients of the spherical harmonics

l1_1

Find examples in Playground
l1_1: Vector3

The l1,-1 coefficients of the spherical harmonics

l20

Find examples in Playground
l20: Vector3

The l2,0 coefficients of the spherical harmonics

l21

Find examples in Playground
l21: Vector3

The l2,1 coefficients of the spherical harmonics

l2_1

Find examples in Playground
l2_1: Vector3

The l2,-1 coefficients of the spherical harmonics

l2_2

Find examples in Playground
l2_2: Vector3

The l2,-2 coefficients of the spherical harmonics

lL22

Find examples in Playground
lL22: Vector3

The l2,2 coefficients of the spherical harmonics

Methods

addLight

Find examples in Playground
  • addLight(direction: Vector3, color: Color3, deltaSolidAngle: number): void
  • Adds a light to the spherical harmonics

    Parameters

    • direction: Vector3

      the direction of the light

    • color: Color3

      the color of the light

    • deltaSolidAngle: number

      the delta solid angle of the light

    Returns void

convertIncidentRadianceToIrradiance

Find examples in Playground
  • convertIncidentRadianceToIrradiance(): void
  • 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.

    Returns void

convertIrradianceToLambertianRadiance

Find examples in Playground
  • convertIrradianceToLambertianRadiance(): void
  • 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.

    Returns void

scale

Find examples in Playground
  • scale(scale: number): void
  • Scales the spherical harmonics by the given amount

    Parameters

    • scale: number

      the amount to scale

    Returns void

Static FromArray

Find examples in Playground
  • Constructs a spherical harmonics from an array.

    Parameters

    • data: ArrayLike<ArrayLike<number>>

      defines the 9x3 coefficients (l00, l1-1, l10, l11, l2-2, l2-1, l20, l21, l22)

    Returns SphericalHarmonics

    the spherical harmonics

Static FromPolynomial

Find examples in Playground

Generated using TypeDoc