aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars <larsh@apache.org>2023-04-03 09:04:52 -0700
committerlhofhansl <larsh@apache.org>2023-04-03 13:57:05 -0700
commitb01f85d573b5366db9ab16afad4f4e191e46bea2 (patch)
tree35074bfef241dfa54a64bdc51e0e490f662b205f /src
parent1c1f1b161512fea8a04fade4db274fa11659bf68 (diff)
downloadminetest-b01f85d573b5366db9ab16afad4f4e191e46bea2.tar.xz
Revert "Add mesh-holding blocks to shadow drawlist. (#13203)"
This reverts commit 2a8becd650a8adaa86fd7f76122ea75f11f49dad.
Diffstat (limited to 'src')
-rw-r--r--src/client/clientmap.cpp24
1 files changed, 2 insertions, 22 deletions
diff --git a/src/client/clientmap.cpp b/src/client/clientmap.cpp
index 129689e9e..e50652ff4 100644
--- a/src/client/clientmap.cpp
+++ b/src/client/clientmap.cpp
@@ -1240,9 +1240,6 @@ void ClientMap::updateDrawListShadow(v3f shadow_light_pos, v3f shadow_light_dir,
// Number of blocks occlusion culled
u32 blocks_occlusion_culled = 0;
- std::set<v3s16> shortlist;
- MeshGrid mesh_grid = m_client->getMeshGrid();
-
for (auto &sector_it : m_sectors) {
MapSector *sector = sector_it.second;
if (!sector)
@@ -1256,8 +1253,8 @@ void ClientMap::updateDrawListShadow(v3f shadow_light_pos, v3f shadow_light_dir,
Loop through blocks in sector
*/
for (MapBlock *block : sectorblocks) {
- if (mesh_grid.cell_size == 1 && !block->mesh) {
- // fast out in the case of no mesh chunking
+ if (!block->mesh) {
+ // Ignore if mesh doesn't exist
continue;
}
@@ -1266,17 +1263,6 @@ void ClientMap::updateDrawListShadow(v3f shadow_light_pos, v3f shadow_light_dir,
if (projection.getDistanceFrom(block_pos) > radius)
continue;
- if (mesh_grid.cell_size > 1) {
- // Block meshes are stored in the corner block of a chunk
- // (where all coordinate are divisible by the chunk size)
- // Add them to the de-dup set.
- shortlist.emplace(mesh_grid.getMeshPos(block->getPos()));
- }
- if (!block->mesh) {
- // Ignore if mesh doesn't exist
- continue;
- }
-
blocks_in_range_with_mesh++;
// This block is in range. Reset usage timer.
@@ -1288,12 +1274,6 @@ void ClientMap::updateDrawListShadow(v3f shadow_light_pos, v3f shadow_light_dir,
}
}
}
- for (auto pos : shortlist) {
- MapBlock * block = getBlockNoCreateNoEx(pos);
- if (block && block->mesh && m_drawlist_shadow.emplace(pos, block).second) {
- block->refGrab();
- }
- }
g_profiler->avg("SHADOW MapBlock meshes in range [#]", blocks_in_range_with_mesh);
g_profiler->avg("SHADOW MapBlocks occlusion culled [#]", blocks_occlusion_culled);