Skip to content

Commit

Permalink
Fix non-smooth non-shader node shading (Fixes #1436, regression by co…
Browse files Browse the repository at this point in the history
…mmit a0f7865)
  • Loading branch information
celeron55 committed Jul 6, 2014
1 parent eadde1e commit 9b44bbd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/mapblock_mesh.cpp
Expand Up @@ -1293,6 +1293,7 @@ bool MapBlockMesh::animate(bool faraway, float time, int crack, u32 daynight_rat
bool enable_shaders = g_settings->getBool("enable_shaders");
bool enable_bumpmapping = g_settings->getBool("enable_bumpmapping");
bool enable_parallax_occlusion = g_settings->getBool("enable_parallax_occlusion");
bool smooth_lighting = g_settings->getBool("smooth_lighting");

if(!m_has_animation)
{
Expand Down Expand Up @@ -1406,6 +1407,9 @@ bool MapBlockMesh::animate(bool faraway, float time, int crack, u32 daynight_rat
u8 night = j->second.second;
finalColorBlend(vertices[vertexIndex].Color,
day, night, daynight_ratio);
// If no smooth lighting, shading is already correct
if(!smooth_lighting)
continue;
// Make sides and bottom darker than the top
video::SColor &vc = vertices[vertexIndex].Color;
if(vertices[vertexIndex].Normal.Y > 0.5) {
Expand Down

0 comments on commit 9b44bbd

Please sign in to comment.