OpenCubicChunks / CubicChunks2

Infinite* height mod for Minecraft - rewrite for versions above 1.12
MIT License
72 stars 21 forks source link

Fix strange weather rendering at high altitudes #102

Closed BelgianSalamander closed 2 years ago

BelgianSalamander commented 2 years ago

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. 2022-04-08_18 30 09 2022-04-08_18 30 24

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. 2022-04-08_18 31 24

NotStirred commented 2 years ago

could you run generateMixinConfigs? it looks like there is a client mixin in the common config

Otherwise lgtm