minimize chunks overdraw

This commit is contained in:
MihailRis 2024-11-25 13:12:47 +03:00
parent 97cf597a01
commit 7ddf3f7537

View File

@ -196,7 +196,7 @@ void ChunksRenderer::drawChunks(
shader.uniform1i("u_alphaClip", true);
// TODO: minimize draw calls number
for (size_t i = 0; i < indices.size(); i++) {
for (int i = indices.size()-1; i >= 0; i--) {
auto chunk = chunks.getChunks()[indices[i].index];
auto mesh = retrieveChunk(indices[i].index, camera, shader, culling);