Skip to content

Commit 9b44bbd

Browse files
committedJul 6, 2014
Fix non-smooth non-shader node shading (Fixes #1436, regression by commit a0f7865)
1 parent eadde1e commit 9b44bbd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎src/mapblock_mesh.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -1293,6 +1293,7 @@ bool MapBlockMesh::animate(bool faraway, float time, int crack, u32 daynight_rat
12931293
bool enable_shaders = g_settings->getBool("enable_shaders");
12941294
bool enable_bumpmapping = g_settings->getBool("enable_bumpmapping");
12951295
bool enable_parallax_occlusion = g_settings->getBool("enable_parallax_occlusion");
1296+
bool smooth_lighting = g_settings->getBool("smooth_lighting");
12961297

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

0 commit comments

Comments
 (0)
Please sign in to comment.