@pmndrs/bvh
    Preparing search index...

    Variable GPU_LAYOUT_MESH_HEADER_WORDConst

    GPU_LAYOUT_MESH_HEADER_WORD: {
        materialTableDistance: 3;
        sideTableDistance: 1;
        sourceTableDistance: 2;
        vertexBase: 0;
    } = ...

    An indexed scene puts one 16-byte header (a vec4u) right before each mesh's triangles, at triangleOffset - 1 in 16-byte units: the walk reads it once per instance it enters. A merged mesh keeps its side tables before the header.

    Type Declaration

    • ReadonlymaterialTableDistance: 3

      Other meshes with per-triangle materials: triangleOffset minus their material table's first vec4u (0: none). The table holds each original triangle's material code (material + 1, 0 for none) as 16 bits, two to a word, eight to a vec4u, by original index. A merged mesh keeps its materials in its side table instead.

    • ReadonlysideTableDistance: 1

      Merged meshes: triangleOffset minus the side table's first vec4u (0 otherwise).

    • ReadonlysourceTableDistance: 2

      Merged meshes: triangleOffset minus the source table's first vec4u (0 otherwise).

    • ReadonlyvertexBase: 0

      The mesh's first vertex in the scene's positions buffer.