API

Class SphericalHarmonics

Class representing spherical harmonics coefficients to the 3rd degree

Index
l00: Vector3 = ...

The l0,0 coefficients of the spherical harmonics

l1_1: Vector3 = ...

The l1,-1 coefficients of the spherical harmonics

l10: Vector3 = ...

The l1,0 coefficients of the spherical harmonics

l11: Vector3 = ...

The l1,1 coefficients of the spherical harmonics

l2_1: Vector3 = ...

The l2,-1 coefficients of the spherical harmonics

l2_2: Vector3 = ...

The l2,-2 coefficients of the spherical harmonics

l20: Vector3 = ...

The l2,0 coefficients of the spherical harmonics

l21: Vector3 = ...

The l2,1 coefficients of the spherical harmonics

l22: Vector3 = ...

The l2,2 coefficients of the spherical harmonics

preScaled: boolean = false

Defines whether or not the harmonics have been prescaled for rendering.

  • 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

  • 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

  • Integrates the reconstruction coefficients directly in to the SH preventing further required operations at run time.

    This is simply done by scaling back the SH with Ylm constants parameter. The trigonometric part being applied by the shader at run time.

    Returns void