Vixen
02b45cc4
csharp
public static class FoliageScatter

Turning a brush stamp into instances, and the six rules that refuse one.

Read the guide page for this →

Remarks

[docs/plan/31 § The palette]'s placement rules, in one pass. A candidate is generated, the surface under it is sampled once, and then: is there ground, is the slope in range, is the altitude in range, is the filtered layer painted enough, and is there already an instance within the type's spacing. What survives is turned by the alignment and the random ranges.

⚠ Deterministic from the stamp and the candidate index, never from an iteration order — [§ D8]'s requirement, and it is what makes an undone-and-redone stroke produce the same forest. A counter-based identity would also make the CPU reference and the GPU scatter impossible to compare, which is the seam test the grass phase needs.

⚠ The spacing check is against what is already placed, including this stamp's own earlier candidates. Checking only the volume would let one stamp drop forty trees on one spot, because none of them was there when the others were tested.

Methods (6)

Used by (5)

  • FoliageGrowthVixen.Foliage
  • FoliageScatterTestsVixen.Foliage.Tests
  • GrassScatterVixen.Foliage
  • GrassScatterParityTestsVixen.Rendering.Terrain.Tests
  • FoliageEditVixen.Editor.Terrain