public sealed class FoliageStreamerWhich cells of a foliage volume a frame uploads.
Remarks
⚠ The window is derived from the volume rather than declared, because a foliage grid has no edges. FoliageCellGrid indexes cells with signed integers and a forest is wherever somebody painted one; StreamingGrid is a rectangle of cells with an origin. So the rectangle is the bounding box of the chunks that exist, recomputed by Rebuild whenever the volume grows past it.
⚠ A cell outside the window is uploaded rather than skipped. That is the safe direction: the window is stale only when somebody has just painted beyond it, and a tree that appears and then is culled normally is a frame of extra work — where the other choice is a tree an artist just placed and cannot see.
Fields and properties (5)
public const int PageSourceWhat page source a volume's cells are filed under.
public int CellsHow many cells may be uploaded at once.
public PageResidency ResidencyThe residency service, for its counters.
public StreamingGrid GridThe grid the cells are decided on, for its lead.
public bool ChangedWhether the resident set moved since it was last accepted.
Methods (6)
public FoliageStreamer(FoliageVolume volume, int cells = 512)Streams a volume's cells around whatever moves through it.
public void Accept()Says the resident set has been acted on, so Changed is false again.
public bool IsResident(FoliageCellKey cell)Whether a cell's instances should be uploaded.
public void Rebuild(FoliageVolume volume)Rebuilds the window from a volume whose extent has changed.
public int Update(ReadOnlySpan<StreamingSource> sources, int maxLoads = 64)Tells the pool what this frame's sources want, and services what it can.
public void Dispose()Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Used by (2)
- FoliageCullPassVixen.Rendering.Terrain
- FoliageStreamingTestsVixen.Rendering.Terrain.Tests