Van-B wrote:Sorry, my terminology is probably all to hell, it's been a while since I did anything with OpenGL (finalising game design before finishing it). Anyhoo, with GLES there are a few different mesh construction methods - which I'm sure your aware of. A standard sprite may use just 4 indices in a vertice, coordinate, and colour arrays. Then this sprite might set those array values as part of a draw function. Alternatively, I tend to use triangles, which have a bigger array, with enough indices for however many sprites I need. Then those sprites are created on the same 'mesh', each mesh of triangles being restricted to a single texture. I have the vertice, coordinate, and colour arrays as part of my sprite class with counter variables, so I add pairs of triangles then render the lot.
Well, goddamn! I had actually never considered that. You are most certainly gaining quite a bit of performance by NOT rendering each tile as its own individual textured quad, because you can save on the expensive operation of setting a texture. With ES, we're definitely setting the texture once during the rendering of the tile layers, but we're also rendering each individual tile as its own polygon... I had never considered rendering the tiles all as a single triangle mesh... Wow... Great idea! I have no idea what the performance increase will be, but I'm guessing it will definitely be better. Not only that... but we could just as easily try this method on the Dreamcast/PSP and see what the increase is like on those architectures... I am excite!
edit: Also, the Dreamcast (and maybe PSP?) only renders triangle strips anyway. So you really aren't even using any more space for the vertices.
Van-B wrote: I'm not sure how I would deal with characters going in front and behind items - that is always tricky, more so when trying to optimise meshes.
Even if this is an issue, tile-based engines usually have multiple tile "layers" for handling render order. Each of these layers could be a single mesh, with the objects/entities being rendered as a individual quads/polygons with their own individual render calls afterwards...
Thanks for the awesome idea, Van-B! I was actually working on optimizing a lot of the rendering on the other platforms before the next video. Perfect timing!