1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Light calculation: New bulk node lighting code

This commit introduces a new bulk node lighting algorithm to minimize
lighting bugs during l-system tree generation, schematic placement and
non-mapgen-object lua voxelmanip light calculation.

If the block above the changed area is not loaded, it gets loaded to avoid
lighting bugs.
Light is updated as soon as write_to_map is called on a voxel manipulator,
therefore update_map does nothing.
This commit is contained in:
Dániel Juhász 2016-12-10 19:02:44 +01:00 committed by paramat
parent d785456b3f
commit ab371cc934
10 changed files with 408 additions and 636 deletions

View file

@ -26,7 +26,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "util/cpp11_container.h"
class Map;
class ServerMap;
class MapBlock;
class MMVManip;
namespace voxalgo
{
@ -84,6 +86,17 @@ void update_lighting_nodes(
void update_block_border_lighting(Map *map, MapBlock *block,
std::map<v3s16, MapBlock*> &modified_blocks);
/*!
* Copies back nodes from a voxel manipulator
* to the map and updates lighting.
* For server use only.
*
* \param modified_blocks output, contains all map blocks that
* the function modified
*/
void blit_back_with_light(ServerMap *map, MMVManip *vm,
std::map<v3s16, MapBlock*> *modified_blocks);
/*!
* This class iterates trough voxels that intersect with
* a line. The collision detection does not see nodeboxes,