3
내가 남쪽이나 동쪽에서 보았을 때 예상대로 렌더링되었지만 북쪽이나 서쪽에서 보았을 때 그 뒤에있는 물체를 숨기는 이유는 무엇입니까?Minecraft 투명 렌더링 블록 숨기기
나는 내부에 여러 항목을 렌더링하고 반투명 한 질감을 가진 블록에 문제가있는 보이지 않는 블록이 있습니다. 기본 및 텍스처 블록 모두에 대해 모든 블록 속성 (예 : 렌더링 유형, 레이어, 불투명)을 전환하려고 시도했으며 렌더링시 다른 혼합 옵션을 시도했습니다.
포지 버전 1.12
public class BlueRenderer extends TileEntitySpecialRenderer<TileEntityBlue> {
@Override
public void render(TileEntityBlue tile, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
itemRenderer = mc.getRenderItem();
textureManager = mc.getTextureManager();
blockModelShapes = mc.getBlockRendererDispatcher().getBlockModelShapes();
GlStateManager.pushAttrib();
GlStateManager.pushMatrix();
GlStateManager.translate(x, y, z);
GlStateManager.disableRescaleNormal();
renderItem(new GetBlock("minecraft:jukebox"), 0.5F);
renderItem(new GetBlock("mymod:blue"), 1F);
GlStateManager.popMatrix();
GlStateManager.popAttrib();
}
private void renderItem(GetBlock block, float scale) {
RenderHelper.enableStandardItemLighting();
GlStateManager.enableLighting();
GlStateManager.pushMatrix();
GlStateManager.translate(0.5, 0.5, 0.5);
GlStateManager.scale(scale, scale, scale);
IBakedModel model = blockModelShapes.getModelForState(block.state);
model = ForgeHooksClient.handleCameraTransforms(model, ItemCameraTransforms.TransformType.NONE, false);
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
textureManager.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
itemRenderer.renderItem(block.stack, model);
GlStateManager.disableBlend();
GlStateManager.popMatrix();
}