diff --git a/Fabric/src/main/java/vazkii/botania/fabric/FiberBotaniaConfig.java b/Fabric/src/main/java/vazkii/botania/fabric/FiberBotaniaConfig.java index 2f447d77e0..21fe808056 100644 --- a/Fabric/src/main/java/vazkii/botania/fabric/FiberBotaniaConfig.java +++ b/Fabric/src/main/java/vazkii/botania/fabric/FiberBotaniaConfig.java @@ -87,6 +87,7 @@ private static class Client implements BotaniaConfig.ClientConfigAccess { public final PropertyMirror referencesEnabled = PropertyMirror.create(BOOLEAN); public final PropertyMirror splashesEnabled = PropertyMirror.create(BOOLEAN); public final PropertyMirror useShaders = PropertyMirror.create(BOOLEAN); + public final PropertyMirror opaqueParticles = PropertyMirror.create(BOOLEAN); public ConfigTree configure(ConfigTreeBuilder builder) { builder.fork("rendering") @@ -94,6 +95,10 @@ public ConfigTree configure(ConfigTreeBuilder builder) { .withComment("Set this to false to disable the use of shaders for some of the mod's renders. (Requires game restart)") .finishValue(useShaders::mirror) + .beginValue("opaqueParticles", BOOLEAN, false) + .withComment("Set this to true to disable translucent particles, for shader compatibility with some shaders which implement a deferred lighting pass. (Enabling without shaders may impact aesthetics)") + .finishValue(opaqueParticles::mirror) + .beginValue("boundBlockWireframe", BOOLEAN, true) .withComment("Set this to false to disable the wireframe when looking a block bound to something (spreaders, flowers, etc).") .finishValue(boundBlockWireframe::mirror) @@ -252,6 +257,12 @@ public boolean splashesEnabled() { public boolean useShaders() { return this.useShaders.getValue(); } + + @Override + public boolean opaqueParticles() { + return this.useShaders.getValue(); + } + } private static final Client CLIENT = new Client(); diff --git a/Forge/src/main/java/vazkii/botania/forge/ForgeBotaniaConfig.java b/Forge/src/main/java/vazkii/botania/forge/ForgeBotaniaConfig.java index 33264404c0..c25efed991 100644 --- a/Forge/src/main/java/vazkii/botania/forge/ForgeBotaniaConfig.java +++ b/Forge/src/main/java/vazkii/botania/forge/ForgeBotaniaConfig.java @@ -30,6 +30,7 @@ public final class ForgeBotaniaConfig { private static class Client implements BotaniaConfig.ClientConfigAccess { public final ForgeConfigSpec.BooleanValue useShaders; + public final ForgeConfigSpec.BooleanValue opaqueParticles; public final ForgeConfigSpec.BooleanValue lexiconRotatingItems; public final ForgeConfigSpec.BooleanValue subtlePowerSystem; public final ForgeConfigSpec.BooleanValue staticWandBeam; @@ -52,8 +53,11 @@ private static class Client implements BotaniaConfig.ClientConfigAccess { public Client(ForgeConfigSpec.Builder builder) { builder.push("rendering"); useShaders = builder - .comment("Set this to false to disable the use of shaders for some of the mod's renders and render translucent particles as opaque, for shader compatibility with some shaders which implement a deferred lighting pass. (Requires game restart, and enabling without shaders may impact aesthetics)") + .comment("Set this to false to disable the use of shaders for some of the mod's renders. (Requires game restart)") .define("shaders", true); + opaqueParticles = builder + .comment("Set this to true to disable translucent particles, for shader compatibility with some shaders which implement a deferred lighting pass. (Enabling without shaders may impact aesthetics)") + .define("opaqueParticles", false); boundBlockWireframe = builder .comment("Set this to false to disable the wireframe when looking a block bound to something (spreaders, flowers, etc).") .define("boundBlockWireframe", true); @@ -198,6 +202,13 @@ public boolean splashesEnabled() { public boolean useShaders() { return this.useShaders.get(); } + + @Override + public boolean opaqueParticles() { + return this.opaqueParticles.get(); + } + + } public static final Client CLIENT; diff --git a/Xplat/src/main/java/vazkii/botania/client/fx/FXSparkle.java b/Xplat/src/main/java/vazkii/botania/client/fx/FXSparkle.java index d49f53f0b5..97232ffe37 100644 --- a/Xplat/src/main/java/vazkii/botania/client/fx/FXSparkle.java +++ b/Xplat/src/main/java/vazkii/botania/client/fx/FXSparkle.java @@ -159,11 +159,11 @@ private static void beginRenderCommon(BufferBuilder buffer, TextureManager textu Minecraft.getInstance().gameRenderer.lightTexture().turnOnLightLayer(); RenderSystem.enableDepthTest(); - if (!BotaniaConfig.client().useShaders()) { //Shader compatibility mode enabled + if (BotaniaConfig.client().opaqueParticles()) { RenderSystem.disableBlend(); RenderSystem.depthMask(true); RenderSystem.setShader(GameRenderer::getParticleShader); - } else { //Shader compatibility mode disabled + } else { RenderSystem.depthMask(false); RenderSystem.enableBlend(); RenderSystem.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); diff --git a/Xplat/src/main/java/vazkii/botania/client/fx/FXWisp.java b/Xplat/src/main/java/vazkii/botania/client/fx/FXWisp.java index 9c497f6a9c..57f4a46fbc 100644 --- a/Xplat/src/main/java/vazkii/botania/client/fx/FXWisp.java +++ b/Xplat/src/main/java/vazkii/botania/client/fx/FXWisp.java @@ -106,11 +106,11 @@ public void setGravity(float value) { private static void beginRenderCommon(BufferBuilder bufferBuilder, TextureManager textureManager) { Minecraft.getInstance().gameRenderer.lightTexture().turnOnLightLayer(); - if (!BotaniaConfig.client().useShaders()) { //Shader compatibility mode enabled + if (BotaniaConfig.client().opaqueParticles()) { RenderSystem.disableBlend(); RenderSystem.depthMask(true); RenderSystem.setShader(GameRenderer::getParticleShader); - } else { //Shader compatibility mode disabled + } else { RenderSystem.depthMask(false); RenderSystem.enableBlend(); RenderSystem.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); diff --git a/Xplat/src/main/java/vazkii/botania/xplat/BotaniaConfig.java b/Xplat/src/main/java/vazkii/botania/xplat/BotaniaConfig.java index 1cbfdbcfae..cfee0d30df 100644 --- a/Xplat/src/main/java/vazkii/botania/xplat/BotaniaConfig.java +++ b/Xplat/src/main/java/vazkii/botania/xplat/BotaniaConfig.java @@ -42,6 +42,7 @@ public interface ClientConfigAccess { boolean referencesEnabled(); boolean splashesEnabled(); boolean useShaders(); + boolean opaqueParticles(); } private static ConfigAccess config = null;