Posted August 5, 20241 yr I am trying to make some animations for my mod, and one of the steps is rolling out a ball of dough for a pizza. I want to have the rolled out dough slowly fade in, but trying to use RenderSystem#setShaderColor to set the alpha channel does not work how I would expect it to Spoiler Trying to set the shader for rendering just the rolled dough (in BlockEntityRenderer#render) // dough ball pPoseStack.pushPose(); itemRenderer.renderStatic(item, ItemDisplayContext.GROUND, getLightLevel(pBlockEntity.getLevel(), pBlockEntity.getBlockPos()), OverlayTexture.NO_OVERLAY, ball.getPizzaBoardPoseStack(pBlockEntity, pPoseStack), pBufferSource, pBlockEntity.getLevel(), 1); pPoseStack.popPose(); // rolled dough pPoseStack.pushPose(); RenderSystem.setShaderColor(1f, 1f, 1f, 0.5f); itemRenderer.renderStatic(FoodPart.PIZZA_ROLLED.createItem(), ItemDisplayContext.GROUND, getLightLevel(pBlockEntity.getLevel(), pBlockEntity.getBlockPos()), OverlayTexture.NO_OVERLAY, PizzaBase.getPizzaCounterPoseStack(pBlockEntity, pPoseStack), pBufferSource, pBlockEntity.getLevel(), 1); RenderSystem.setShaderColor(1f, 1f, 1f, 1f); pPoseStack.popPose(); Spoiler Not resetting the shader causes all items to render with transparency on every block // dough ball pPoseStack.pushPose(); itemRenderer.renderStatic(item, ItemDisplayContext.GROUND, getLightLevel(pBlockEntity.getLevel(), pBlockEntity.getBlockPos()), OverlayTexture.NO_OVERLAY, ball.getPizzaBoardPoseStack(pBlockEntity, pPoseStack), pBufferSource, pBlockEntity.getLevel(), 1); pPoseStack.popPose(); // rolled dough pPoseStack.pushPose(); RenderSystem.setShaderColor(1f, 1f, 1f, 0.5f); itemRenderer.renderStatic(FoodPart.PIZZA_ROLLED.createItem(), ItemDisplayContext.GROUND, getLightLevel(pBlockEntity.getLevel(), pBlockEntity.getBlockPos()), OverlayTexture.NO_OVERLAY, PizzaBase.getPizzaCounterPoseStack(pBlockEntity, pPoseStack), pBufferSource, pBlockEntity.getLevel(), 1); pPoseStack.popPose(); Is there another way that I am missing to be able to render items on block entities with some transparency? Edited August 5, 20241 yr by Growling_Grizzly version
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.