Vixen
02b45cc4
csharp
public struct ShCoefficients

An order-2 spherical-harmonic projection: nine coefficients per channel.

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

Remarks

The field names are the shader's — Raven/Library/Shading/Ibl.rvn declares ShCoefficients with exactly these nine, in this order — because the two are one layout with a GPU in the middle. A field renamed on one side and not the other puts the z lobe where the y lobe should be, which tilts the ambient light off axis and looks like a bad probe rather than a mismatched struct.

Nine numbers is enough for diffuse and nowhere near enough for specular, which is the whole division of labour in image-based lighting: irradiance is so smooth that order-2 reproduces it to within a percent, and reflections are not, so they stay a cubemap.

Fields and properties (9)

  • public Vector3 L00

    The constant term — the environment's average radiance, scaled.

  • public Vector3 L1m1

    The linear term along Y.

  • public Vector3 L10

    The linear term along Z.

  • public Vector3 L11

    The linear term along X.

  • public Vector3 L2m2

    The quadratic XY term.

  • public Vector3 L2m1

    The quadratic YZ term.

  • public Vector3 L20

    The quadratic term along Z.

  • public Vector3 L21

    The quadratic XZ term.

  • public Vector3 L22

    The quadratic X²−Y² term.

Methods (3)

Used by (8)

  • ArenaThirdPersonShooter
  • ArenaFrameThirdPersonShooter
  • EnvironmentLightVixen.Rendering
  • EnvironmentLightingTestsVixen.Rendering.Tests
  • LightProbeVixen.Rendering
  • LightProbeTestsVixen.Rendering.Tests
  • LightProbeVolumeVixen.Rendering
  • SphericalHarmonicsVixen.Rendering