aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-02-03 14:50:49 +0200
committerPerttu Ahola <celeron55@gmail.com>2012-02-06 17:40:48 +0200
commit993821a92448bf3573ac56dbfe67ee4b54172d06 (patch)
tree8e98068e2ba5c73904b6bbe45b8673ef7b203890 /src
parentad5ac22442ce850ec1f9f1cfc3ca0f79fdf255f7 (diff)
downloadminetest-993821a92448bf3573ac56dbfe67ee4b54172d06.tar.gz
minetest-993821a92448bf3573ac56dbfe67ee4b54172d06.tar.bz2
minetest-993821a92448bf3573ac56dbfe67ee4b54172d06.zip
Tune brightness stuff and fog color
Diffstat (limited to 'src')
-rw-r--r--src/game.cpp29
1 files changed, 18 insertions, 11 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 530291862..670148a44 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -574,7 +574,7 @@ void update_skybox(video::IVideoDriver* driver, ITextureSource *tsrc,
if(g_settings->getBool("enable_farmesh"))
return;*/
- if(brightness >= 0.5)
+ if(brightness >= 0.7)
{
skybox = smgr->addSkyBoxSceneNode(
tsrc->getTextureRaw("skybox2.png"),
@@ -2117,14 +2117,21 @@ void the_game(
u32 daynight_ratio = client.getDayNightRatio();
u8 light8 = decode_light((daynight_ratio * LIGHT_SUN) / 1000);
brightness = (float)light8/255.0;
- video::SColor bgcolor = video::SColor(
- 255,
- bgcolor_bright.getRed() * brightness,
- bgcolor_bright.getGreen() * brightness,
- bgcolor_bright.getBlue() * brightness);
- /*skycolor.getRed() * brightness,
- skycolor.getGreen() * brightness,
- skycolor.getBlue() * brightness);*/
+ // Make night look good
+ brightness = brightness * 1.15 - 0.15;
+ video::SColor bgcolor;
+ if(brightness >= 0.2 && brightness < 0.7)
+ bgcolor = video::SColor(
+ 255,
+ bgcolor_bright.getRed() * brightness,
+ bgcolor_bright.getGreen() * brightness*0.7,
+ bgcolor_bright.getBlue() * brightness*0.5);
+ else
+ bgcolor = video::SColor(
+ 255,
+ bgcolor_bright.getRed() * brightness,
+ bgcolor_bright.getGreen() * brightness,
+ bgcolor_bright.getBlue() * brightness);
/*
Update skybox
@@ -2139,7 +2146,7 @@ void the_game(
{
clouds->step(dtime);
clouds->update(v2f(player_position.X, player_position.Z),
- 0.05+brightness*0.95);
+ brightness);
}
/*
@@ -2155,7 +2162,7 @@ void the_game(
farmesh->step(dtime);
farmesh->update(v2f(player_position.X, player_position.Z),
- 0.05+brightness*0.95, farmesh_range);
+ brightness, farmesh_range);
}
// Store brightness value