Vixen
02b45cc4
csharp
public static class EnvironmentBaker

Turns an environment into the two things a frame reads: a prefiltered mip chain and nine coefficients.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

The producing half of the split-sum approximation, which the engine had no answer for at all — the shader library has had Ibl.SpecularLod and Ibl.IrradianceSh9 since it was written, and nothing anywhere produced a chain for the first to index or coefficients for the second to evaluate.

On the CPU, and offline. A bake is a per-environment cost, not a per-frame one, and doing it here means it is deterministic, testable against closed forms without a device, and belongs to the asset pipeline where the result can be stored beside the source.

Methods (2)

  • public static float RoughnessOf(int mip, int mipCount)

    The roughness a mip level of the prefiltered chain holds.

  • public static CubeImage[] Prefilter(CubeImage source, int mipCount, int samples = 64)

    Prefilters an environment against the GGX lobe, one mip per roughness.

Used by (2)

  • EnvironmentLightingTestsVixen.Rendering.Tests
  • EnvironmentTextureVixen.Rendering