An alternative version of a buffer attribute with more control over the VBO.
The renderer does not construct a VBO for this kind of attribute. Instead, it uses whatever VBO is passed in constructor and can later be altered via the buffer property.
The most common use case for this class is when some kind of GPGPU calculation interferes or even produces the VBOs in question.
Notice that this class can only be used with WebGLRenderer.
Constructs a new GL buffer attribute.
buffer
The native WebGL buffer.
type
The native data type (e.g. gl.FLOAT).
itemSize
The item size.
elementSize
The corresponding size (in bytes) for the given type parameter.
count
The expected number of vertices in VBO.
normalized
Whether the data are normalized or not.
Default is false.
The native WebGL buffer.
The expected number of vertices in VBO.
The corresponding size (in bytes) for the given type parameter.
This flag can be used for type testing.
Default is true.
The item size, see BufferAttribute#itemSize.
The name of the buffer attribute.
Flag to indicate that this attribute has changed and should be re-sent to the GPU. Set this to true when you modify the value of the array.
Default is false.
Applies to integer data only. Indicates how the underlying data in the buffer maps to the values in the GLSL code. For instance, if buffer contains data of gl.UNSIGNED_SHORT, and normalized is true, the values 0 - +65535 in the buffer data will be mapped to 0.0f - +1.0f in the GLSL attribute. If normalized is false, the values will be converted to floats unmodified, i.e. 65535 becomes 65535.0f.
The native data type.
A version number, incremented every time the needsUpdate is set to true.
Sets the given native WebGL buffer.
buffer
The buffer to set.
Returns: A reference to this instance.
Sets the count (the expected number of vertices in VBO).
count
The count.
Returns: A reference to this instance.
Sets the item size.
itemSize
The item size.
Returns: A reference to this instance.
Sets the given native data type and element size.
type
The native data type (e.g. gl.FLOAT).
elementSize
The corresponding size (in bytes) for the given type parameter.
Returns: A reference to this instance.