#Textures clipping on zero-width cube

14 messages · Page 1 of 1 (latest)

charred cedar
#

Is there any way to get around textures clipping like this on a zero-width cube? In Blockbench it renders fine, but ingame it looks like this. Interestingly it's fine when placed as a block, it only breaks when rendered like this with Minecraft.getMinecraft().getItemRenderer().renderItem(player, new ItemStack(Item.getItemFromBlock(ItemSmokingArmor.HAT_INSTANCE), 1), ItemCameraTransforms.TransformType.NONE);.

Version is 1.12.2, the rendering is done in a custom LayerRenderer registered on the player's renderer.

misty houndBOT
#
Welcome to the help forum!

Please make sure to read #1029373817119838218 as it may answer your question!

Once your question has been resolved, please mark the post as closed by using the </close:1163944441741049897> command.

slim trout
charred cedar
#

Hm, but the block in my second image is rendering both faces no?

slim trout
fleet notch
#

Minecraft.getMinecraft().getItemRenderer().renderItem(player, new ItemStack(Item.getItemFromBlock(ItemSmokingArmor.HAT_INSTANCE), 1), ItemCameraTransforms.TransformType.NONE);.

slim trout
#

if it renders the north face to be visible from inside and outside and does the same for the south face at the exact same position you get z-fighting

fleet notch
#

Depending on where you render, there is no backface culling. meaning that it renders both sides, of both vertices

#

But yeah, items in 1.12 did not have backface culling.

#

Your option is to render it as a block, or just skip the item/block rendering, and render the model straight.

charred cedar
charred cedar
#

Hm, seems like it's much harder to hook into the block rendering pipeline... at least in a way that's actually functional

#
BufferBuilder builder = Tessellator.getInstance().getBuffer();
BlockPos pos = player.getPosition();

builder.begin(7, DefaultVertexFormats.BLOCK);
builder.setTranslation((double)(-pos.getX()), (double)(-pos.getY()), (double)(-pos.getZ()));
Minecraft.getMinecraft().getBlockRendererDispatcher().renderBlock(ItemSmokingArmor.HAT_INSTANCE.getDefaultState(), pos, player.world, builder);

Tessellator.getInstance().draw();
builder.setTranslation(0, 0, 0);
GlStateManager.popMatrix();
#

Tried this, but there's now no lighting and backface culling is still nonexistent