Skip to content

Commit

Permalink
Possible sky rendering fix with optifine and immersive portals
Browse files Browse the repository at this point in the history
  • Loading branch information
paulevsGitch committed Jul 16, 2021
1 parent a07f271 commit 193fc41
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/main/java/ru/betterend/mixin/client/LevelRendererMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ public class LevelRendererMixin {
private static float time3;
private static float blind02;
private static float blind06;
private static boolean directOpenGL = false;

@Shadow
@Final
Expand Down Expand Up @@ -88,8 +87,6 @@ private void be_onInit(Minecraft client, RenderBuffers bufferBuilders, CallbackI
axis2.normalize();
axis3.normalize();
axis4.normalize();

directOpenGL = FabricLoader.getInstance().isModLoaded("optifabric") || FabricLoader.getInstance().isModLoaded("immersive_portals");
}

@Inject(method = "renderSky", at = @At("HEAD"), cancellable = true)
Expand All @@ -103,17 +100,8 @@ private void be_renderBetterEndSky(PoseStack matrices, Matrix4f matrix4f, float

FogRenderer.levelFogColor();
RenderSystem.enableTexture();

if (directOpenGL) {
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glAlphaFunc(516, 0.0F);
GL11.glEnable(GL11.GL_BLEND);
RenderSystem.depthMask(false);
}
else {
RenderSystem.enableBlend();
RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
}
RenderSystem.enableBlend();
RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);

float blindA = 1F - BackgroundInfo.blindness;
blind02 = blindA * 0.2F;
Expand Down

0 comments on commit 193fc41

Please sign in to comment.