A uniform buffer holding one struct, uniform<StructName>, bound as a BufferResource range
The struct comes from the bits' structs, or from the fields of a group the template doesn't
bind. WGSL reads a wind binding as wind.<field> and GLSL as uWind.<field>, except that
GLSL splits a mat2x2<f32> field into <field>_0 and <field>_1. Fill the buffer in WGSL's
layout. GLSL's std140 matches it for scalars, vectors, mat2x2<f32>, matrices of vec3 or
vec4 columns, and arrays of 16-byte elements, and the GLSL compile refuses any other field.
Only a bind group your own pass builds can hold one. One declared in the engine's global,
camera or batch group is never bound: WebGL skips the draw and WebGPU throws at the first
draw. Put per-material values in the bit's material fields instead, and read them through the
material local, never uMaterial, which a draw that merges materials doesn't declare.
A uniform buffer holding one struct,
uniform<StructName>, bound as aBufferResourcerangeThe struct comes from the bits'
structs, or from the fields of a group the template doesn't bind. WGSL reads awindbinding aswind.<field>and GLSL asuWind.<field>, except that GLSL splits amat2x2<f32>field into<field>_0and<field>_1. Fill the buffer in WGSL's layout. GLSL'sstd140matches it for scalars, vectors,mat2x2<f32>, matrices ofvec3orvec4columns, and arrays of 16-byte elements, and the GLSL compile refuses any other field.Only a bind group your own pass builds can hold one. One declared in the engine's
global,cameraorbatchgroup is never bound: WebGL skips the draw and WebGPU throws at the first draw. Put per-material values in the bit'smaterialfields instead, and read them through themateriallocal, neveruMaterial, which a draw that merges materials doesn't declare.