GL31.glDrawElementsInstanced(GL11.GL_TRIANGLES, tm.getRawModel().getVertexCount(), GL11.GL_UNSIGNED_INT, 0L, tempEntityList.size());
Also, a bit misleading, is the fact that your RawModel.getVertexCount() is not the actual number of vertices in the vertex buffer but the number of indices/elements.
return new RawModel(vaoID, positions.length);
return new RawModel(vaoID, (positions.length)/3);
I was getting the indeces count, and not the vertex count, dumb me (now Im wondering how the hell it worked with the standard renderer, but whatever). I fixed that, now the return statement of the loadToVAO method in the DataManager class returns:
Code: [Select]return new RawModel(vaoID, (positions.length)/3);
The problem is that you are using glDrawArraysInstanced() which is not using indices/element arrays, but only draws all vertices specified in the buffer object bound to GL_ARRAY_BUFFER. Since your OBJ loader does load (reused) indices, you have to use the indices/element arrays instead when drawing.