How a tree stores its triangles (docs/internals/design/indexed-leaves.md). Every tree
and scene is one or the other, and the walk is compiled for one
(traceModuleWgsl({ triangleLeaves })):
'records' (the default): 48-byte records with the three corners copied,
GPU_LAYOUT_TRIANGLE_WORD.
'indexed': 16-byte records vec4u(i0, i1, i2, id + flags),
GPU_LAYOUT_INDEXED_TRIANGLE_WORD, whose corners are read from a
positions buffer the scene owns. In a tree (GpuLayoutMeshBvh) the vertex
indices are the mesh's own. A scene keeps them mesh-relative too, and puts
the mesh's vertex base in a header before its triangles
(GPU_LAYOUT_MESH_HEADER_WORD), so trees are placed and moved
without rewriting their records.
How a tree stores its triangles (docs/internals/design/indexed-leaves.md). Every tree and scene is one or the other, and the walk is compiled for one (
traceModuleWgsl({ triangleLeaves })):'records'(the default): 48-byte records with the three corners copied, GPU_LAYOUT_TRIANGLE_WORD.'indexed': 16-byte recordsvec4u(i0, i1, i2, id + flags), GPU_LAYOUT_INDEXED_TRIANGLE_WORD, whose corners are read from a positions buffer the scene owns. In a tree (GpuLayoutMeshBvh) the vertex indices are the mesh's own. A scene keeps them mesh-relative too, and puts the mesh's vertex base in a header before its triangles (GPU_LAYOUT_MESH_HEADER_WORD), so trees are placed and moved without rewriting their records.