Investigating a bug where Buster Drone crashes due to drawElements: attempt to access out of bounds arrays cased by Morph component
Orphaned properties left undefined in texCoord0 attribute?
buffer.length
buffer.type
Added entity id and name to drawing command name. Turns out it's "Scheibe_Boden_0" that is crashing, first mesh in the gltf json. It's texCoord0 buffer has not length as mentioned above in orphaned props.
Same for "Drone_Body_body_0", second mesh in gltf json.
Filtering out all other meshes and drawing only Scheibe_Boden_0 renders just fine depite it's buffer length being null.
Enabling additional geometries with Morph elements crashes on "Scheibe_Boden_0" (the mesh with morph is named "1", there are only two meshes enabled in this case)
More info about the error from Firefox: Error: WebGL warning: drawElements: Indexed vertex fetch requires 7 vertices, but attribs only supply 6.
Getting buffer size using webgl, returns 156 / 4bytes = 39 elements = 3 13 => ok?
aPosition, aNormal are both 39 4 bytes long but aTexCoord0 buffer is 51194 4 bytes long
Setting morph.enabled = false, stops crashing again... Looking at the morph code..
This is where more updates geometry this.entity.getComponent('Geometry').set(this.current)
Attributes that get updated in mesh "1"
aNormal -> vertexBuffer_89
aPosition -> vertexBuffer_89
aTangent -> vertexBuffer_90
While Scheibe_Boden_0 mesh attributes use
aNormal -> vertexBuffer_89
aPosition -> vertexBuffer_89
aTangent -> vertexBuffer_89
aTexCoord0 -> vertexBuffer_88
Hypothesis: morph updating attributes overwrites buffer with a shorter version so other meshes using the same buffer but with offset try reading from old location that no longer exist
Investigating a bug where Buster Drone crashes due to
drawElements: attempt to access out of bounds arrays
cased by Morph componentgl.bindBuffer(gl.ARRAY_BUFFER, buf.handle) gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE)