17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-30 06:10:28 +01:00

Cull instances by compact records and draw them from a shader storage buffer

This commit is contained in:
2026-10-16 00:37:54 +02:00
parent fd98d4eea5
commit 9277c28805
13 changed files with 269 additions and 228 deletions

View File

@@ -381,7 +381,7 @@ basic_cell::insert( TAnimModel *Instance ) {
}
auto &bucket { m_instancebuckets_opaque[ key ] };
bucket.instances.emplace_back( Instance );
bucket.bounds.clear();
bucket.records.clear();
}
}
// re-calculate cell bounding area, in case model extends outside the cell's boundaries
@@ -484,7 +484,7 @@ basic_cell::erase( TAnimModel *Instance ) {
instances.erase(
std::remove( std::begin( instances ), std::end( instances ), Instance ),
std::end( instances ) );
bucket->second.bounds.clear();
bucket->second.records.clear();
if( instances.empty() ) {
bucket = m_instancebuckets_opaque.erase( bucket );
}