From b8f5e4553b6e81dd229d6aef087c3b089879dddd Mon Sep 17 00:00:00 2001 From: Paint_Ninja Date: Sat, 26 Oct 2024 20:24:18 +0100 Subject: [PATCH] Remove redundant rendering options (#10140) --- .../blaze3d/pipeline/RenderTarget.java.patch | 13 ++------ .../client/renderer/LevelRenderer.java.patch | 9 ------ .../client/ForgeHooksClient.java | 2 +- .../minecraftforge/common/ForgeConfig.java | 31 ------------------- 4 files changed, 4 insertions(+), 51 deletions(-) diff --git a/patches/minecraft/com/mojang/blaze3d/pipeline/RenderTarget.java.patch b/patches/minecraft/com/mojang/blaze3d/pipeline/RenderTarget.java.patch index bcd842bc68..80357dbf48 100644 --- a/patches/minecraft/com/mojang/blaze3d/pipeline/RenderTarget.java.patch +++ b/patches/minecraft/com/mojang/blaze3d/pipeline/RenderTarget.java.patch @@ -11,18 +11,11 @@ } this.setFilterMode(9728, true); -@@ -106,8 +_,13 @@ - GlStateManager._texImage2D(3553, 0, 32856, this.width, this.height, 0, 6408, 5121, null); - GlStateManager._glBindFramebuffer(36160, this.frameBufferId); +@@ -108,6 +_,7 @@ GlStateManager._glFramebufferTexture2D(36160, 36064, 3553, this.colorTextureId, 0); -- if (this.useDepth) { -+ if (this.useDepth && !stencilEnabled) { + if (this.useDepth) { GlStateManager._glFramebufferTexture2D(36160, 36096, 3553, this.depthBufferId, 0); -+ } else if(this.useDepth && net.minecraftforge.common.ForgeConfig.CLIENT.useCombinedDepthStencilAttachment.get()) { -+ GlStateManager._glFramebufferTexture2D(org.lwjgl.opengl.GL30.GL_FRAMEBUFFER, org.lwjgl.opengl.GL30.GL_DEPTH_STENCIL_ATTACHMENT, 3553, this.depthBufferId, 0); -+ } else if (this.useDepth) { -+ GlStateManager._glFramebufferTexture2D(org.lwjgl.opengl.GL30.GL_FRAMEBUFFER, org.lwjgl.opengl.GL30.GL_DEPTH_ATTACHMENT, 3553, this.depthBufferId, 0); -+ GlStateManager._glFramebufferTexture2D(org.lwjgl.opengl.GL30.GL_FRAMEBUFFER, org.lwjgl.opengl.GL30.GL_STENCIL_ATTACHMENT, 3553, this.depthBufferId, 0); ++ if (stencilEnabled) GlStateManager._glFramebufferTexture2D(org.lwjgl.opengl.GL30.GL_FRAMEBUFFER, org.lwjgl.opengl.GL30.GL_STENCIL_ATTACHMENT, 3553, this.depthBufferId, 0); } this.checkStatus(); diff --git a/patches/minecraft/net/minecraft/client/renderer/LevelRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/LevelRenderer.java.patch index e84d6d70f8..43bfd3479e 100644 --- a/patches/minecraft/net/minecraft/client/renderer/LevelRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/LevelRenderer.java.patch @@ -177,15 +177,6 @@ } } -@@ -1112,7 +_,7 @@ - boolean flag = false; - if (this.minecraft.options.prioritizeChunkUpdates().get() == PrioritizeChunkUpdates.NEARBY) { - BlockPos blockpos1 = sectionrenderdispatcher$rendersection.getOrigin().offset(8, 8, 8); -- flag = blockpos1.distSqr(blockpos) < 768.0 || sectionrenderdispatcher$rendersection.isDirtyFromPlayer(); -+ flag = !net.minecraftforge.common.ForgeConfig.CLIENT.alwaysSetupTerrainOffThread.get() && (blockpos1.distSqr(blockpos) < 768.0D || sectionrenderdispatcher$rendersection.isDirtyFromPlayer()); // the target is the else block below, so invert the forge addition to get there early - } else if (this.minecraft.options.prioritizeChunkUpdates().get() == PrioritizeChunkUpdates.PLAYER_AFFECTED) { - flag = sectionrenderdispatcher$rendersection.isDirtyFromPlayer(); - } @@ -1391,7 +_,7 @@ } else { int i = p_109538_.getBrightness(LightLayer.SKY, p_109540_); diff --git a/src/main/java/net/minecraftforge/client/ForgeHooksClient.java b/src/main/java/net/minecraftforge/client/ForgeHooksClient.java index 48af06fb7a..48cc0b1b3e 100644 --- a/src/main/java/net/minecraftforge/client/ForgeHooksClient.java +++ b/src/main/java/net/minecraftforge/client/ForgeHooksClient.java @@ -447,7 +447,7 @@ public class ForgeHooksClient { // TODO Do we need this? public static void fillNormal(int[] faceData, Direction facing, boolean calculateNormals) { Vector3f v2; - if (calculateNormals || ForgeConfig.CLIENT.calculateAllNormals()) { + if (calculateNormals) { Vector3f v1 = getVertexPos(faceData, 3); Vector3f t1 = getVertexPos(faceData, 1); v2 = getVertexPos(faceData, 2); diff --git a/src/main/java/net/minecraftforge/common/ForgeConfig.java b/src/main/java/net/minecraftforge/common/ForgeConfig.java index 8aab1b1f11..8c8ab4a2a9 100644 --- a/src/main/java/net/minecraftforge/common/ForgeConfig.java +++ b/src/main/java/net/minecraftforge/common/ForgeConfig.java @@ -94,27 +94,14 @@ public class ForgeConfig { * Client specific configuration - only loaded clientside from forge-client.toml */ public static class Client { - public final BooleanValue alwaysSetupTerrainOffThread; - public final BooleanValue experimentalForgeLightPipelineEnabled; public final BooleanValue showLoadWarnings; - public final BooleanValue useCombinedDepthStencilAttachment; - - public final BooleanValue calculateAllNormals; - Client(ForgeConfigSpec.Builder builder) { builder.comment("Client only settings, mostly things related to rendering") .push("client"); - alwaysSetupTerrainOffThread = builder - .comment("Enable Forge to queue all chunk updates to the Chunk Update thread.", - "May increase FPS significantly, but may also cause weird rendering lag.", - "Not recommended for computers without a significant number of cores available.") - .translation("forge.configgui.alwaysSetupTerrainOffThread") - .define("alwaysSetupTerrainOffThread", false); - experimentalForgeLightPipelineEnabled = builder .comment("EXPERIMENTAL: Enable the Forge block rendering pipeline - fixes the lighting of custom models.") .translation("forge.configgui.forgeLightPipelineEnabled") @@ -125,29 +112,11 @@ public class ForgeConfig { .translation("forge.configgui.showLoadWarnings") .define("showLoadWarnings", true); - useCombinedDepthStencilAttachment = builder - .comment("Set to true to use a combined DEPTH_STENCIL attachment instead of two separate ones.") - .translation("forge.configgui.useCombinedDepthStencilAttachment") - .define("useCombinedDepthStencilAttachment", false); - - calculateAllNormals = builder - .comment("During block model baking, manually calculates the normal for all faces.", - "This was the default behavior of forge between versions 31.0 and 47.1.", - "May result in differences between vanilla rendering and forge rendering.", - "Will only produce differences for blocks that contain non-axis aligned faces.", - "You will need to reload your resources to see results.") - .translation("forge.configgui.calculateAllNormals") - .define("calculateAllNormals", false); - builder.pop(); } // Allow these to be called before the config is loaded because its used before loading the error screens. // Prevents a ton of spam when an error screen is displayed. - public final boolean calculateAllNormals() { - return clientSpec.isLoaded() ? calculateAllNormals.get() : calculateAllNormals.getDefault(); - } - public final boolean showLoadWarnings() { return clientSpec.isLoaded() ? showLoadWarnings.get() : showLoadWarnings.getDefault(); }