public readonly record struct GrassTypeOne kind of grass: what a .vxgrass asset holds.
Remarks
[docs/plan/31 § D8]'s derived counterpart to FoliageType, and it is smaller because most of that does not apply. Grass is scattered from a rule and never persisted: nothing about a blade of grass is in any file, so there is no identity to keep, no collision to allocate and no undo record to hold. What a level says is "this type, on this layer", and a million blades follow.
⚠ Density is the candidate density and never the placed one. It fixes the grid a cell is scattered over — which on the device is the dispatch extent and therefore cannot depend on anything sampled — and what the painted weight decides is what fraction of those candidates survive. A density that varied with the weight would mean a dispatch whose size depends on a texture read, which is not a thing.
⚠ The layer is a name, for LayerFilter's reason. Removing the second of six terrain layers shifts the rest down, and a type holding the index would silently start growing on different ground.
Fields and properties (16)
public string NameWhat the type is called.
public string MeshThe mesh this scatters, by asset name.
public string LayerWhich terrain layer's weight it reads, or empty to grow anywhere.
public float MinWeightThe weight below which nothing grows, 0…1.
public float MaxWeightAnd the weight at which the field is at full density.
public float DensityHow many candidates a square metre is scattered with.
public float JitterHow far a candidate may wander from its grid slot, 0…1 of half a step.
public float MinScaleThe smallest uniform scale a blade is given.
public float MaxScaleAnd the largest.
public bool RandomYawWhether each blade is turned to a random heading.
public float AlignToNormalHow much a blade turns to face the surface normal, 0…1.
public float MaxSlopeThe steepest ground it grows on, as a slope in radians from flat.
public float StartCullDistanceHow far away blades start fading out, in metres.
public float EndCullDistanceAnd where they are gone.
public GrassWind WindHow it moves.
public bool NeedsSurfaceWeightWhether a candidate has to ask what is painted underneath it.
Methods (6)
public static GrassType Of(string name)A type with the settings a new one starts from.
public FoliageType ToFoliageType()The same rule, as a palette entry a volume can hold.
public float DensityAt(float weight)What fraction of this type's candidates a painted weight keeps, 0…1.
public int GridOf(float cellSize)How many candidates a cell is scattered over, along one axis.
public int CandidatesFor(float cellSize)How many candidates one cell generates.
public string? Validate()Why this type cannot be used, or if it can.
Used by (15)
- GrassDispatchVixen.Rendering.Terrain
- GrassDispatchTestsVixen.Rendering.Terrain.Tests
- GrassDrawVixen.Rendering.Terrain
- GrassDrawPassTestsVixen.Rendering.Terrain.Tests
- GrassRendererVixen.Rendering.Terrain
- GrassRendererTestsVixen.Rendering.Terrain.Tests
- GrassScatterVixen.Foliage
- GrassScatterParityTestsVixen.Rendering.Terrain.Tests
- GrassScatterTestsVixen.Foliage.Tests
- TerrainSurfaceTestsVixen.Rendering.Terrain.Tests
- TypeRegistrationVixen.Foliage
- Vixen_Foliage_GrassTypeSerializerVixen.Foliage
- TerrainAssetImporterVixen.Editor.Assets
- TerrainModuleVixen.Editor.Terrain
- TerrainSessionTestsVixen.Editor.App.Tests