Vixen
dd8b0a81
csharp
public sealed class ClipmapRefresh

A recomposite of a GlobalDistanceField, in pieces somebody else runs.

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

Remarks

The composite is the most expensive thing in the frame and about 97 per cent of it is usually stale. A camera that crossed one cell of a 32³ level keeps all but a slab of it, and the levels are snapped to their own grids precisely so that is true. What that buys is only realisable by a caller that does not have to wait: this is the shape that lets one exist.

One slice per index, and that is the point rather than an implementation detail. The job scheduler's background tier defers work; it cannot interrupt it. A refresh handed over as one item would occupy a worker for the whole composite whatever tier it was in, and the frame behind it would wait exactly as long. SliceCount short items is what makes "later" mean anything — see docs/guide/core/job-priorities.md.

⚠ Nothing a reader of the clipmap can see moves until Publish. The slices write the other half of each level's double buffer, so a frame may upload, sample and name the previous composite for as many frames as the refresh takes. That is the staleness the caller is buying, and it is a whole refresh of it rather than a torn one.

Fields and properties (3)

  • public int SliceCount

    How many pieces this is in — one Z slice of one level each.

  • public long Reused

    How many cells this refresh will keep rather than recompute.

  • public bool IsPublished

    Whether this refresh has been swapped in.

Methods (3)

  • public void Composite(int index)

    Runs one slice.

  • public void Publish()

    Makes this refresh the clipmap, in one step.

  • public void Abandon()

    Throws this refresh away, leaving the clipmap as it was.

Used by (4)

  • CompositeSliceJobVixen.Rendering
  • GlobalDistanceFieldVixen.Rendering.DistanceFields
  • GlobalDistanceFieldRendererVixen.Rendering
  • GlobalDistanceFieldTestsVixen.Rendering.DistanceFields.Tests