I'm embarking on a game development project using WebGL.
Currently, I have three textures in my arsenal- one for letters used in the font, another for character sprites, and a tilemap texture for the world. With these large textures at hand, I find myself needing to draw small portions of them repeatedly.
What could be the most effective way to go about this task?
My initial strategy involves utilizing a VAO (Vertex Array Object) for each individual element such as letters, map squares, character poses, etc. This would mean managing over 150 VAOs. While I initially believed that VAOs offered simplicity and improved performance, some sources like this and this suggest otherwise.
Another method I am considering is maintaining only three VAOs and adjusting the starting position within the buffer in order to access the necessary letter or element. This approach would involve having fewer but larger VAOs instead of numerous VAOs with smaller arrays. In case this turns out to be the preferred approach, would I need to call gl.vertexAttribPointer() after gl.enablevertexAttribArray() every time I draw something, or simply modify the count parameter in gl.drawArrays()?
Given that gl.getParameter( gl.MAX_TEXTURE_IMAGE_UNITS ) indicates either 16 or 32, dividing the textures into smaller sections doesn't seem viable either.
What would be the most advantageous conceptual method to adopt in this scenario?