Float-Precision issues on extreme distances from 0,0
WenXin20 opened this issue ยท 5 comments
Kind of related (and copied from Discord):
Ok so there's two different "symptoms" that start happening at different distances:
-
The tiles start "shaking" slightly when rotating or tilting the camera
This starts very early at around 100k but only very slightly. At 200k-300k it is easily noticeable especially when zoomed in. At really high coordinates, tiles start flickering randomly. -
The camera starts "jumping" instead of moving smoothly
Starts at around 500k and gets really bad at around 1m-2m.
(Tested with Firefox on Bluemap Spigot 1.3.1 with a mod that allows for an infinite repeating hires map)
This is just a guess but I believe that the 3D engine for the WebGL is using floating-point so as we go further out the precision worsens. So my opinion is to use a local cord system based on the current position of the camera or find a BigInt implementation for WebGL.