summaryrefslogtreecommitdiff
path: root/src/mapblock_mesh.cpp
diff options
context:
space:
mode:
authorRealBadAngel <maciej.kasatkin@o2.pl>2014-12-06 22:13:31 +0100
committerRealBadAngel <maciej.kasatkin@o2.pl>2014-12-07 11:05:00 +0100
commit535c473103752627f1912be4b5c8d58529abcd7e (patch)
treecc73e7f6b74137923b754b9b9b1a7775216d80a1 /src/mapblock_mesh.cpp
parent500f69142689d2646745d1b6a48187e913b452ac (diff)
downloadminetest-535c473103752627f1912be4b5c8d58529abcd7e.tar.gz
minetest-535c473103752627f1912be4b5c8d58529abcd7e.tar.bz2
minetest-535c473103752627f1912be4b5c8d58529abcd7e.zip
Restore finalColorBlend implementation in shaders.
Diffstat (limited to 'src/mapblock_mesh.cpp')
-rw-r--r--src/mapblock_mesh.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/mapblock_mesh.cpp b/src/mapblock_mesh.cpp
index e4c561a64..0ca24a1f9 100644
--- a/src/mapblock_mesh.cpp
+++ b/src/mapblock_mesh.cpp
@@ -1162,12 +1162,16 @@ MapBlockMesh::MapBlockMesh(MeshMakeData *data, v3s16 camera_offset):
applyFacesShading (vc, 0.836660);
}
}
- // - Classic lighting
- // Set initial real color and store for later updates
- u8 day = vc.getRed();
- u8 night = vc.getGreen();
- finalColorBlend(vc, day, night, 1000);
- m_daynight_diffs[i][j] = std::make_pair(day, night);
+ if(!m_enable_shaders)
+ {
+ // - Classic lighting (shaders handle this by themselves)
+ // Set initial real color and store for later updates
+ u8 day = vc.getRed();
+ u8 night = vc.getGreen();
+ finalColorBlend(vc, day, night, 1000);
+ if(day != night)
+ m_daynight_diffs[i][j] = std::make_pair(day, night);
+ }
}
// Create material
@@ -1331,7 +1335,7 @@ bool MapBlockMesh::animate(bool faraway, float time, int crack, u32 daynight_rat
}
// Day-night transition
- if(daynight_ratio != m_last_daynight_ratio)
+ if(!m_enable_shaders && (daynight_ratio != m_last_daynight_ratio))
{
for(std::map<u32, std::map<u32, std::pair<u8, u8> > >::iterator
i = m_daynight_diffs.begin();