Constructor
new Attribute(buffer, sizeopt, offsetopt, normalizedopt)
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
buffer | Buffer | The Buffer instance passed in the constructor. | ||
size | number | <optional> | buffer.stride | The number of values of the array that should be associated with a particular vertex. For instance, if this attribute is storing a 3-component vector (such as a position, normal, or color), then size should be 3. |
offset | number | <optional> | 0 | The offset in the underlying array buffer where an item starts. |
normalized | boolean | <optional> | false | Indicates how the underlying data in the buffer maps to the values in the GLSL shader code. |
Members
buffer :Buffer
The Buffer instance passed in the constructor.
divisor :number
Instance cadence, the number of instances drawn for each vertex in the buffer, non-instance attributes must be 0.
- number
- Default Value
- 0
normalized :boolean
Indicates how the underlying data in the buffer maps to the values in the GLSL shader code.
- boolean
- Default Value
- false
offset :number
The offset in the underlying buffer where an item starts.
- number
- Default Value
- 0
size :number
The number of values of the buffer that should be associated with the attribute.
- number
- Default Value
- buffer.stride
Methods
clone(buffers) → {Attribute}
Return a new attribute with the same parameters as this attribute.
Name | Type | Description |
---|---|---|
buffers | object | A WeakMap to save shared buffers. |
- Type:
- Attribute
copy(source) → {Attribute}
Copy the parameters from the passed attribute.
Name | Type | Description |
---|---|---|
source | Attribute | The attribute to be copied. |
- Type:
- Attribute