mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Consolidate transparent buffers lazily
This commit is contained in:
parent
c00fed20b7
commit
39970fed38
2 changed files with 7 additions and 0 deletions
|
@ -906,6 +906,7 @@ void MapBlockMesh::updateTransparentBuffers(v3f camera_pos, v3s16 block_pos)
|
|||
m_bsp_tree.traverse(rel_camera_pos, triangle_refs);
|
||||
|
||||
// arrange index sequences into partial buffers
|
||||
m_transparent_buffers_consolidated = false;
|
||||
m_transparent_buffers.clear();
|
||||
|
||||
scene::SMeshBuffer *current_buffer = nullptr;
|
||||
|
@ -930,6 +931,8 @@ void MapBlockMesh::updateTransparentBuffers(v3f camera_pos, v3s16 block_pos)
|
|||
|
||||
void MapBlockMesh::consolidateTransparentBuffers()
|
||||
{
|
||||
if (m_transparent_buffers_consolidated)
|
||||
return;
|
||||
m_transparent_buffers.clear();
|
||||
|
||||
scene::SMeshBuffer *current_buffer = nullptr;
|
||||
|
@ -952,6 +955,8 @@ void MapBlockMesh::consolidateTransparentBuffers()
|
|||
if (!current_strain.empty()) {
|
||||
this->m_transparent_buffers.emplace_back(current_buffer, std::move(current_strain));
|
||||
}
|
||||
|
||||
m_transparent_buffers_consolidated = true;
|
||||
}
|
||||
|
||||
video::SColor encode_light(u16 light, u8 emissive_light)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue