Fix Legacy GL causing fog to smear

This commit is contained in:
James Seibel
2024-08-20 17:44:38 -05:00
parent 1b162f10e6
commit 489b3d3ae1
@@ -167,6 +167,11 @@ public class FogShader extends AbstractShaderRenderer
GL32.glBindTexture(GL32.GL_TEXTURE_2D, LodRenderer.getActiveDepthTextureId());
GL32.glUniform1i(this.uDepthMap, 0);
// this is necessary for MC 1.16 (IE Legacy OpenGL)
// otherwise the framebuffer isn't cleared correctly and the fog smears across the screen
GL32.glClear(GL32.GL_COLOR_BUFFER_BIT | GL32.GL_DEPTH_BUFFER_BIT);
ScreenQuad.INSTANCE.render();
state.restore();