I thought of putting this code snippets, but at more than 700 lines of code, I think this is a better spot
This is a mesh combiner I made. Not only does it combine the meshes, but it combines their textures so the whole group can be drawn in one call. This speeds up drawing immensely in some cases, and I have the code and a test case included.
Things to note: It only support S3DVertex as of yet, but I plan on adding the other two types soon. It also does not support animation, and that will come later if ever. Also, as with any use of a texture atlas TILING TEXTURES ARE BROKEN BY THIS.
Using scene nodes:
Using mesh combiner:
Keep in mind that the tiles have separate textures and they are being combined by the mesh combiner. It even corrects the uv's!
Two help against bleeding of separate textures in mipmaps, the mesh combiner gives two methods. One, is too expand the texture according to the padding amount (this is a texture atlas for the tiles created by the class):
The second method is to tile it according to the texture padding:
This eliminates most (but not all) problems associated with mipmapping.
Comparison with 100x100 tiles with 4 textures:
Scene nodes: 41 fps
Mesh Combiner: 796 fps
The code and a comparison program can be downloaded here.
EDIT: Update link
Combining mesh scene nodes applies their transformations to the mesh and then combines it. It also corrects the normals and uv's so it looks exactly the same as the separate meshes. Also, feel free to add as many meshes as you need. If the 16 bit index limit is reached, a new mesh buffer is added, so you can add as much as you like.
Please tell me what you think and about any problems you encounter.