Jump to content

[1.9] BakedQuad texture on wrong face.


wehttam664

Recommended Posts

I'm relatively new with using custom BakedQuads, but, rather than make 2^6^16 combinations of block states for rendering, I figured it was an easier method.

 

I cannot, however, get them to render the correct way. No matter what I do to the numbers, the texture is displayed facing downward.

 

I have a the following inside of IBakedModel#getQuads override.

        TextureAtlasSprite texture = ItemPanel.getTextureOf(panelUp);
        int color = Color.WHITE.getRGB();
        quads.add(new BakedQuad(Ints.concat(
            vertexToInts(1/16f , 15/16f, 1/16f , color, texture, 0 , 0 ),
            vertexToInts(15/16f, 15/16f, 1/16f , color, texture, 16, 0 ),
            vertexToInts(15/16f, 15/16f, 15/16f, color, texture, 16, 16),
            vertexToInts(1/16f , 15/16f, 15/16f, color, texture, 0  ,16)
        ), 0, EnumFacing.UP, texture, false, format));

 

vertexToInts:

public static int[] vertexToInts(float x, float y, float z, int color, TextureAtlasSprite texture, float u, float v) {
    return new int[] {
        Float.floatToRawIntBits(x),
        Float.floatToRawIntBits(y),
        Float.floatToRawIntBits(z),
        color,
        Float.floatToRawIntBits(texture.getInterpolatedU(u)),
        Float.floatToRawIntBits(texture.getInterpolatedV(v)),
        0
    };
  }

 

All other quads come from baked model components and render fine.

 

Why is this texture facing down? It seems the EnumFacing parameter in BakedQuad.<init> does nothing (I tried other values), so what am I doing wrong?

 

EDIT: This issue also happens with EAST- and NORTH-sided panels facing WEST and SOUTH respectively.

Link to comment
Share on other sites

I'm relatively new with using custom BakedQuads, but, rather than make 2^6^16 combinations of block states for rendering, I figured it was an easier

 

Why the hell do you need 22,821,109,907,456 states?  That's more baked models than the game even supports.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

I need that many combinations.

 

2 from the possibility of a side having a panel on or off.

6 from each of the six sides.

16 possible panels (including no panel).

 

I may have done the math wrong, but it's still a ridiculous number of combinations for the block.

 

No matter the number of combinations, I do need this solved...

Link to comment
Share on other sites

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.