Skip to content

Geometry

GeometryAttributeOptions ​

Defined in: packages/wtc-gl/src/geometry/GeometryAttribute.ts:7

Options for creating a GeometryAttribute.

Properties ​

PropertyTypeDescription
buffer?WebGLBuffer | nullAn existing WebGL buffer to use instead of creating one. Default null
count?numberThe number of elements. Worked out from data, size and stride when left out.
data| Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>The attribute's data.
external?booleanWhether something other than the geometry, such as a TransformFeedback, manages buffer. Default false
instanced?numberFor an instanced attribute, the number of instances each element is used for (its divisor). 0 for a per-vertex attribute. Default 0
normalized?booleanWhether integer values are normalised into the 0 to 1 (or -1 to 1) range when read as floats. Default false
offset?numberBytes from the start of the buffer to the first element. Default 0
size?numberComponents per element, e.g. 3 for a vec3. Default 1
stride?numberBytes from the start of one element to the next, for interleaved attributes. 0 means tightly packed. Default 0
type?numberThe GL data type. Worked out from data when left out: FLOAT for a Float32Array, UNSIGNED_SHORT for a Uint16Array, otherwise UNSIGNED_INT.