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

I have a custom entity where two of the body parts occupy the same space.  For all purposes, just consider it having 2 heads of the exact same size in exact same place even thought that isn't it.

 

The problem is that when the entity turns or moves, the area that they share flickers.  How do I make it so one of the heads is always on the outside?

 

I've searched, but I'm probably just using the wrong phrases.

Long time Bukkit & Forge Programmer

Happy to try and help

I ran into the same problem recently.  I was a bit surprised because I figured that if they exactly aligned that the render order would generally be constant, but someone else suggested roundoff error causes flickering on overlapping parts.

 

One solution is to scale one part just slightly such that it doesn't seem obviously mismatched in size but the render is always properly ordered.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

  • Author

Did you do the scale in the rendering itself?  i had the same thought, but of course the model only allows for integers in initial size.

Long time Bukkit & Forge Programmer

Happy to try and help

In my model class, within the render() method.

 

For example, for my elephant I did the following:

            head.render(par7);
            body.render(par7);
            // scale legs slightly to reduce render flicker on overlapping areas
            GL11.glPushMatrix();
            GL11.glScalef(0.99F, 0.00F, 0.99F);
            legRearRight.render(par7);
            legRearLeft.render(par7);
            legFrontRight.render(par7);
            legFrontLeft.render(par7);
            GL11.glPopMatrix();

 

I only scaled in x and z direction because those were the dimensions that caused the overlap.  You could probably make it even tighter with 0.999F or something.

 

Definitely fixed it for me, assuming the flicker you're talking about is the same type.

 

 

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

  • Author

That should fix it.  THANKS.

 

One last question.  Did you have to offset the texture at that point?  Perhaps 0.98 in scale and translate by 0.01?

 

 

Long time Bukkit & Forge Programmer

Happy to try and help

That should fix it.  THANKS.

 

One last question.  Did you have to offset the texture at that point?  Perhaps 0.98 in scale and translate by 0.01?

 

Well, the point is actually to do the scaling so close to 1.0 that it the scaling (and any offset) is pretty much unnoticeable.  But yeah technically you should probably adjust the offset by half the difference between 1.0 and your scale factor.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

  • Author

I'll adjust that tonight.  Wish there was a cool G11 call or something to handl this situation.  Surely this is fairly common.

Long time Bukkit & Forge Programmer

Happy to try and help

  • Author

I just learned something new.  Can't claim I'm anywhere near proficient in GL, but didn't realize this.

 

When I scalef it on the x coord, it centers it instead of shrinking it left or right.  0.99 seems to do it.

Long time Bukkit & Forge Programmer

Happy to try and help

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.