Taos API Reference
    Preparing search index...

    Function projectSphericalHarmonics

    • Projects an environment onto order-3 SH on the CPU using a deterministic Fibonacci-sphere sample set (uniform over the sphere, solid-angle weight 4π/N per sample). This is the reference/offline projector; the engine bakes the same integral on the GPU.

      Parameters

      • radiance: (x: number, y: number, z: number) => ShColor

        returns the environment radiance (linear RGB) for a unit direction (x, y, z).

      • numSamples: number = 16384

        number of sphere samples (more = lower variance).

      • windowWidth: number = 0

        Hann window width applied per band to suppress low-order ringing (see shBandWindow); 0 (default) leaves the coefficients un-windowed. Must match the GPU bake's window parameter.

      Returns Float32Array

      27 floats: 9 coefficients × RGB, the raw projection L_lm. Pass to evalShIrradiance or packShForGpu.