I'm trying to draw a glTF model where all geometry is indexed, e.g.:
"meshes": [
{
"name": "Plane.010",
"primitives": [
{
"attributes": {
"POSITION": 0,
"NORMAL": 1,
"COLOR_0": 2
},
"indices": 3, <-- here
"material": 0
}
]
},
But there is only a single buffer defined, and no buffer views specify targets:
"buffers": [
{
"uri": "data.bin",
"byteLength": 4518576
}
]
So I send the binary data to the GPU using a single call to glBufferData with a VertexArray bound. Now I need to draw the primitives somehow using glDrawElements. Is there a way to create an ELEMENT_ARRAY_BUFFER and point it to a part of an already loaded buffer?