From 2d7e0d8b212cb9f3802aa2d2996a0238f112a2bd Mon Sep 17 00:00:00 2001 From: James Seibel Date: Wed, 8 Nov 2023 19:38:01 -0600 Subject: [PATCH] cleanup DhApplyShader --- .../renderer/shaders/DhApplyShader.java | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/shaders/DhApplyShader.java b/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/shaders/DhApplyShader.java index 256f6b3fe..ea89091a4 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/shaders/DhApplyShader.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/shaders/DhApplyShader.java @@ -41,10 +41,6 @@ public class DhApplyShader extends AbstractShaderRenderer public int gDhColorTextureUniform; public int gDepthMapUniform; - public int tempFramebufferId; - public int tempColorTextureId; - public int tempDepthTextureId; - private DhApplyShader() { } @@ -62,28 +58,26 @@ public class DhApplyShader extends AbstractShaderRenderer this.gDhColorTextureUniform = this.shader.getUniformLocation("gDhColorTexture"); this.gDepthMapUniform = this.shader.getUniformLocation("gDhDepthTexture"); - this.tempFramebufferId = GL32.glGenFramebuffers(); - this.tempColorTextureId = GL32.glGenTextures(); - this.tempDepthTextureId = GL32.glGenTextures(); - } @Override - protected void onApplyUniforms(float partialTicks) - { - - } + protected void onApplyUniforms(float partialTicks) { } //========// // render // //========// - private boolean texturesCreated = false; - @Override protected void onRender() { + int targetFrameBuffer = MC_RENDER.getTargetFrameBuffer(); + if (targetFrameBuffer == -1) + { + return; + } + + GL32.glDisable(GL32.GL_DEPTH_TEST); GL32.glEnable(GL32.GL_BLEND); @@ -99,8 +93,9 @@ public class DhApplyShader extends AbstractShaderRenderer GL32.glUniform1i(this.gDepthMapUniform, 1); // Copy to MC's framebuffer - GL32.glBindFramebuffer(GL32.GL_FRAMEBUFFER, MC_RENDER.getTargetFrameBuffer()); + GL32.glBindFramebuffer(GL32.GL_FRAMEBUFFER, targetFrameBuffer); ScreenQuad.INSTANCE.render(); } + }