Skip to content

Types

Attribute ​

Defined in: createRenderer.js:86

One vertex attribute, keyed by its name in the vertex shader. Give it data, an existing buffer, or from another renderer's transform feedback output.

Properties ​

PropertyTypeDescription
buffer?WebGLBufferAn existing buffer to read from instead.
buffertype?numbergl.ELEMENT_ARRAY_BUFFER makes this the index buffer. Defaults to gl.ARRAY_BUFFER.
component?"attribute" | "transformFeedback""transformFeedback" makes this an output of the vertex shader as well as an input; see varying. Defaults to "attribute".
data?ArrayBufferView<ArrayBufferLike>Values to upload into a new buffer.
from?RendererRead another renderer's transform feedback output of the same name.
index?numberThe attribute location. Defaults to the attribute's position in attributes.
normalize?booleanMap integer types to 0–1 (or −1–1). Defaults to false.
offset?numberBytes to the first component. Defaults to 0.
output?stringWith from: the name of the output to read, if it's different.
size?numberComponents per vertex, 1 to 4. Defaults to 1.
stride?numberBytes between consecutive vertices; 0 means tightly packed. Defaults to 0.
type?numberThe type of each component. Defaults to gl.FLOAT.
usage?numberHow a buffer made from data will be used. Defaults to gl.STATIC_DRAW.
varying?stringFor transform feedback: the vertex shader output that updates this attribute.