本文整理匯總了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();
}
示例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();
}
示例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);
}
}
}
}
}