I struggled through setting up vertex arrays (mostly stupid problems, the only kind I do)… and to my horror they didn’t improve speed, actually decreased it. I suspected going into it that it’d have a minimal impact despite the advantage of removing some JNI overhead… I have a few theories about this… the first and probably correct one is that I’m only doing chunks of 24 vertices at a time (yep, cubes, and lots of them), I had considered setting up a monster array but each cube has potentially different color information (not a big deal, I could just use a color array too), different materials (I think this is a big deal, I didn’t see any way to have multiple materials using vertex arrays) and probably the most important one, textures, there is basically an unknown number of textures and each cube could potentially have a different texture (so playing fancy pants with the texture coords isn’t a real option). Typically the cubes would have just a few different textures, so I could always group them by texture and send them in a bigger batch, but that starts to add up to a lot of work since the cubes are frequently changed (work for me to write code that maintains the array, though I think drawElements would allow me to not draw some cubes without altering the array). The other option is that I’m just doing something horrifically wrong (besides the small number of vertices sent at a time).
Anyone have any opinions about this, or have any idea about how many vertices you need to draw (or maybe more accurately gl function calls) to gain an advantage from using vertex arrays? If there is a way to handle the materials well I can probably make better use of the arrays, especially if there is a way to handle binding different textures too…