當前位置: 首頁>>代碼示例>>Java>>正文


Java CullFace類代碼示例

本文整理匯總了Java中net.minecraft.client.renderer.GlStateManager.CullFace的典型用法代碼示例。如果您正苦於以下問題:Java CullFace類的具體用法?Java CullFace怎麽用?Java CullFace使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


CullFace類屬於net.minecraft.client.renderer.GlStateManager包,在下文中一共展示了CullFace類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: renderItem

import net.minecraft.client.renderer.GlStateManager.CullFace; //導入依賴的package包/類
private void renderItem(ItemStack itemStack) {
	parent.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);

	final RenderItem itemRenderer = parent.getItemRenderer();
	final ItemModelMesher itemModelMesher = itemRenderer.getItemModelMesher();
	final IBakedModel model = itemModelMesher.getItemModel(stack);

	GlStateManager.disableLighting();
	GlStateManager.enableRescaleNormal();
	GlStateManager.alphaFunc(GL11.GL_GREATER, 0.1F);
	GlStateManager.enableBlend();
	GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
	GlStateManager.pushMatrix();
	itemRenderer.renderItem(stack, model);
	GlStateManager.cullFace(CullFace.BACK);
	GlStateManager.popMatrix();
	GlStateManager.disableRescaleNormal();
	GlStateManager.disableBlend();

	GlStateManager.enableLighting();
}
 
開發者ID:OpenMods,項目名稱:OpenModsLib,代碼行數:22,代碼來源:GuiComponentItemStackSpinner.java

示例2: render

import net.minecraft.client.renderer.GlStateManager.CullFace; //導入依賴的package包/類
public void render() {
  RenderUtil.bindBlockTexture();
  RenderHelper.disableStandardItemLighting();
  VertexBuffer tes = Tessellator.getInstance().getBuffer();
  for (int i = 0; i <= 1; i++) {
    if (i == 0) {
      GlStateManager.cullFace(CullFace.FRONT);
    } else {
      GlStateManager.cullFace(CullFace.BACK);
    }
    tes.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
    render(tes);
    Tessellator.getInstance().draw();
  }
  RenderHelper.enableStandardItemLighting();
}
 
開發者ID:SleepyTrousers,項目名稱:EnderIO,代碼行數:17,代碼來源:HalfBakedQuad.java

示例3: renderTankFluid

import net.minecraft.client.renderer.GlStateManager.CullFace; //導入依賴的package包/類
private void renderTankFluid(SmartTank tank, Set<EnumFacing> mergers, World world, BlockPos pos) {
  final FluidStack fluid = tank.getFluid();
  if (fluid != null) {
    TextureAtlasSprite icon = RenderUtil.getStillTexture(fluid);
    int color = fluid.getFluid().getColor(fluid);
    float fullness = tank.getFilledRatio();

    boolean[][][] merge = getMergers9(world, pos);

    VertexBuffer tes = Tessellator.getInstance().getBuffer();

    float minU = icon.getMinU(), maxU = icon.getMaxU(), minV = icon.getMinV(), maxV = icon.getMaxV();

    for (int i = 0; i <= 1; i++) {
      if (i == 0) {
        GlStateManager.cullFace(CullFace.FRONT);
      } else {
        GlStateManager.cullFace(CullFace.BACK);
      }
      for (NNIterator<EnumFacing> facings = NNList.FACING.fastIterator(); facings.hasNext();) {
        EnumFacing dir = facings.next();
        float fullness2 = 0;
        if (mergers.contains(dir)) {
          BlockPos pos2 = pos.offset(dir);
          TileEntity tileEntity = world.getTileEntity(pos2);
          if (tileEntity instanceof TileReservoir) {
            TileReservoir res2 = (TileReservoir) tileEntity;
            fullness2 = res2.tank.getFilledRatio();
          }
        }
        BoundingBox bb = mkFace(merge, dir, fullness, fullness2);
        if (bb != null) {
          float minVx = minV, maxVx = maxV;
          if (dir.getAxis() != EnumFacing.Axis.Y) {
            minVx = icon.getInterpolatedV((1 - fullness) * 16);
            maxVx = icon.getInterpolatedV((1 - fullness2) * 16);
          }

          renderFace(tes, bb, dir, minU, maxU, minVx, maxVx, color);
        }
      }
    }
  }
}
 
開發者ID:SleepyTrousers,項目名稱:EnderIO,代碼行數:45,代碼來源:ReservoirRenderer.java


注:本文中的net.minecraft.client.renderer.GlStateManager.CullFace類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。