当前位置: 首页>>代码示例>>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;未经允许,请勿转载。