Vixen
02b45cc4
csharp
public readonly record struct GrassWind

How a grass type moves.

Read the guide page for this →

Remarks

The host half of Displacement.WindParameters, field for field. Two frequencies rather than one, because a single sine reads as mechanical: a slow bend plus a fast flutter is the cheapest thing that looks alive, and it is what the shader already implements.

⚠ No phase, and that is the point of InstanceParameters.WindPhase. The shader's phase comes from world position, which decorrelates two blades a hundred metres apart and does nothing at all for two that are ten centimetres apart — which is every pair of blades in a clump. The per-instance offset is what the scatter draws, so it belongs to the blade rather than to the profile.

Fields and properties (8)

  • public Vector2 Direction

    Which way it blows, in the XZ plane. Normalised on use.

  • public float Strength

    How far the slow bend carries, in metres at full stiffness.

  • public float Frequency

    How many radians of phase a metre of world costs.

  • public float Speed

    How fast the phase advances with time.

  • public float Flutter

    The high-frequency component, which reads as leaves rather than branches.

  • public float Height

    The object-space height the sway is normalised against, so the base stays planted.

  • public static GrassWind Still

    Wind that does nothing.

  • public static GrassWind Breeze

    The settings a new grass type starts from.

Methods (1)

  • public string? Validate()

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

Used by (9)

  • GrassDrawPassVixen.Rendering.Terrain
  • GrassDrawPassTestsVixen.Rendering.Terrain.Tests
  • GrassRendererVixen.Rendering.Terrain
  • GrassTypeVixen.Foliage
  • TypeRegistrationVixen.Foliage
  • Vixen_Foliage_GrassTypeSerializerVixen.Foliage
  • Vixen_Foliage_GrassWindSerializerVixen.Foliage
  • TerrainGrassSettingsVixen.Editor.Terrain
  • TerrainPanelTestsVixen.Editor.App.Tests