The number of items in the attribute. For example, given a vertex attribute this would the number of vertices stored in the buffer.
e.g.
const triangleVertices = new Float32Array([
-1.0, -1.0, 1.0, -1.0, 1.0, 1.0,
]);
const posAttribute = new Attribute({
// other stuff
format: "float32x2",
itemCount: triangleVertices.length / 2,
});
would have an itemCount of 3, because three 2D vertices are contained in the buffer.
The number of components in each item of the attribute e.g.
@location(0) pos: vec3<f32>
would have an itemSize of 3.
Optional
label?: stringThe value of the location directive of the attribute in the shader e.g.
@location(0) pos: vec3<f32>
would have a shaderLocation of 0.
Generated using TypeDoc
Attribute constructor parameters