Smooth lighting: Fix light leaking through edge-connected corners
authorDTA7 <dta7e@t-online.de>
Mon, 2 Oct 2017 23:23:49 +0000 (01:23 +0200)
committerparamat <mat.gregory@virginmedia.com>
Tue, 10 Oct 2017 18:53:13 +0000 (19:53 +0100)
commit2cf9014160085303cda333334784ac4938edc086
tree328108961d24b8b710f5f17d2f0b78a8d68550e4
parent1ff5c204425401c83a8a4c662795be64c5a3c1df
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.
src/content_mapblock.cpp
src/mapblock_mesh.cpp
src/mapblock_mesh.h