Constructor
new Attribute(buffer, sizeopt, offsetopt, normalizedopt)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
buffer | t3d. | 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 :t3d.Buffer
The Buffer instance passed in the constructor.
Type:
divisor :Number
Instance cadence, the number of instances drawn for each vertex in the buffer, non-instance attributes must be 0.
Type:
- Number
- Default Value
- 0
normalized :Boolean
Indicates how the underlying data in the buffer maps to the values in the GLSL shader code.
Type:
- Boolean
- Default Value
- false
offset :Number
The offset in the underlying buffer where an item starts.
Type:
- Number
- Default Value
- 0
size :Number
The number of values of the buffer that should be associated with the attribute.
Type:
- Number
- Default Value
- buffer.stride
Methods
clone(buffers) → {t3d.Attribute}
Return a new attribute with the same parameters as this attribute.
Parameters:
Name | Type | Description |
---|---|---|
buffers | Object | A WeakMap to save shared buffers. |
Returns:
- Type:
- t3d.
Attribute
copy(source) → {t3d.Attribute}
Copy the parameters from the passed attribute.
Parameters:
Name | Type | Description |
---|---|---|
source | t3d. | The attribute to be copied. |
Returns:
- Type:
- t3d.
Attribute