From 996dbaef2cc2be3465ad9450cdd694c3bcb13535 Mon Sep 17 00:00:00 2001 From: Kotmatross <110309314+kotmatross28729@users.noreply.github.com> Date: Sat, 8 Nov 2025 01:44:38 +0300 Subject: [PATCH] [Shaders] Basic compatibility with NTM:Space skybox & more (#1096) --- dependencies.gradle | 2 + .../angelica/config/AngelicaGuiConfig.java | 1 + .../angelica/config/CompatConfig.java | 22 +- .../gtnewhorizons/angelica/mixins/Mixins.java | 11 + .../angelica/mixins/TargetedMod.java | 6 +- src/main/java/jss/notfine/core/Settings.java | 1 + .../notfine/gui/NotFineGameOptionPages.java | 1 + .../client/gui/SodiumGameOptionPages.java | 1 + .../angelica/textures/shaders_workaround.png | Bin 0 -> 127 bytes .../resources/assets/notfine/lang/en_US.lang | 2 + .../notfine/renderer/MixinRenderGlobal.java | 9 +- ...ixinSkyProviderCelestial_ShaderCompat.java | 239 ++++++++++++++++++ .../MixinSkyProviderCelestial_Tweaks.java | 29 +++ 13 files changed, 321 insertions(+), 3 deletions(-) create mode 100644 src/main/resources/assets/angelica/textures/shaders_workaround.png create mode 100644 src/mixin/java/com/gtnewhorizons/angelica/mixins/late/client/ntmSpace/MixinSkyProviderCelestial_ShaderCompat.java create mode 100644 src/mixin/java/com/gtnewhorizons/angelica/mixins/late/client/ntmSpace/MixinSkyProviderCelestial_Tweaks.java diff --git a/dependencies.gradle b/dependencies.gradle index 472c8c692..bf0ca252a 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -93,6 +93,8 @@ dependencies { compileOnly("com.github.GTNewHorizons:NotEnoughIds:2.1.10:dev") // Mixin Version compileOnly("com.github.GTNewHorizons:NotEnoughIds-Legacy:1.4.7:dev") // ASM Version + compileOnly(rfg.deobf("curse.maven:ntm-space-1121235:6974420")) + compileOnly(rfg.deobf("curse.maven:campfirebackport-387444:4611675")) compileOnly(rfg.deobf("curse.maven:xaeros-minimap-263420:5060684")) compileOnly(rfg.deobf("curse.maven:security-craft-64760:2818228")) diff --git a/src/main/java/com/gtnewhorizons/angelica/config/AngelicaGuiConfig.java b/src/main/java/com/gtnewhorizons/angelica/config/AngelicaGuiConfig.java index 670e618d2..dcd9bb21b 100644 --- a/src/main/java/com/gtnewhorizons/angelica/config/AngelicaGuiConfig.java +++ b/src/main/java/com/gtnewhorizons/angelica/config/AngelicaGuiConfig.java @@ -11,6 +11,7 @@ public class AngelicaGuiConfig extends SimpleGuiConfig { "Angelica", true, AngelicaConfig.class, + CompatConfig.class, FontConfig.class ); } diff --git a/src/main/java/com/gtnewhorizons/angelica/config/CompatConfig.java b/src/main/java/com/gtnewhorizons/angelica/config/CompatConfig.java index 615fbe737..3e7bffba6 100644 --- a/src/main/java/com/gtnewhorizons/angelica/config/CompatConfig.java +++ b/src/main/java/com/gtnewhorizons/angelica/config/CompatConfig.java @@ -2,7 +2,7 @@ package com.gtnewhorizons.angelica.config; import com.gtnewhorizon.gtnhlib.config.Config; -@Config(modid = "angelica", filename = "angelica-compat") +@Config(modid = "angelica", filename = "angelica-compat", category = "compat") public class CompatConfig { @Config.Comment("Apply fixes to the LOTR mod") @@ -44,4 +44,24 @@ public class CompatConfig { @Config.DefaultBoolean(true) @Config.RequiresMcRestart public static boolean fixSecurityCraft; + + @Config.Comment("Apply tweaks to NTM:Space") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean tweakNTMSpace; + + @Config.Comment("Apply fixes to NTM:Space") + @Config.DefaultBoolean(true) + @Config.RequiresMcRestart + public static boolean fixNTMSpace; + + @Config.Comment("Disables rendering of the planet below the player at high altitudes [Requires tweakNTMSpace]") + @Config.DefaultEnum("ShadersOnly") + public static altitudePlanetRendererState NTMSpace_disableAltitudePlanetRenderer; + public enum altitudePlanetRendererState { + Always, + ShadersOnly, + Never + } + } diff --git a/src/main/java/com/gtnewhorizons/angelica/mixins/Mixins.java b/src/main/java/com/gtnewhorizons/angelica/mixins/Mixins.java index 645e3ca84..8e8a3b6fe 100644 --- a/src/main/java/com/gtnewhorizons/angelica/mixins/Mixins.java +++ b/src/main/java/com/gtnewhorizons/angelica/mixins/Mixins.java @@ -276,6 +276,17 @@ public enum Mixins implements IMixins { .addRequiredMod(TargetedMod.MINEFACTORY_RELOADED) .setApplyIf(() -> CompatConfig.fixMinefactoryReloaded) .addClientMixins("client.minefactoryreloaded.MixinRedNetCableRenderer")), + + NTM_SPACE_TWEAKS(new MixinBuilder("Support for 'Disable Horizon' & 'disableAltitudePlanetRenderer' options in NTM:Space") + .setPhase(Phase.LATE) + .addRequiredMod(TargetedMod.NTM_SPACE) + .setApplyIf(() -> CompatConfig.tweakNTMSpace) + .addClientMixins("client.ntmSpace.MixinSkyProviderCelestial_Tweaks")), + NTM_SPACE_SHADER_COMPAT(new MixinBuilder("Multiple shader fixes for NTM:Space") + .setPhase(Phase.LATE) + .addRequiredMod(TargetedMod.NTM_SPACE) + .setApplyIf(() -> CompatConfig.fixNTMSpace && AngelicaConfig.enableIris) + .addClientMixins("client.ntmSpace.MixinSkyProviderCelestial_ShaderCompat")), SPEEDUP_CAMPFIRE_BACKPORT_ANIMATIONS(new MixinBuilder("Add animation speedup support to Campfire Backport") .setPhase(Phase.LATE) diff --git a/src/main/java/com/gtnewhorizons/angelica/mixins/TargetedMod.java b/src/main/java/com/gtnewhorizons/angelica/mixins/TargetedMod.java index e7196eebb..c347a9917 100644 --- a/src/main/java/com/gtnewhorizons/angelica/mixins/TargetedMod.java +++ b/src/main/java/com/gtnewhorizons/angelica/mixins/TargetedMod.java @@ -15,6 +15,7 @@ public enum TargetedMod implements ITargetMod { DYNAMIC_SURROUNDINGS_ORIGINAL("org.blockartistry.mod.DynSurround.asm.TransformLoader", "dsurround"), EXTRAUTILS(null, "ExtraUtilities"), MINEFACTORY_RELOADED(null, "MineFactoryReloaded"), + NTM_SPACE("com.hbm.dim.SolarSystem"), IC2("ic2.core.coremod.IC2core", "IC2"), NATURA(null, "Natura"), SECURITYCRAFT(null, "securitycraft"), @@ -24,7 +25,10 @@ public enum TargetedMod implements ITargetMod { WITCHERY(null, "witchery"); private final TargetModBuilder builder; - + + TargetedMod(String targetClass) { + this.builder = new TargetModBuilder().setTargetClass(targetClass); + } TargetedMod(String coreModClass, String modId) { this.builder = new TargetModBuilder().setCoreModClass(coreModClass).setModId(modId); } diff --git a/src/main/java/jss/notfine/core/Settings.java b/src/main/java/jss/notfine/core/Settings.java index ac13a290b..619ad0525 100644 --- a/src/main/java/jss/notfine/core/Settings.java +++ b/src/main/java/jss/notfine/core/Settings.java @@ -60,6 +60,7 @@ public enum Settings { DynamicLights.ShaderForce = (boolean) this.option.getStore(); } }, + HORIZON_DISABLE(new NotFineOptionTickBox(true, OptionImpact.LOW)), FOG_DISABLE(new NotFineOptionTickBox(false, OptionImpact.LOW)), FOG_NEAR_DISTANCE(new NotFineOptionSliderPercentage(75, 1, 100, 1, OptionImpact.LOW)), GUI_BACKGROUND(new NotFineOptionCycling<>(BackgroundSelect.DEFAULT, null)) { diff --git a/src/main/java/jss/notfine/gui/NotFineGameOptionPages.java b/src/main/java/jss/notfine/gui/NotFineGameOptionPages.java index dd27500fa..9349ebb22 100644 --- a/src/main/java/jss/notfine/gui/NotFineGameOptionPages.java +++ b/src/main/java/jss/notfine/gui/NotFineGameOptionPages.java @@ -213,6 +213,7 @@ public class NotFineGameOptionPages { .add(Settings.MODE_CLOUD_TRANSLUCENCY.option) .add(Settings.MODE_STARS.option) .add(Settings.TOTAL_STARS.option) + .add(Settings.HORIZON_DISABLE.option) .add(Settings.FOG_DISABLE.option) .add(Settings.FOG_NEAR_DISTANCE.option) .build()); diff --git a/src/main/java/me/jellysquid/mods/sodium/client/gui/SodiumGameOptionPages.java b/src/main/java/me/jellysquid/mods/sodium/client/gui/SodiumGameOptionPages.java index 823023d26..ca763f07b 100644 --- a/src/main/java/me/jellysquid/mods/sodium/client/gui/SodiumGameOptionPages.java +++ b/src/main/java/me/jellysquid/mods/sodium/client/gui/SodiumGameOptionPages.java @@ -89,6 +89,7 @@ public class SodiumGameOptionPages { .add(Settings.MODE_CLOUD_TRANSLUCENCY.option) .add(Settings.MODE_STARS.option) .add(Settings.TOTAL_STARS.option) + .add(Settings.HORIZON_DISABLE.option) .add(Settings.FOG_DISABLE.option) .add(Settings.FOG_NEAR_DISTANCE.option) .add(Settings.VOID_FOG.option); diff --git a/src/main/resources/assets/angelica/textures/shaders_workaround.png b/src/main/resources/assets/angelica/textures/shaders_workaround.png new file mode 100644 index 0000000000000000000000000000000000000000..b009aa90b3d44a2bf0f16901809da9823fb9cabb GIT binary patch literal 127 zcmeAS@N?(olHy`uVBq!ia0vp^Od!m`1|*BN@u~nR#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;>1s;*b3=G`DAk4@xYmNj^P{h;4F+?If`42w}kHY~LB?%y4u>HZpkj1xA Q04UGk>FVdQ&MBb@0I^3IB>(^b literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/notfine/lang/en_US.lang b/src/main/resources/assets/notfine/lang/en_US.lang index 63530328e..4e10bdb9a 100644 --- a/src/main/resources/assets/notfine/lang/en_US.lang +++ b/src/main/resources/assets/notfine/lang/en_US.lang @@ -20,6 +20,8 @@ options.downfall_distance=Weather Effects options.downfall_distance.tooltip=Weather Effects options.dynamic_fov=Dynamic FOV options.dynamic_fov.tooltip=If enabled, the game's field of view will change based on the player's speed. +options.horizon_disable=Disable Horizon +options.horizon_disable.tooltip=Disable Horizon options.fog_disable=Disable Terrain Fog options.fog_disable.tooltip=Disable Terrain Fog options.fog_near_distance=Near Fog Distance diff --git a/src/mixin/java/com/gtnewhorizons/angelica/mixins/early/notfine/renderer/MixinRenderGlobal.java b/src/mixin/java/com/gtnewhorizons/angelica/mixins/early/notfine/renderer/MixinRenderGlobal.java index 56f2dade5..527f65853 100644 --- a/src/mixin/java/com/gtnewhorizons/angelica/mixins/early/notfine/renderer/MixinRenderGlobal.java +++ b/src/mixin/java/com/gtnewhorizons/angelica/mixins/early/notfine/renderer/MixinRenderGlobal.java @@ -32,7 +32,14 @@ public abstract class MixinRenderGlobal { return (boolean)Settings.MODE_SKY.option.getStore(); } } - + + @WrapWithCondition( + method = "renderSky(F)V", + at = @At(value = "INVOKE", target = "Lorg/lwjgl/opengl/GL11;glCallList(I)V", ordinal = 3, remap = false)) + private boolean conditionalDisableHorizon(int i) { + return !(boolean)Settings.HORIZON_DISABLE.option.getStore(); + } + @WrapWithCondition( method = "renderSky(F)V", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/client/IRenderHandler;render(FLnet/minecraft/client/multiplayer/WorldClient;Lnet/minecraft/client/Minecraft;)V", remap = false)) diff --git a/src/mixin/java/com/gtnewhorizons/angelica/mixins/late/client/ntmSpace/MixinSkyProviderCelestial_ShaderCompat.java b/src/mixin/java/com/gtnewhorizons/angelica/mixins/late/client/ntmSpace/MixinSkyProviderCelestial_ShaderCompat.java new file mode 100644 index 000000000..cf571ddce --- /dev/null +++ b/src/mixin/java/com/gtnewhorizons/angelica/mixins/late/client/ntmSpace/MixinSkyProviderCelestial_ShaderCompat.java @@ -0,0 +1,239 @@ +package com.gtnewhorizons.angelica.mixins.late.client.ntmSpace; + +import com.gtnewhorizons.angelica.glsm.GLStateManager; +import com.hbm.dim.SkyProviderCelestial; +import com.llamalad7.mixinextras.injector.v2.WrapWithCondition; +import com.llamalad7.mixinextras.sugar.Local; +import com.llamalad7.mixinextras.sugar.Share; +import com.llamalad7.mixinextras.sugar.ref.LocalIntRef; +import com.llamalad7.mixinextras.sugar.ref.LocalRef; +import net.coderbot.iris.Iris; +import net.coderbot.iris.pipeline.WorldRenderingPhase; +import net.coderbot.iris.pipeline.WorldRenderingPipeline; +import net.irisshaders.iris.api.v0.IrisApi; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.ModifyArg; +import org.spongepowered.asm.mixin.injection.Slice; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +/** + * Ported with additional fixes from the ShaderFixer mod + * @author kotmatross28729 + */ +@Mixin(value = SkyProviderCelestial.class, priority = 100) +public class MixinSkyProviderCelestial_ShaderCompat { + + @Unique + private static ResourceLocation GL_TEXTURE_2D_WORKAROUND = new ResourceLocation("angelica:textures/shaders_workaround.png"); /// Simple white 2x2 texture + + /// Fixes + + /** + * Forces sunset to render with the default program + *
+ * Fixes sunset not rendering at all with shaders enabled + */ + @Inject(method = "render", at = @At(value = "INVOKE", target = "Lcom/hbm/dim/SkyProviderCelestial;renderSunset(FLnet/minecraft/client/multiplayer/WorldClient;Lnet/minecraft/client/Minecraft;)V"), remap = false) + public void iris$sunset$renderInDefaultProgram(CallbackInfo ci, @Share("sunset$previousProgram") LocalIntRef sunset$previousProgram) { + sunset$previousProgram.set(GLStateManager.getActiveProgram()); + GLStateManager.glUseProgram(0); + } + + /** + * Sets the program back before {@link #iris$sunset$renderInDefaultProgram(CallbackInfo, LocalIntRef)} call + */ + @Inject(method = "render", at = @At(value = "INVOKE", target = "Lcom/hbm/dim/SkyProviderCelestial;renderSunset(FLnet/minecraft/client/multiplayer/WorldClient;Lnet/minecraft/client/Minecraft;)V", shift = At.Shift.AFTER), remap = false) + public void iris$sunset$restorePreviousProgram(CallbackInfo ci, @Share("sunset$previousProgram") LocalIntRef sunset$previousProgram) { + GLStateManager.glUseProgram(sunset$previousProgram.get()); + } + + /** + * Disables sun blanking with shaders enabled (shaders ignore it anyway) + *
+ * Fixes the huge white square near the sun with shaders enabled + */ + @Inject(method = "renderSun", at = @At(value="INVOKE", target="Lnet/minecraft/client/renderer/Tessellator;draw()I", ordinal = 1)) + private void iris$sun$disableBlanking(CallbackInfo ci) { + if(IrisApi.getInstance().isShaderPackInUse()) + Tessellator.instance.vertexCount = 0; + } + + /** + * Moves the sun a little closer to the camera + *
+ * Fixes z-fighting between the sun and the shader skybox + */ + @ModifyArg(method = "renderSun", + slice = @Slice( + from = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/Tessellator;addVertexWithUV(DDDDD)V", ordinal = 8), + to = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/Tessellator;draw()I", ordinal = 3)), + at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/Tessellator;addVertexWithUV(DDDDD)V"), + index = 1) + private double iris$sun$offsetY(double original) { + return original - 0.3D; + } + + /** + * In accordance with {@link #iris$sun$offsetY(double)} - moves the flare closer to the camera + */ + @ModifyArg(method = "renderSun", + slice = @Slice( + from = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/Tessellator;addVertexWithUV(DDDDD)V", ordinal = 12), + to = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/Tessellator;draw()I", ordinal = 4)), + at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/Tessellator;addVertexWithUV(DDDDD)V"), + index = 1) + private double iris$sunFlare$offsetY(double original) { + return original - 0.3D; + } + + /** + * Disables {@link GL11#glDisable(int GL_TEXTURE_2D)} call + * @see #iris$atmosphereBlend$renderInDefaultProgram(CallbackInfo, Minecraft, LocalIntRef) + */ + @WrapWithCondition(method = "renderCelestials", at = @At(value = "INVOKE", target = "Lorg/lwjgl/opengl/GL11;glDisable(I)V", ordinal = 2), remap = false) + private boolean iris$atmosphereBlend$revertTextureDisable(int i) { + return false; + } + + /** + * Disables {@link GL11#glEnable(int GL_TEXTURE_2D)} call + * @see #iris$atmosphereBlend$renderInDefaultProgram(CallbackInfo, Minecraft, LocalIntRef) + */ + @WrapWithCondition(method = "renderCelestials", at = @At(value = "INVOKE", target = "Lorg/lwjgl/opengl/GL11;glEnable(I)V", ordinal = 3), remap = false) + private boolean iris$atmosphereBlend$revertTextureEnable(int i) { + return false; + } + + /** + * Forces atmosphere blend to render with the default program + *
+ * Sometimes shaders have serious visual issues if something is rendered with {@link GL11#glDisable(int GL_TEXTURE_2D)} + *
+ * Using {@link net.minecraft.client.renderer.texture.TextureManager#bindTexture(ResourceLocation GL_TEXTURE_2D_WORKAROUND)}, we achieve the same effect as {@link GL11#glDisable(int GL_TEXTURE_2D)}, except it works with shaders + */ + @Inject(method = "renderCelestials", at = @At(value="INVOKE", target="Lnet/minecraft/client/renderer/Tessellator;startDrawingQuads()V", ordinal = 10)) + private void iris$atmosphereBlend$renderInDefaultProgram(CallbackInfo ci, @Local(argsOnly = true) Minecraft mc, @Share("atmo$previousProgram") LocalIntRef atmo$previousProgram) { + atmo$previousProgram.set(GLStateManager.getActiveProgram()); + GLStateManager.glUseProgram(0); + mc.getTextureManager().bindTexture(GL_TEXTURE_2D_WORKAROUND); + } + + /** + * Sets the program back before {@link #iris$atmosphereBlend$renderInDefaultProgram(CallbackInfo, Minecraft, LocalIntRef)} call + */ + @Inject(method = "renderCelestials", at = @At(value="INVOKE", target="Lnet/minecraft/client/renderer/Tessellator;draw()I", ordinal = 10, shift = At.Shift.AFTER)) + private void iris$atmosphereBlend$restorePreviousProgram(CallbackInfo ci, @Share("atmo$previousProgram") LocalIntRef atmo$previousProgram) { + GLStateManager.glUseProgram(atmo$previousProgram.get()); + } + + /** + * Forces celestial bodies to render with the default program + *
+ * Requires `iris$atmosphereBlend$.*` + *
+ * Fixes many bugs, such as: + *
+ * - [All Shaders] At certain time, celestial bodies are rendered as a just solid color squares + *
+ * - [All Shaders] Some celestial bodies appear as heavily (70-90%) translucent + *
+ * - [Complementary 5.5/6.x] Stars render on top of celestial bodies; not behind them + *
+ * - [Complementary 5.5.x] Celestial bodies have incorrect colors near the sun + *
+ * - [Complementary 5.6.x] Celestial bodies don't render at all far from the sun
+ */
+ @Inject(method = "renderCelestials", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/Tessellator;startDrawingQuads()V", ordinal = 5))
+ private void iris$celestials$renderInDefaultProgram(CallbackInfo ci, @Share("celestials$previousProgram") LocalIntRef celestials$previousProgram) {
+ celestials$previousProgram.set(GLStateManager.getActiveProgram());
+ GLStateManager.glUseProgram(0);
+ }
+
+ /**
+ * Sets the program back before {@link #iris$celestials$renderInDefaultProgram(CallbackInfo, LocalIntRef)} call
+ */
+ @Inject(method = "renderCelestials", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/Tessellator;draw()I", ordinal = 5, shift = At.Shift.AFTER))
+ private void iris$celestials$restorePreviousProgram(CallbackInfo ci, @Share("celestials$previousProgram") LocalIntRef celestials$previousProgram) {
+ GLStateManager.glUseProgram(celestials$previousProgram.get());
+ }
+
+ /**
+ * Forces celestial body ring (back) to render with the default program
+ * @see #iris$celestials$renderInDefaultProgram(CallbackInfo, LocalIntRef)
+ */
+ @Inject(method = "renderCelestials", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/Tessellator;startDrawingQuads()V", ordinal = 0))
+ private void iris$ringsBack$renderInDefaultProgram(CallbackInfo ci, @Share("ringsBack$previousProgram") LocalIntRef ringsBack$previousProgram) {
+ ringsBack$previousProgram.set(GLStateManager.getActiveProgram());
+ GLStateManager.glUseProgram(0);
+ }
+
+ /**
+ * Sets the program back before {@link #iris$ringsBack$renderInDefaultProgram(CallbackInfo, LocalIntRef)} call
+ */
+ @Inject(method = "renderCelestials", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/Tessellator;draw()I", ordinal = 0, shift = At.Shift.AFTER))
+ private void iris$ringsBack$restorePreviousProgram(CallbackInfo ci, @Share("ringsBack$previousProgram") LocalIntRef ringsBack$previousProgram) {
+ GLStateManager.glUseProgram(ringsBack$previousProgram.get());
+ }
+
+ /**
+ * Forces celestial body ring (front) to render with the default program
+ * @see #iris$celestials$renderInDefaultProgram(CallbackInfo, LocalIntRef)
+ */
+ @Inject(method = "renderCelestials", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/Tessellator;startDrawingQuads()V", ordinal = 11))
+ private void iris$ringsFront$renderInDefaultProgram(CallbackInfo ci, @Share("ringsFront$previousProgram") LocalIntRef ringsFront$previousProgram) {
+ ringsFront$previousProgram.set(GLStateManager.getActiveProgram());
+ GLStateManager.glUseProgram(0);
+ }
+
+ /**
+ * Sets the program back before {@link #iris$ringsFront$renderInDefaultProgram(CallbackInfo, LocalIntRef)} call
+ */
+ @Inject(method = "renderCelestials", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/Tessellator;draw()I", ordinal = 11, shift = At.Shift.AFTER))
+ private void iris$ringsFront$restorePreviousProgram(CallbackInfo ci, @Share("ringsFront$previousProgram") LocalIntRef ringsFront$previousProgram) {
+ GLStateManager.glUseProgram(ringsFront$previousProgram.get());
+ }
+
+ /// Pipeline setup
+
+ @Inject(method = "render", at = @At(value = "FIELD", target = "Lnet/minecraft/client/renderer/Tessellator;instance:Lnet/minecraft/client/renderer/Tessellator;"))
+ private void iris$renderSky$beginNormalSky(CallbackInfo ci, @Share("pipeline") LocalRef