diff --git a/src/main/java/net/minecraftforge/client/GuiIngameForge.java b/src/main/java/net/minecraftforge/client/GuiIngameForge.java index 8b62861d8..9cd42414f 100644 --- a/src/main/java/net/minecraftforge/client/GuiIngameForge.java +++ b/src/main/java/net/minecraftforge/client/GuiIngameForge.java @@ -71,6 +71,7 @@ public class GuiIngameForge extends GuiIngame //Flags to toggle the rendering of certain aspects of the HUD, valid conditions //must be met for them to render normally. If those conditions are met, but this flag //is false, they will not be rendered. + public static boolean renderVignette = true; public static boolean renderHelmet = true; public static boolean renderPortal = true; public static boolean renderHotbar = true; @@ -120,7 +121,7 @@ public class GuiIngameForge extends GuiIngame mc.entityRenderer.setupOverlayRendering(); GlStateManager.enableBlend(); - if (Minecraft.isFancyGraphicsEnabled()) + if (renderVignette && Minecraft.isFancyGraphicsEnabled()) { renderVignette(mc.player.getBrightness(), res); } @@ -247,6 +248,20 @@ public class GuiIngameForge extends GuiIngame post(BOSSHEALTH); } + @Override + protected void renderVignette(float lightLevel, ScaledResolution scaledRes) + { + if (pre(VIGNETTE)) + { + // Need to put this here, since Vanilla assumes this state after the vignette was rendered. + GlStateManager.enableDepth(); + GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); + return; + } + super.renderVignette(lightLevel, scaledRes); + post(VIGNETTE); + } + private void renderHelmet(ScaledResolution res, float partialTicks) { if (pre(HELMET)) return; diff --git a/src/main/java/net/minecraftforge/client/event/RenderGameOverlayEvent.java b/src/main/java/net/minecraftforge/client/event/RenderGameOverlayEvent.java index e43585151..36bd88049 100644 --- a/src/main/java/net/minecraftforge/client/event/RenderGameOverlayEvent.java +++ b/src/main/java/net/minecraftforge/client/event/RenderGameOverlayEvent.java @@ -66,7 +66,8 @@ public class RenderGameOverlayEvent extends Event DEBUG, POTION_ICONS, SUBTITLES, - FPS_GRAPH + FPS_GRAPH, + VIGNETTE } private final float partialTicks;