Hi appreciate your response and I do realize how absurd it really is to use one VBO for each tile ;D
I appreciate you said you weren’t following this thread but the main issue I’m having, is in a large VBO there is no easy way of layering it with other objects outside the VBO.
For example, usually I would write the code like this without VBOs
for (int y = chunkH - 1; y >= 0; y--) {
for (int x = chunkW - 1; x >= 0; x--) {
//render tiles at coordinate
}
for (int x = chunkW - 1; x >= 0; x--) {
//render entites in tiles at coordinate
}
}
This meant that all entities were rendered on top of the necessary tiles and behind the tiles that they shouldn’t be in front of.
The issue with a big VBO for each chunk of tiles, is that I can’t correctly render the entities layered with the tiles.
By my reckoning the only real way to make this work properly is to enable depth testing and use z values the layer things but this is difficult due to a number of issues:
- Each tile needs to be rendered on a different z value
- Each entity needs to rendered on a different z value
- Each entity is made up of multiple body parts so those body parts will also need to be layered correctly and rendered on different z values
- I also need to have GUI objects rendered on certain layers, but on top of the main world