I'm working on new game, this time moving to more 3d objects and open gl es 2. Previous (successful) game was open gl es 1 and mostly 2d. For es 2 I'm developing my own 3d engine.
My 3d artist delivers .obj's each with a texture map for base and one for bump (normal). I already have a way to import them all into a single vbo. But combining the textures is a more challenging problem.
In the es 1 game I did a couple of large texture atlases and could have them all loaded at once. But since all my geometry was just boxes it was easy to shift them around (small number of vertex) to fit. I stacked gfx like tetris pieces to fit everything in. For this though it's a bigger pain to combine textures as there are many many more vertices and they're already mapped to these individual textures.
I have several ideas for ways to approach the problem:
Keep the separate but manage the loading and releasing of texture images better, so that when a level is loaded it loads just the images needed for the objects needed for the level. If I did this how many images can the ios implementation handle? How would performance suffer on older devices like the iPhone 4?
Combine multiple textures into atlases and cram image parts together however necessary to fit. Then load the obj's into my 3d app and basically manually remap everything to the combined texture. It's a pain and basically what I'm paying the 3d artist to do.
Combine multiple textures into atlases but by putting 4, 8, 16, etc smaller ones into each larger one.. DON'T cram them together but uniformly shrink each one. Then the remapping can be mathematical instead of a manual remapping. (This would leave possibly a lot of un-used space in some of the sub-textures)
3A. Pre-calculate the math beforehand in the importing process.
3B. Modify my shader to shrink and offset the textcoord on the fly by an amount provided as a uniform.
Also.. is it better to combine the base texture and normal texture into one or have 2? Combining them would mean having the shader do math to move the textcoord over for the normal map.