20 Commits

Author SHA1 Message Date
Maksim Gamarnik
35770f4abb Merge Minetest 0.4.16 2017-06-06 23:03:34 +03:00
Dániel Juhász
fc3bfe1c00 Light update for map blocks
This is not really different from the light update of a voxel
manipulator. This update does not assume that the lighting was correct
before, therefore it is useful for correction.

Also expose this function to the Lua API for light correction, and
allow voxel manipulators not to update the light.
2017-04-20 05:39:14 +02:00
Dániel Juhász
17352c0172 Split light update into two parts
The common part can be reused.
2017-04-20 05:31:50 +02:00
Dániel Juhász
fe21088bca 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.
2017-03-11 02:06:18 +00:00
Dániel Juhász
3c4bd88430 Lighting: Update lighting at block loading
This commit updates mapblocks' light if necessary when they are loaded.
This removes ghost lighting.
2017-02-13 00:05:49 +00:00
Maksim Gamarnik
e05f7db82f Updated to Minetest ver. 0.4.15 2017-01-30 00:44:07 +02:00
Dániel Juhász
46aff27445 Improve getPointedThing() (#4346)
* Improved getPointedThing()

The new algorithm checks every node exactly once.
Now the point and normal vector of the collision is also returned in the
PointedThing (currently they are not used outside of the function).
Now the CNodeDefManager keeps the union of all possible nodeboxes, so
the raycast won't miss any nodes. Also if there are only small
nodeboxes, getPointedThing() is exceptionally fast.
Also adds unit test for VoxelLineIterator.

* Cleanup, code move

This commit moves getPointedThing() and
Client::getSelectedActiveObject() to ClientEnvironment.
The map nodes now can decide which neighbors they are connecting to
(MapNode::getNeighbors()).
2017-01-04 19:18:40 +01:00
juhdanad
7d7ad5aba4 Limit light_source in the engine (#4814)
Since light_source>15 causes crash, it must be limited.
2016-11-28 18:43:33 +10:00
Dániel Juhász
93e067c39e Cleanup 2016-10-27 08:04:42 +02:00
Dániel Juhász
703c121576 Use node lighting for liquid spreading
This commit modifies the liquid transforming procedure to light and
unlight nodes instead of whole map blocks.
2016-10-27 08:04:42 +02:00
Dániel Juhász
7f8545d2d7 Improved lighting
This commit rewrites the procedure that is responsible for light
updating.

this commit
-provides iterative solutions for unlighting and light spreading
-introduces a new priority queue-like container for the iteration
-creates per-node MapBlock caching to reduce retrieving MapBlocks from
the map
-calculates with map block positions and in-block relative node
coordinates
-skips light updating if it is not necessary since the node's new light
will be the same as its old light was
2016-10-27 08:04:42 +02:00
Maksim Gamarnik
9247f32e0e LGPL 2.1 to 3.0 on all files 2015-08-14 01:26:28 +03:00
sapier
552946e12a Remove emerge and speedup addArea by using memcopy instead of one by one assignment 2014-06-23 00:13:41 +02:00
Ilya Zhuravlev
a12df55f29 Migrate to STL containers/algorithms. 2013-03-11 19:08:39 -04:00
Sfan5
3fab3825aa Update Copyright Years 2013-02-24 20:15:24 +01:00
PilzAdam
269f01224b Change Minetest-c55 to Minetest 2013-02-24 18:49:03 +01:00
kwolekr
6df7f001e5 The new mapgen, noise functions, et al. 2013-01-21 21:41:33 +02:00
Perttu Ahola
e70b6545b1 Switch the license to be LGPLv2/later, with small parts still remaining as GPLv2/later, by agreement of major contributors 2012-06-05 18:54:07 +03:00
Perttu Ahola
17266c7fd2 voxalgo::clearLightAndCollectSources 2012-03-27 19:01:51 +03:00
Perttu Ahola
7bd2ea010c Implement propagateSunlight for VoxelManipulator 2012-03-27 19:01:50 +03:00