Docs / Ray tracing

Glossary: BvhNode

The members of BvhNode, in alphabetical order.

Color legend plain property

One node of a Bvh: a box, and either a leaf’s primitives or an interior node’s skip.

A struct of public fields, 32 bytes with no padding, sent to the GPU byte for byte as GpuBvhNode. A leaf and an interior node share the layout, told apart by the sign of PrimitiveCount. The BVH page shows it in context, with a picture.

Names are colored by what they are: a property; values and fields keep the plain color.

Properties

IsLeaf →

bool · Read-only. PrimitiveCount is above 0. The GPU asks only this of the count.

SplitAxis →

int · Read-only. An interior node’s split axis, 0, 1 or 2 for X, Y or Z: its left child holds the primitives on the low side of the plane. Bvh.VisitRightFirst reads it. Meaningless for a leaf.

Fields

Max →

Vector3 · The high corner of the node’s box.

Min →

Vector3 · The low corner of the node’s box.

PrimitiveCount →

int · Above 0, a leaf with that many primitives. Below 0, an interior node, which keeps its split axis here as −(axis + 1): −1, −2 or −3.

SkipOrFirst →

int · A leaf’s first entry in PrimitiveIndices; an interior node’s skip, the first node after its subtree, where a walk goes on when it misses the box. On the GPU it is absolute: a BLAS leaf’s first triangle in the Triangles buffer, a skip a node in BlasNodes.