[Suggestion] Fix Terrain Animation Lag
Lodugh opened this issue ยท 5 comments
I dont know whether you heard of it but it is a common Problem: https://www.reddit.com/r/Minecraft/comments/6cj308/10_fps_to_60_fps_lag_disappears_with_one_click/
You probably dont notice with very good computers but there are many who suffer from that since 1.10 or even before.
Nobody knows where it comes from but maybe you have an idea how to fix it? I would like to still have terrain animations for modded fluids and machines. Would be great if you would look into it! If you dont want to, just close this issue. Keep up the great work with your mod :).
The issue here is that, if your texture atlas is too large it will significantly reduce your fps.
The reason for this is because the atlas is remade and re-uploaded to your graphics card every tick. The way that minecraft handles animations is so that older machines are that don't have a newer version of OpenGL will still run the game. Integrated graphics don't suffer from this issue because the video memory and the system memory are shared and the atlas doesn't have to be uploaded to the video memory from the system memory, so if you have even one animated texture in a large atlas it will drop your fps.
Just found out that asie writes something about that on his modsite of FoamFix http://asie.pl/Projects/Minecraft/Mods/FoamFix/ . "disabling mipmaps (setting Mipmap Levels to 0) will boost FPS considerably. This is due to lag caused by animated texture updates being much higher with increasing amounts of textures to update, which scales linearly with the amount of mipmap levels." . Just tried it out and it made the lag disappear just like turning off Terrain Animations with Optifine. But it doesnt look very great.. However on his TODO it says "Figure out how to optimize animated texture updates properly" so he is probably working on the problem already. I guess this issue can be closed but maybe you wanna work on it too? :)
Thanks for the suggestion. I'll look into it and see what I can improve in the game's code