Skip to content

Commit e1842ed

Browse files
lhofhanslkwolekr
authored andcommittedOct 31, 2016
Optionally disable optimization that causes underwater and cave rendering glitches. (#4686)
1 parent 595932a commit e1842ed

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed
 

Diff for: ‎builtin/settingtypes.txt

+7
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,13 @@ liquid_queue_purge_time (Liquid queue purge time) int 0
849849
# Liquid update interval in seconds.
850850
liquid_update (Liquid update tick) float 1.0
851851

852+
# At this distance the server will aggressively optimize which blocks are sent to clients.
853+
# Small values potentially improve performance a lot, at the expense of visible rendering glitches.
854+
# (some blocks will not be rendered under water and in caves, as well as sometimes on land)
855+
# Setting this to a value greater than max_block_send_distance disables this optimization.
856+
# Stated in mapblocks (16 nodes)
857+
block_send_optimize_distance (block send optimize distance) int 4 2
858+
852859
[*Mapgen]
853860

854861
# Name of map generator to be used when creating a new world.

Diff for: ‎src/clientiface.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ void RemoteClient::GetNextBlocks (
174174
s32 new_nearest_unsent_d = -1;
175175

176176
const s16 full_d_max = g_settings->getS16("max_block_send_distance");
177+
const s16 d_opt = g_settings->getS16("block_send_optimize_distance");
178+
177179
s16 d_max = full_d_max;
178180
s16 d_max_gen = g_settings->getS16("max_block_generate_distance");
179181

@@ -300,7 +302,7 @@ void RemoteClient::GetNextBlocks (
300302
Block is near ground level if night-time mesh
301303
differs from day-time mesh.
302304
*/
303-
if(d >= 4)
305+
if(d >= d_opt)
304306
{
305307
if(block->getDayNightDiff() == false)
306308
continue;

Diff for: ‎src/defaultsettings.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ void set_default_settings(Settings *settings)
279279
settings->setDefault("max_simultaneous_block_sends_server_total", "40");
280280
settings->setDefault("max_block_send_distance", "9");
281281
settings->setDefault("max_block_generate_distance", "7");
282+
settings->setDefault("block_send_optimize_distance", "4");
282283
settings->setDefault("max_clearobjects_extra_loaded_blocks", "4096");
283284
settings->setDefault("time_send_interval", "5");
284285
settings->setDefault("time_speed", "72");

0 commit comments

Comments
 (0)
Please sign in to comment.