Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hello,

 

I'm trying to get transparent blocks to render behind a partially transparent mob. Unfortunately, as seen here, the mob is no longer rendering correctly. Here is my code:

 

In the entity class:

@Override
public boolean shouldRenderInPass(int pass) {
	return pass == 1;
}

 

And in my model class:

public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
    super.render(entity, f, f1, f2, f3, f4, f5);
    setRotationAngles(f, f1, f2, f3, f4, f5, entity);
    hatBase.render(f5);
    rightFinger1.render(f5);
    GL11.glPushMatrix();
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    bottom.render(f5);
    middle.render(f5);
    head.render(f5);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glPopMatrix();
    rightArm.render(f5);
    leftArm.render(f5);
    rightFinger3.render(f5);
    rightFinger2.render(f5);
    leftFinger2.render(f5);
    leftFinger3.render(f5);
    leftFinger1.render(f5);
    hatTop.render(f5);
  }

 

Does anyone know what the problem is? Thanks!

Check out my mod, Realms of Chaos, here.

 

If I helped you, be sure to press the "Thank You" button!

  • Author

Anyone? It works fine if I render it in pass 0, but transparent blocks don't appear behind it.

Check out my mod, Realms of Chaos, here.

 

If I helped you, be sure to press the "Thank You" button!

  • Author

Huh. Got it working with GL11.glDepthMask(true) after blendFunc. Thanks!

Check out my mod, Realms of Chaos, here.

 

If I helped you, be sure to press the "Thank You" button!

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.