Interface WTCGLGeometryAttribute

Represents a geometry attribute.

interface WTCGLGeometryAttribute {
    buffer: WebGLBuffer;
    count: number;
    data:
        | Float32Array
        | Float64Array
        | Uint16Array
        | Uint32Array;
    divisor: number;
    instanced: number;
    needsUpdate: boolean;
    normalized: boolean;
    offset: number;
    size: number;
    stride: number;
    target: number;
    type: number;
    updateAttribute(gl: WTCGLRenderingContext): void;
}

Implemented by

Properties

buffer: WebGLBuffer

The WebGL buffer containing the static attribute data.

count: number

the number of elements in the attribute

data:
    | Float32Array
    | Float64Array
    | Uint16Array
    | Uint32Array

A typed array of data for the attribute.

divisor: number

The divisor, used in instanced attributes.

instanced: number

The number of instances for this attribute. If zero this object is determined to be non-instanced.

needsUpdate: boolean

Whether this attribute needs an update. Set after the attribute changes to have it recast to memory.

normalized: boolean

Whether integer data values should be normalized into a certain range when being cast to a float.

offset: number

How many bytes to offset when passing in the buffer.

size: number

The size of each element in the attribute. For example if you're describing 3D vectors, this would be 3.

stride: number

How big a stride should this attribute have. Should be 0 for all attributes that are uncombined.

target: number

gl.ELEMENT_ARRAY_BUFFER or gl.ARRAY_BUFFER depending on whether this is an index attribute or not.

type: number

default gl.UNSIGNED_SHORT for 'index', gl.FLOAT for others.

Methods