mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 21:41:50 +00:00
fix: remove redundant sorting
This commit is contained in:
parent
1772f0b58c
commit
a07c161df2
1 changed files with 0 additions and 5 deletions
|
|
@ -396,11 +396,6 @@ void ChunksRenderer::drawSortedMeshes(const Camera& camera, Shader& shader) {
|
||||||
order.push_back(VisibleChunkTrans{glm::ivec2(chunk->x, chunk->z), &chunks[index.index], nearest});
|
order.push_back(VisibleChunkTrans{glm::ivec2(chunk->x, chunk->z), &chunks[index.index], nearest});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort chunks by nearest translucent distance back-to-front (far to near)
|
|
||||||
std::sort(order.begin(), order.end(), [](const VisibleChunkTrans& a, const VisibleChunkTrans& b) {
|
|
||||||
return a.nearestDist2 > b.nearestDist2;
|
|
||||||
});
|
|
||||||
|
|
||||||
// Draw per-chunk sorted mesh (keeps GPU buffers and avoids per-frame repack)
|
// Draw per-chunk sorted mesh (keeps GPU buffers and avoids per-frame repack)
|
||||||
for (const auto& item : order) {
|
for (const auto& item : order) {
|
||||||
const auto& chunk = *item.chunkPtr;
|
const auto& chunk = *item.chunkPtr;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue