Open bchirlsbiodigital opened 2 years ago
drawType
is optional
if it's not specified twgl will use STATIC_DRAW
It's copied to the attribute info you linked to but if it's not set it will still be undefined and so still use STATIC_DRAW
.
As for why set it, it's a hint to WebGL that you're going to update the buffer often, 'hint' means it's not required as it's only a hint.
Refer to the following code from the dynamic buffers example:
If I'm following the documentation correctly, each array passed to
createBufferInfoFromArrays
should be anArraySpec
, which does not include thedrawType
property. It looks like the function does actually use the property, so I think it's the docs/types that are incomplete not the example.Could you please clarify here or update the example, docs or types to reflect the proper way to set
drawType
on an attribute?Thanks!