]> git.lizzy.rs Git - minetest.git/commitdiff
Optionally disable optimization that causes underwater and cave rendering glitches...
authorlhofhansl <lhofhansl@yahoo.com>
Mon, 31 Oct 2016 03:35:55 +0000 (20:35 -0700)
committerkwolekr <kwolekr@minetest.net>
Mon, 31 Oct 2016 03:35:55 +0000 (23:35 -0400)
builtin/settingtypes.txt
src/clientiface.cpp
src/defaultsettings.cpp

index 492d7c79dae798aa6a007c4c411671fe02277c96..e48fc9bc5e6d8acaac98a7719079ad4ea92862bd 100644 (file)
@@ -849,6 +849,13 @@ liquid_queue_purge_time (Liquid queue purge time) int 0
 #    Liquid update interval in seconds.
 liquid_update (Liquid update tick) float 1.0
 
+#    At this distance the server will aggressively optimize which blocks are sent to clients.
+#    Small values potentially improve performance a lot, at the expense of visible rendering glitches.
+#    (some blocks will not be rendered under water and in caves, as well as sometimes on land)
+#    Setting this to a value greater than max_block_send_distance disables this optimization.
+#    Stated in mapblocks (16 nodes)
+block_send_optimize_distance (block send optimize distance) int 4 2
+
 [*Mapgen]
 
 #    Name of map generator to be used when creating a new world.
index d2e3a6da08823f487dfd36c7a64c38aa4f9dc859..7dce77cd7cfe7e3801b12ed4ce3a8ddf0dd7d9f6 100644 (file)
@@ -174,6 +174,8 @@ void RemoteClient::GetNextBlocks (
        s32 new_nearest_unsent_d = -1;
 
        const s16 full_d_max = g_settings->getS16("max_block_send_distance");
+       const s16 d_opt = g_settings->getS16("block_send_optimize_distance");
+
        s16 d_max = full_d_max;
        s16 d_max_gen = g_settings->getS16("max_block_generate_distance");
 
@@ -300,7 +302,7 @@ void RemoteClient::GetNextBlocks (
                                        Block is near ground level if night-time mesh
                                        differs from day-time mesh.
                                */
-                               if(d >= 4)
+                               if(d >= d_opt)
                                {
                                        if(block->getDayNightDiff() == false)
                                                continue;
index a64840a8fde68de9532de8cfb4cc750a643e103f..2cb57532d2c9e68c7284ceeb299e7333b7cd2295 100644 (file)
@@ -279,6 +279,7 @@ void set_default_settings(Settings *settings)
        settings->setDefault("max_simultaneous_block_sends_server_total", "40");
        settings->setDefault("max_block_send_distance", "9");
        settings->setDefault("max_block_generate_distance", "7");
+       settings->setDefault("block_send_optimize_distance", "4");
        settings->setDefault("max_clearobjects_extra_loaded_blocks", "4096");
        settings->setDefault("time_send_interval", "5");
        settings->setDefault("time_speed", "72");