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
| Property | Type | Description |
|---|---|---|
buffer? | WebGLBuffer | An existing buffer to read from instead. |
buffertype? | number | gl.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? | Renderer | Read another renderer's transform feedback output of the same name. |
index? | number | The attribute location. Defaults to the attribute's position in attributes. |
normalize? | boolean | Map integer types to 0–1 (or −1–1). Defaults to false. |
offset? | number | Bytes to the first component. Defaults to 0. |
output? | string | With from: the name of the output to read, if it's different. |
size? | number | Components per vertex, 1 to 4. Defaults to 1. |
stride? | number | Bytes between consecutive vertices; 0 means tightly packed. Defaults to 0. |
type? | number | The type of each component. Defaults to gl.FLOAT. |
usage? | number | How a buffer made from data will be used. Defaults to gl.STATIC_DRAW. |
varying? | string | For transform feedback: the vertex shader output that updates this attribute. |