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:
@@ -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 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user