Fix debug renderer rendering on top of LODs

This commit is contained in:
James Seibel
2024-01-13 22:14:10 -06:00
parent 9e63f7ed4d
commit 7507cf98a7
2 changed files with 7 additions and 14 deletions
@@ -190,19 +190,13 @@ public class DebugRenderer
{
this.transformThiFrame = transform;
Vec3d camPos = MC_RENDER.getCameraExactPosition();
camPosFloatThisFrame = new Vec3f((float) camPos.x, (float) camPos.y, (float) camPos.z);
this.camPosFloatThisFrame = new Vec3f((float) camPos.x, (float) camPos.y, (float) camPos.z);
GLState glState = new GLState();
this.init();
GL32.glBindFramebuffer(GL32.GL_FRAMEBUFFER, MC_RENDER.getTargetFrameBuffer());
GL32.glViewport(0, 0, MC_RENDER.getTargetFrameBufferViewportWidth(), MC_RENDER.getTargetFrameBufferViewportHeight());
GL32.glPolygonMode(GL32.GL_FRONT_AND_BACK, GL32.GL_LINE);
//GL32.glLineWidth(2);
GL32.glEnable(GL32.GL_DEPTH_TEST);
GL32.glDisable(GL32.GL_STENCIL_TEST);
GL32.glDisable(GL32.GL_BLEND);
GL32.glDisable(GL32.GL_SCISSOR_TEST);
this.basicShader.bind();
this.va.bind();
@@ -440,6 +440,12 @@ public class LodRenderer
FogShader.INSTANCE.render(partialTicks);
}
if (Config.Client.Advanced.Debugging.DebugWireframe.enableRendering.get())
{
profiler.popPush("Debug wireframes");
// Note: this can be very slow if a lot of boxes are being rendered
DebugRenderer.INSTANCE.render(modelViewProjectionMatrix);
}
if (this.usingMcFrameBuffer)
{
@@ -482,13 +488,6 @@ public class LodRenderer
this.shaderProgram.unbind();
if (Config.Client.Advanced.Debugging.DebugWireframe.enableRendering.get())
{
profiler.popPush("Debug wireframes");
// Note: this can be very slow if a lot of boxes are being rendered
DebugRenderer.INSTANCE.render(modelViewProjectionMatrix);
profiler.popPush("LOD cleanup");
}
minecraftGlState.restore();
drawCleanup.end("LodDrawCleanup");