Vixen
02b45cc4
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 (5)

  • 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.

Used by (2)

  • VirtualShadowAtlasVixen.Rendering
  • VirtualShadowRendererVixen.Rendering