summaryrefslogtreecommitdiff
path: root/src/mapblock_mesh.h
diff options
context:
space:
mode:
authorDTA7 <dta7e@t-online.de>2017-10-03 01:23:49 +0200
committerparamat <mat.gregory@virginmedia.com>2017-10-10 19:53:13 +0100
commit2cf9014160085303cda333334784ac4938edc086 (patch)
tree328108961d24b8b710f5f17d2f0b78a8d68550e4 /src/mapblock_mesh.h
parent1ff5c204425401c83a8a4c662795be64c5a3c1df (diff)
downloadminetest-2cf9014160085303cda333334784ac4938edc086.tar.gz
minetest-2cf9014160085303cda333334784ac4938edc086.tar.bz2
minetest-2cf9014160085303cda333334784ac4938edc086.zip
Smooth lighting: Fix light leaking through edge-connected corners
For solid nodes, the lighting at a corner becomes face-dependent, which means that only the four nodes in face-direction contribute to the lighting (getSmoothLightSolid). For special nodes, which use the lighting values at the eight corners of a node, the lighting is not face-dependent, but certain nodes of the eight surrounding nodes of a corner (here indices 4, 5, 6 and 7) can be obstructed. Ambient occlusion now also occurs for solid nodes, if two, three or four of the four nodes in face-direction are solid.
Diffstat (limited to 'src/mapblock_mesh.h')
-rw-r--r--src/mapblock_mesh.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mapblock_mesh.h b/src/mapblock_mesh.h
index b4bfedb84..13cee537c 100644
--- a/src/mapblock_mesh.h
+++ b/src/mapblock_mesh.h
@@ -232,7 +232,8 @@ video::SColor encode_light(u16 light, u8 emissive_light);
// Compute light at node
u16 getInteriorLight(MapNode n, s32 increment, INodeDefManager *ndef);
u16 getFaceLight(MapNode n, MapNode n2, v3s16 face_dir, INodeDefManager *ndef);
-u16 getSmoothLight(v3s16 p, v3s16 corner, MeshMakeData *data);
+u16 getSmoothLightSolid(const v3s16 &p, const v3s16 &face_dir, const v3s16 &corner, MeshMakeData *data);
+u16 getSmoothLightTransparent(const v3s16 &p, const v3s16 &corner, MeshMakeData *data);
/*!
* Returns the sunlight's color from the current