Vixen
02b45cc4
csharp
public sealed class GrassDrawPass

Binds the pipeline, the blade and the material a grass field is drawn with.

Read the guide page for this →

Remarks

[docs/plan/31 § T6]'s draw, and the half GrassDispatch deliberately does not do. That class owns the scatter, the cull and the argument buffer, and its RecordDraws binds nothing on purpose — a compute dispatch has no business knowing what a blade looks like. This is what knows: the pipeline built from Grass.rvn, the blade mesh, the albedo, and set 2.

⚠ The blades buffer is rebound every frame rather than once. GrassDispatch writes into a ring and the buffer handle is stable, but the descriptor set is per frame-in-flight for the same reason the terrain's is: writing a set a frame in flight is still reading is a race the validation layers catch and the driver does not.

⚠ Two-sided, and that is not a default worth inheriting. A blade is a flat quad seen from both sides as its instance rotates; culling its back faces makes half a field vanish depending on where a person stands, which reads as the scatter being wrong rather than as the raster state being wrong.

Fields and properties (5)

  • public int DefaultBladeIndices

    How many indices the built-in blade is.

  • public GrassBladeMesh Blade

    What every instance is drawn from.

  • public TextureViewHandle Albedo

    What the blades are textured with, or default for the built-in white.

  • public int Draws

    How many draws the last Record issued.

  • public bool HasBlade

    Whether the last Record had a mesh to draw with.

Methods (4)

Used by (1)

  • GrassDrawPassTestsVixen.Rendering.Terrain.Tests