Vixen
02b45cc4
csharp
public struct GrassInstanceRecord

One blade as the dispatch writes it, matching GrassInstance in the shader.

Read the guide page for this →

Remarks

Forty-eight bytes: a position and a uniform scale, a quaternion, and the two per-instance numbers the draw reads. FoliageStore.InstanceBytes plus an InstanceParameters, which is what lets a seam test compare the dispatch's output against GrassScatter's bytes rather than against an interpretation of them.

Fields and properties (8)

  • public Vector3 Position

    Where the blade stands, in world space.

  • public float Scale

    How big it is, uniformly.

  • public Quaternion Rotation

    Which way it faces, as (x, y, z, w).

  • public float Tint

    A per-blade variation, 0…1.

  • public float WindPhase

    A phase offset in radians, so a clump does not move as one object.

  • public float Padding0

    Declared so the record is forty-eight bytes on both sides.

  • public float Padding1

    And the second half of it.

  • public static int SizeInBytes

    How many bytes one of these is.

Methods (1)

Used by (2)

  • GrassDispatchVixen.Rendering.Terrain
  • GrassDispatchTestsVixen.Rendering.Terrain.Tests