summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Hofhansl <larsh@apache.org>2017-07-10 06:43:06 -0700
committerparamat <mat.gregory@virginmedia.com>2017-07-18 22:16:41 +0100
commit5045bdc6d81445ecf600ff9c268886cada935a7f (patch)
treeceef60410941e338e675da5b7f1b711ac3416ff1
parent5f37efbec4d5b46cce8dbf7dc76cd1332b50d56a (diff)
downloadminetest-5045bdc6d81445ecf600ff9c268886cada935a7f.tar.gz
minetest-5045bdc6d81445ecf600ff9c268886cada935a7f.tar.bz2
minetest-5045bdc6d81445ecf600ff9c268886cada935a7f.zip
In-cloud fog: Strengthen effect when small view range is used
Ensure in-cloud fog is always stronger than outside-of-cloud-fog even when using a small view range. Also limit in-cloud fog range to a maximum of 32 nodes to keep it fairly strong when using a large view range.
-rw-r--r--src/game.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 71c410c8a..ba4840203 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -20,6 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "game.h"
#include <iomanip>
+#include <cmath>
#include "client/renderingengine.h"
#include "camera.h"
#include "client.h"
@@ -4124,7 +4125,7 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime,
.getInterpolated(video::SColor(255, 0, 0, 0), 0.9);
sky->overrideColors(clouds_dark, clouds->getColor());
sky->setBodiesVisible(false);
- runData.fog_range = 20.0f * BS;
+ runData.fog_range = std::fmin(runData.fog_range * 0.5f, 32.0f * BS);
// do not draw clouds after all
clouds->setVisible(false);
}