diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-03-28 12:19:25 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-03-28 12:19:25 +0300 |
commit | 07e5c9bd5fb2cc5c660c208886b7033d8dd21979 (patch) | |
tree | 1b07e3273441232bb37dd3dcb190262f4ed5c3f1 | |
parent | 49c2ca02160bd387e04027a0d14c4c3b4a2da469 (diff) | |
download | minetest-07e5c9bd5fb2cc5c660c208886b7033d8dd21979.tar.gz minetest-07e5c9bd5fb2cc5c660c208886b7033d8dd21979.tar.bz2 minetest-07e5c9bd5fb2cc5c660c208886b7033d8dd21979.zip |
No occlusion culling when free_move is on and camera is inside ground
-rw-r--r-- | src/clientmap.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/clientmap.cpp b/src/clientmap.cpp index 23fe44186..3899041a9 100644 --- a/src/clientmap.cpp +++ b/src/clientmap.cpp @@ -324,6 +324,16 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass) Occlusion culling */ + // No occlusion culling when free_move is on and camera is + // inside ground + bool occlusion_culling_enabled = true; + if(g_settings->getBool("free_move")){ + MapNode n = getNodeNoEx(cam_pos_nodes); + if(n.getContent() == CONTENT_IGNORE || + nodemgr->get(n).solidness == 2) + occlusion_culling_enabled = false; + } + v3s16 cpn = block->getPos() * MAP_BLOCKSIZE; cpn += v3s16(MAP_BLOCKSIZE/2, MAP_BLOCKSIZE/2, MAP_BLOCKSIZE/2); float step = BS*1; @@ -334,6 +344,7 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass) s16 bs2 = MAP_BLOCKSIZE/2 + 1; u32 needed_count = 1; if( + occlusion_culling_enabled && isOccluded(this, spn, cpn + v3s16(0,0,0), step, stepfac, startoff, endoff, needed_count, nodemgr) && isOccluded(this, spn, cpn + v3s16(bs2,bs2,bs2), |