csharp
public struct GrassInstanceRecordOne blade as the dispatch writes it, matching GrassInstance in the shader.
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 PositionWhere the blade stands, in world space.
public float ScaleHow big it is, uniformly.
public Quaternion RotationWhich way it faces, as (x, y, z, w).
public float TintA per-blade variation, 0…1.
public float WindPhaseA phase offset in radians, so a clump does not move as one object.
public float Padding0Declared so the record is forty-eight bytes on both sides.
public float Padding1And the second half of it.
public static int SizeInBytesHow many bytes one of these is.
Methods (1)
public static GrassInstanceRecord Of(in GrassBlade blade)The record a blade the CPU reference produced would be.
Used by (2)
- GrassDispatchVixen.Rendering.Terrain
- GrassDispatchTestsVixen.Rendering.Terrain.Tests