Also added a function that has extensive details about what the
projection options mean, and set our near plane much closer (0.25 to
0.0625) and far plane much farther (100000.25 to 524288.0625). In the
future we may completely remove the far plane (opting for an infinite
one) and may possibly improve accuracy elsewhere using analysis of other
floating point values.
Firstly, most importantly, improves the heuristic used for deciding
which chunks to mesh (which matters more even at low view distances
with meshing being so expensive now, but has an even more obvious
improvement at large view distances). Essentially, instead of always
prioritizing whatever chunk was fetched earliest from the server,
instead we prioritize chunks *closest* to the player first, then chunk
order.
This greatly improves the apparent latency for things like
picking up a sprite, as well as cases where the player moves out of the
loaded range but (due to slow loading from the server or a large VD
range) there are many remaining chunks left to be meshed still within
the VD but nowhere near the player. By properly priotizing chunks near
the player, we minimize the time / likelihood of a player being on or
very near an unmeshed chunk, and make high VDs and faster travel
speeds more viable.
We make a few other minor improvements as well:
Avoid duplicate meshing of neighbors when first inserting chunks, if
they are already in the todo list and the chunk being inserted was not
directly modified.
Also avoid remeshing neighbors if only a solid block's color changed,
which could sometimes be useful for non-sprite modifications (for
example flame-induced changes to non-destructible terrain color).
The previous fix accidentally caused meshing to not perform an update if
a chunk was already actively meshing; this change fixes this behavior to
go back to the old behavior. It also fixes a subtle bug where sprites
would be using old lighting if a chunk was being actively meshed on the
same tick that a sprite change happened (this should only affect things
in a handful of circumstances and could be avoided if, e.g., only color
was changing, but this can be addressed better at another time).
This results in an extremely visually noticeable improvement in latency
when adding or removing sprite data and makes the game feel more
responsive.
This happens, for instance, when picking up a sprite like an apple or
flower from the environment. We check to make sure that for items
with lighting (like Velorite) or changes that otherwise affect meshing
(like changing from fluid to nonfluid) this doesn't trigger.