Above a few 10000 blocks, the rendering of rain and snow starts degenerating. (Although in normal circumstances, only snow would happen at those heights). The textures become jittery and the snow would suddenly "jump" up and down. At very high altitudes it becomes horreneous. Below are images at y = 50000 and y = 1000000.
This is due to the fact that the y-coordinate of the player contributes to the uv (specifically v coordinates). At some point they are turned to a float and precision is lost, causing the jumps. OpenGL also seems to have a hard time with the very large UV coordinates and the texture wrapping degenerates.
This PR fixes those issues by wrapping those values to a small range (-256 to 256) before they are turned to floats and used as UVs. Below is snow at y=1000000 after theses changes.
Above a few 10000 blocks, the rendering of rain and snow starts degenerating. (Although in normal circumstances, only snow would happen at those heights). The textures become jittery and the snow would suddenly "jump" up and down. At very high altitudes it becomes horreneous. Below are images at y = 50000 and y = 1000000.
This is due to the fact that the y-coordinate of the player contributes to the uv (specifically v coordinates). At some point they are turned to a float and precision is lost, causing the jumps. OpenGL also seems to have a hard time with the very large UV coordinates and the texture wrapping degenerates.
This PR fixes those issues by wrapping those values to a small range (-256 to 256) before they are turned to floats and used as UVs. Below is snow at y=1000000 after theses changes.