当前位置: 首页>>代码示例>>Java>>正文


Java CCRenderState.pullLightmap方法代码示例

本文整理汇总了Java中codechicken.lib.render.CCRenderState.pullLightmap方法的典型用法代码示例。如果您正苦于以下问题:Java CCRenderState.pullLightmap方法的具体用法?Java CCRenderState.pullLightmap怎么用?Java CCRenderState.pullLightmap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在codechicken.lib.render.CCRenderState的用法示例。


在下文中一共展示了CCRenderState.pullLightmap方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: renderItem

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
public void renderItem(ItemStack item, TransformType transformType) {
    GlStateManager.pushMatrix();
    CCRenderState ccrs = CCRenderState.instance();
    ccrs.reset();
    ccrs.pullLightmap();
    Frequency frequency = Frequency.readFromStack(item);
    FluidStack fluidStack = TankSynchroniser.getClientLiquid(frequency);
    RenderTileEnderTank.renderTank(ccrs, 2, 0F, frequency, 0, 0, 0, 0);
    if (fluidStack != null && RenderUtils.shouldRenderFluid(fluidStack)) {
        RenderTileEnderTank.renderLiquid(fluidStack, 0, 0, 0);
    }
    //Fixes issues with inventory rendering.
    //The Portal renderer modifies blend and disables it.
    //Vanillas inventory relies on the fact that items don't modify gl so it never bothers to set it again.
    GlStateManager.enableBlend();
    GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
    GlStateManager.popMatrix();
}
 
开发者ID:TheCBProject,项目名称:EnderStorage,代码行数:20,代码来源:EnderTankItemRender.java

示例2: renderItem

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
public void renderItem(final IItemRenderer.ItemRenderType type, final ItemStack stack, final Object... data) {
    if (!stack.hasTagCompound()) {
        return;
    }
    final String mat = stack.getTagCompound().getString("mat");
    final MicroMaterialRegistry.IMicroMaterial material = MicroMaterialRegistry.getMaterial(mat);
    if (material == null) {
        return;
    }
    GL11.glPushMatrix();
    if (type == IItemRenderer.ItemRenderType.ENTITY) {
        GL11.glScaled(0.5, 0.5, 0.5);
    }
    if (type == IItemRenderer.ItemRenderType.INVENTORY || type == IItemRenderer.ItemRenderType.ENTITY) {
        GL11.glTranslatef(-0.5f, -0.5f, -0.5f);
    }
    OpenGlHelper.glBlendFunc(770, 771, 1, 0);
    GL11.glEnable(3008);
    final CCRenderPipeline.PipelineBuilder builder = CCRenderState.pipeline.builder();
    CCRenderState.reset();
    TextureUtils.bindAtlas(0);
    CCRenderState.useNormals = true;
    CCRenderState.pullLightmap();
    CCRenderState.startDrawing();
    final IMicroBlock part = RegisterMicroBlocks.mParts.get(stack.getItemDamage());
    if (part != null) {
        part.renderItem(stack, material);
    }
    CCRenderState.draw();
    GL11.glPopMatrix();
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:32,代码来源:RenderItemMicroblock.java

示例3: renderInventoryBlock

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
    //GL11.glPushMatrix();
    block.setBlockBoundsForItemRender();
    Cuboid6 blockBounds = new Cuboid6(
            block.getBlockBoundsMinX(),
            block.getBlockBoundsMinY(),
            block.getBlockBoundsMinZ(),
            block.getBlockBoundsMaxX(),
            block.getBlockBoundsMaxY(),
            block.getBlockBoundsMaxZ());
    model.generateBlock(0, blockBounds);

    GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
    RenderVariation var = ((Carvable) block).getVariation(metadata);
    pos.set(0, 0, 0);
    CCRenderState.reset();
    TextureUtils.bindAtlas(0);

    CCRenderState.pullLightmap();

    for (int i = 0; i < 6; i++) {


        for (int j = 0; j < 4; j++) {
            verts[j] = model.verts[j + i * 4];
        }
        var.setup(verts, i, pos, null, blockBounds);
        var.renderSide(verts, i, pos, null, block.getRenderColor(i) << 8 | 0xFF, blockBounds);



    }
    GL11.glTranslatef(0.5F, 0.5F, 0.5F);
    //GL11.glPopMatrix();
}
 
开发者ID:delta534,项目名称:Chisel,代码行数:37,代码来源:BlockAdvancedMarbleRenderer.java


注:本文中的codechicken.lib.render.CCRenderState.pullLightmap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。