Vixen
02b45cc4
csharp
public readonly record struct FoliageType

One kind of thing that gets painted onto a surface: what a .vxfoliage asset holds.

Read the guide page for this →

Remarks

The palette's unit — [docs/plan/31 § The palette]. A type carries the mesh, how densely it is painted, how far apart two of them may be, the ranges its randomness draws from, the filters that refuse a placement, how far it is drawn, and whether it collides.

⚠ Assets are named, not handled. This assembly has no device and no asset database — [§ D1] — and a handle names a slot in a world that issued it, while a .vxfoliage is read by a world that has not run yet. It is the same choice TerrainComponent and TerrainLayerDescription make.

⚠ Radius is a minimum spacing, not a size. It is what makes a painted forest look scattered rather than clumped, and it is the one setting an artist reaches for when a stroke produces a mat of overlapping trunks. The mesh's own size is the mesh's business.

Fields and properties (24)

  • public string Name

    What the type is called, which is what the palette lists it as.

  • public string Mesh

    The mesh or LOD group this places, by asset name.

  • public FoliageStorage Storage

    Whether its instances are stored or scattered from a rule.

  • public float Density

    How many instances a square metre of full-strength brush places.

  • public float Radius

    How close together two instances of this type may be, in metres.

  • public float MinScale

    The smallest uniform scale an instance is given.

  • public float MaxScale

    And the largest.

  • public float AlignToNormal

    How much an instance turns to face the surface normal, 0…1.

  • public float MaxPitch

    How far an instance may be tilted at random, in radians.

  • public bool RandomYaw

    Whether each instance is turned to a random heading.

  • public float MinSlope

    The shallowest ground this may be placed on, as a slope in radians from flat.

  • public float MaxSlope

    And the steepest.

  • public float MinAltitude

    The lowest altitude this may be placed at, in metres.

  • public float MaxAltitude

    And the highest.

  • public string LayerFilter

    A terrain layer this only spawns on, by name, or empty for anywhere.

  • public float LayerThreshold

    How much of LayerFilter a place needs before this may spawn, 0…1.

  • public float StartCullDistance

    How far away instances start fading out, in metres.

  • public float EndCullDistance

    And where they are gone.

  • public bool CastShadows

    Whether instances cast shadows.

  • public string CollisionShape

    The collision shape an instance gets, by asset name, or empty for none.

  • public float ActivationRadius

    How close a physics-relevant entity has to be before an instance gets a body, in metres.

  • public FoliageEcology Ecology

    How it behaves in a growth simulation, or None.

  • public bool Collides

    Whether an instance of this type ever gets a physics body.

  • public bool NeedsSurfaceWeight

    Whether a placement has to ask what is painted underneath it.

Methods (3)

  • public static FoliageType Of(string name)

    A type with the settings a new one starts from.

  • public int CandidatesFor(float brushRadius)

    How many instances a stamp of this radius would place at full strength.

  • public string? Validate()

    Why this type cannot be used, or if it can.

Used by (29)

  • FoliageBlockerTestsVixen.Rendering.Terrain.Tests
  • FoliageCollisionVixen.Foliage
  • FoliageCollisionTestsVixen.Foliage.Tests
  • FoliageCullParityTestsVixen.Rendering.Terrain.Tests
  • FoliageCullPassVixen.Rendering.Terrain
  • FoliageCullPassTestsVixen.Rendering.Terrain.Tests
  • FoliageGrowthVixen.Foliage
  • FoliageGrowthTestsVixen.Foliage.Tests
  • FoliageRendererVixen.Rendering.Terrain
  • FoliageRendererTestsVixen.Rendering.Terrain.Tests
  • FoliageScatterVixen.Foliage
  • FoliageScatterTestsVixen.Foliage.Tests
  • FoliageStoreVixen.Foliage
  • FoliageStreamingTestsVixen.Rendering.Terrain.Tests
  • FoliageVolumeVixen.Foliage
  • FoliageVolumeTestsVixen.Foliage.Tests
  • GrassCostsNothingTestsVixen.Foliage.Tests
  • GrassTypeVixen.Foliage
  • PaletteRemovalTestsVixen.Foliage.Tests
  • TypeRegistrationVixen.Foliage
  • TypesVixen.Foliage.Tests
  • Vixen_Foliage_FoliageTypeSerializerVixen.Foliage
  • AddFoliageTypeCommandVixen.Editor.Terrain
  • FoliageEditVixen.Editor.Terrain
  • FoliageModeVixen.Editor.Terrain
  • FoliageModeTestsVixen.Editor.Terrain.Tests
  • TerrainAssetImporterVixen.Editor.Assets
  • TerrainModuleVixen.Editor.Terrain
  • TerrainSessionTestsVixen.Editor.App.Tests