mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 20:41:49 +00:00
feat: distance-based dense render optimization
This commit is contained in:
parent
799d712447
commit
fbde46afa7
6 changed files with 87 additions and 39 deletions
|
|
@ -126,11 +126,9 @@ void Mesh<VertexStructure>::draw(unsigned int primitive, int iboIndex) const {
|
|||
if (!ibos.empty()) {
|
||||
if (iboIndex < ibos.size()) {
|
||||
glBindVertexArray(vao);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ibos[
|
||||
std::min(static_cast<size_t>(iboIndex), ibos.size())
|
||||
].ibo);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ibos[iboIndex].ibo);
|
||||
glDrawElements(
|
||||
primitive, ibos.at(0).indexCount, GL_UNSIGNED_INT, nullptr
|
||||
primitive, ibos.at(iboIndex).indexCount, GL_UNSIGNED_INT, nullptr
|
||||
);
|
||||
glBindVertexArray(0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue