Jump to content

Recommended Posts

Posted

It appears the image's alpha is being raised to 1 above a certain threshold.

Taking a look at the pumpkin blur code in net.minecraft.client.gui.GuiIngame, the major difference in yours versus the pumpkin (which appears to have functional alpha transparencies from the image), is that "depth" and "alpha" are being disabled, and the depth mask flag is set to false before drawing the image. It also appears to be using the blend function differently.

Here's what I'm referring to:

    protected void renderPumpkinOverlay(ScaledResolution scaledRes) {
        // this stuff is what's different.
        GlStateManager.disableDepth();
        GlStateManager.depthMask(false);
        GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        GlStateManager.disableAlpha();
      
        // the draw code looks like yours.
        this.mc.getTextureManager().bindTexture(PUMPKIN_BLUR_TEX_PATH);
        Tessellator tessellator = Tessellator.getInstance();
        // ..
        tessellator.draw();
      
      	// re-enable the things you disabled.
        GlStateManager.depthMask(true);
        GlStateManager.enableDepth();
        GlStateManager.enableAlpha();
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    }

 

Try adding in those calls and see if that makes a difference. I know the pumpkin blur does something similar but on a smaller scale, so this may solve the issue.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.