Vixen
02b45cc4
csharp
public static class GrassScatter

Scattering one cell of one grass type — the CPU reference the compute pass mirrors.

Read the guide page for this →

Remarks

[docs/plan/31 § D8], and it is the half a test can run. A cell entering range is scattered over a fixed grid of candidates; each one hashes its cell and its slot, jitters itself off the grid, asks the surface what is underneath, and survives if the ground is gentle enough and the layer is painted enough. Nothing about the result is written anywhere: a cell leaving range drops its blades and re-scatters to the identical ones when it comes back.

⚠ Deterministic from the cell coordinate and the slot, never from an iteration order. That is what makes a cell re-entering range produce the grass it had, what makes two machines agree, and what makes this comparable to the dispatch at all — the seam test [§ Part 4] asks for is impossible against a counter. Hash is the whole of that contract and GrassScatter.rvn contains it transliterated.

⚠ The grid is fixed and the weight thins it. The device runs one invocation per slot, so the candidate count cannot depend on anything sampled; what the painted weight decides is what fraction of the candidates survive. See DensityAt.

⚠ No spacing check, and its absence is the difference from FoliageScatter. A minimum spacing is a query against what is already placed, which makes a candidate's fate depend on the order the others were tested in — and an order is what a dispatch of sixty-five thousand parallel invocations does not have. The grid is the spacing: a candidate cannot leave its own slot.

Fields and properties (7)

  • public const uint CellSeedX

    What a cell's X coordinate is mixed by.

  • public const uint CellSeedZ

    And its Z coordinate.

  • public const int JitterXStream

    The stream a candidate's jitter along X is drawn from.

  • public const int JitterZStream

    And along Z.

  • public const int DensityStream

    The stream the density test draws its verdict from.

  • public const int TintStream

    The stream a blade's tint comes from.

  • public const int PhaseStream

    And its wind phase.

Methods (4)

Used by (5)

  • GrassDispatchTestsVixen.Rendering.Terrain.Tests
  • GrassRendererVixen.Rendering.Terrain
  • GrassScatterParityTestsVixen.Rendering.Terrain.Tests
  • GrassScatterTestsVixen.Foliage.Tests
  • TerrainSurfaceTestsVixen.Rendering.Terrain.Tests