Vixen
c7401864
csharp
public sealed class FoliageDrawPass

Binds the pipeline and the per-frame set a volume's foliage is drawn with.

Read the guide page for this →

Remarks

[docs/plan/31 § T5]'s draw, and the half FoliageCullPass deliberately does not do. That class owns the instance table, the two dispatches and the patched argument buffer, and exposes the three buffers a draw needs without binding any of them — a compute dispatch has no business knowing what a pine looks like. This is what knows: the pipeline built from Foliage.rvn, the constants, and set 2.

⚠ The instance id is the survivor slot, and that is the whole indirection. The cull patched each command's firstInstance to its batch's run, so the vertex stage reads survivors[SV_InstanceID] and then the instance it names — no transform is compacted, copied or re-uploaded between the cull and the draw.

⚠ The set is rung by frames in flight, for GrassDrawPass's reason: Prepare is an immediate host memcpy of the constants and a descriptor rewrite, and the frame still in flight is reading both. The storage bindings also move per frame — Commands is one slot of a ring.

⚠ One albedo for the pass, white by default, and that is this increment's honest ceiling. A .vxfoliage names a mesh and nothing about its material; resolving a model's materials into per-type textures is the impostor bake's problem too, and it is owed to the same increment. Until then a forest draws flat-shaded in its tint — which reads as "no material yet" rather than as foliage that is broken.

Fields and properties (5)

  • public const int VertexBytes

    How many bytes one vertex is: position, normal, texcoord.

  • public TextureViewHandle Albedo

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

  • public float AlphaCutoff

    The alpha below which a texel is a hole rather than a colour, 0…1.

  • public int Draws

    How many indirect draws the last Record issued.

  • public int MissingMeshes

    How many batches the last Record skipped for want of a mesh.

Methods (5)

Used by (4)

  • FoliageDrawPassTestsVixen.Rendering.Terrain.Tests
  • FoliageStandVixen.Rendering.Terrain
  • FoliageVelocityPassVixen.Rendering.Terrain
  • TerrainSceneRendererVixen.Rendering.Terrain