public static class SphericalHarmonicsProjects an environment into spherical harmonics, and evaluates what it does to a surface.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
The diffuse half of the split-sum approximation, done where it belongs: on the CPU, once, over an environment that is not going to change. What reaches a frame is nine float3s.
Evaluate mirrors Ibl.IrradianceSh9 and must keep doing so. It is here because a probe has to be checkable without a GPU — the analytic expectations below are what say the projection is right at all — and a second implementation of anything is a thing that drifts, so it is written from the same five constants in the same order.
Methods (3)
public static ShCoefficients Project(CubeImage environment)Projects a cube map's radiance into nine coefficients per channel.
public static void Accumulate(ref ShCoefficients coefficients, Vector3 direction, Vector3 weighted)Adds one direction's radiance to a projection.
public static Vector3 Evaluate(in ShCoefficients coefficients, Vector3 normal)The irradiance arriving at a surface facing .
Used by (2)
- ArenaFrameThirdPersonShooter
- EnvironmentLightingTestsVixen.Rendering.Tests