public sealed class LightProbeVolumeA set of light probes and the tetrahedral mesh that interpolates between them.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
The pragmatic answer to indirect diffuse light on moving objects: bake the environment at a few dozen places in a level, and give a position somewhere between them a blend of the four probes that surround it. Spherical harmonics make the blend free — a weighted sum of projections is the projection of the weighted sum — so the entire cost is deciding which four, and that is a Delaunay tetrahedralisation.
Delaunay specifically, rather than any tetrahedral mesh over the same points. The empty-circumsphere property is what makes the four probes a position blends between its natural neighbours; a mesh that grouped them any other way would light an object differently depending on which arbitrary seam it was standing on.
Outside the mesh, the nearest probe. Outside means outside the convex hull of the probes an author placed, which is a statement about the authoring rather than about the position — and extrapolating a spherical-harmonic fit past the data it was fitted to produces negative irradiance, which is a surface that removes light from the frame. Falling back to the nearest probe is flat rather than smooth, and flat is the honest answer at the edge of what was baked.
Probes whose positions coincide are merged, first one winning, because two probes in the same place have no interpolation between them to describe. Probes that are all on one plane — a single-height grid over a floor, which is a reasonable thing to author — have no tetrahedralisation at all; IsTetrahedral is false and every sample is the nearest probe.
Fields and properties (3)
public ReadOnlySpan<Vector3> PositionsThe distinct probe positions, in the order the tetrahedral mesh indexes them.
public DelaunayTetrahedralization MeshThe tetrahedral mesh the interpolation walks.
public bool IsTetrahedralWhether the probes enclose a volume, and so whether sampling interpolates at all.
Methods (4)
public static LightProbeVolume Build(IReadOnlyList<LightProbe> probes)Builds the volume over .
public ShCoefficients Sample(Vector3 position)The indirect light at a position.
public ShCoefficients Sample(Vector3 position, ref int cell)Sample, reusing and updating a cell hint across calls.
public int NearestProbe(Vector3 position)The probe closest to a position, or -1 when there are none.
Used by (1)
- LightProbeTestsVixen.Rendering.Tests