From: Perttu Ahola Date: Sun, 6 Jul 2014 18:57:12 +0000 (+0300) Subject: Fix non-smooth non-shader node shading (Fixes #1436, regression by commit a0f78659f31abd) X-Git-Tag: 0.4.10~5 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9b44bbd0a6236019b0c4f32156baa513f9674431;p=oweals%2Fminetest.git Fix non-smooth non-shader node shading (Fixes #1436, regression by commit a0f78659f31abd) --- diff --git a/src/mapblock_mesh.cpp b/src/mapblock_mesh.cpp index 21d431cd1..22b56a15c 100644 --- a/src/mapblock_mesh.cpp +++ b/src/mapblock_mesh.cpp @@ -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) { @@ -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) {