Interface VertexBufferAttributeParams

Parameters used to create a VertexBufferAttribute

interface VertexBufferAttributeParams {
    vertexBuffer?: VertexBuffer;
    name: string;
    type?: string;
    bufferFormat?: GPUVertexFormat;
    size?: number;
    array: Float32Array;
    verticesStride?: number;
}

Hierarchy (view full)

Properties

vertexBuffer?: VertexBuffer
name: string

The name of the VertexBufferAttribute

type?: string

The WGSL type of the VertexBufferAttribute, i.e. "f32", "vec2f", "vec3f", etc.

bufferFormat?: GPUVertexFormat

The buffer format of the VertexBufferAttribute, i.e. "float32", "float32x2", "float32x3", etc.

size?: number

The size of the VertexBufferAttribute. A "f32" is of size 1, a "vec2f" of size 2, a "vec3f" of size 3, etc.

array: Float32Array

VertexBufferAttribute array that will be used by the VertexBuffer

verticesStride?: number

Use this VertexBufferAttribute for every X vertices. Useful for vertex/face color, etc.