Vixen
dd8b0a81
csharp
public struct VirtualShadowLevel

One virtual map: a projection, where its pages start, and how coarse its texels are.

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

Remarks

A clipmap level and a spot light are the same record, which is what keeps the page table, the marking pass and the lookup from having two of everything. What differs is how a pixel chooses one — a clipmap level is chosen by comparing texel sizes, a spot's only level is chosen by being inside its frustum — and that is one branch in one function rather than a second address space.

Sixteen-byte rows on both sides, as every record a shader reads is. The matrix is first because it is the only member with an alignment worth arranging around.

Fields and properties (7)

  • public Matrix4x4 ViewProjection

    World to this map's clip space.

  • public uint First

    Where this map's pages start in the global page numbering.

  • public uint Kind

    VirtualShadowKind, as the shader reads it.

  • public float TexelWorldSize

    How many world units one of this map's shadow texels covers. Zero for a spot.

  • public uint Light

    Which light this map belongs to, for a host that wants to attribute a page.

  • public Int2 Origin

    Where this map's page grid sits in the light's own endless page grid.

  • public Int2 Padding

    Eight bytes of tail padding the shader declares and never reads.

Used by (6)

  • ArrangementVixen.Graphics.Golden.Tests
  • VirtualShadowAtlasVixen.Rendering
  • VirtualShadowLookupDeviceTestsVixen.Graphics.Golden.Tests
  • VirtualShadowMapTestsVixen.Rendering.Tests
  • VirtualShadowRendererVixen.Rendering
  • VirtualShadowRendererTestsVixen.Rendering.Tests