Search in sources :

Example 1 with ColourOperation

use of gregtech.client.renderer.cclop.ColourOperation in project GregTech by GregTechCEu.

the class FireboxActiveRenderer method renderOrientedState.

@Override
@SideOnly(Side.CLIENT)
public void renderOrientedState(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline, Cuboid6 bounds, EnumFacing frontFacing, boolean isActive, boolean isWorkingEnabled) {
    pipeline = ArrayUtils.addAll(pipeline, new LightMapOperation(0b10100000, 0b10100000));
    for (EnumFacing facing : EnumFacing.VALUES) {
        OrientedOverlayRenderer.OverlayFace overlayFace = OrientedOverlayRenderer.OverlayFace.bySide(facing, frontFacing);
        TextureAtlasSprite renderSprite = sprites.get(overlayFace);
        if (renderSprite != null) {
            Textures.renderFace(renderState, translation, pipeline, facing, bounds, renderSprite, BlockRenderLayer.CUTOUT_MIPPED);
            TextureAtlasSprite emissiveSprite = spritesEmissive.get(overlayFace);
            if (emissiveSprite != null && facing != frontFacing && facing != EnumFacing.UP && facing != EnumFacing.DOWN) {
                if (ConfigHolder.client.machinesEmissiveTextures) {
                    IVertexOperation[] lightPipeline = ArrayUtils.addAll(pipeline, new LightMapOperation(240, 240), new ColourOperation(0xffffffff));
                    Textures.renderFace(renderState, translation, lightPipeline, facing, bounds, emissiveSprite, BloomEffectUtil.getRealBloomLayer());
                } else {
                    Textures.renderFace(renderState, translation, ArrayUtils.add(pipeline, new ColourOperation(0xffffffff)), facing, bounds, emissiveSprite, BlockRenderLayer.CUTOUT_MIPPED);
                }
            }
        }
    }
}
Also used : IVertexOperation(codechicken.lib.render.pipeline.IVertexOperation) ColourOperation(gregtech.client.renderer.cclop.ColourOperation) LightMapOperation(gregtech.client.renderer.cclop.LightMapOperation) TextureAtlasSprite(net.minecraft.client.renderer.texture.TextureAtlasSprite) EnumFacing(net.minecraft.util.EnumFacing) OrientedOverlayRenderer(gregtech.client.renderer.texture.cube.OrientedOverlayRenderer) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 2 with ColourOperation

use of gregtech.client.renderer.cclop.ColourOperation in project GregTech by GregTechCEu.

the class LargeTurbineRenderer method renderSided.

@SideOnly(Side.CLIENT)
public void renderSided(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline, EnumFacing side, boolean hasBase, boolean hasRotor, boolean isActive, int rotorRGB) {
    Matrix4 cornerOffset = null;
    switch(side.getAxis()) {
        case X:
            cornerOffset = translation.copy().translate(0.01 * side.getXOffset(), -1.0, -1.0);
            cornerOffset.scale(1.0, 3.0, 3.0);
            break;
        case Z:
            cornerOffset = translation.copy().translate(-1.0, -1.0, 0.01 * side.getZOffset());
            cornerOffset.scale(3.0, 3.0, 1.0);
            break;
        case Y:
            cornerOffset = translation.copy().translate(-1.0, 0.01 * side.getYOffset(), -1.0);
            cornerOffset.scale(3.0, 1.0, 3.0);
            break;
    }
    if (hasBase) {
        Textures.renderFace(renderState, cornerOffset, ArrayUtils.addAll(pipeline, new LightMapOperation(240, 240)), side, Cuboid6.full, baseRingSprite, BlockRenderLayer.CUTOUT_MIPPED);
        Textures.renderFace(renderState, cornerOffset, ArrayUtils.addAll(pipeline, new LightMapOperation(240, 240), new ColourOperation(0xFFFFFFFF)), side, Cuboid6.full, baseBackgroundSprite, BlockRenderLayer.CUTOUT_MIPPED);
    }
    if (hasRotor) {
        TextureAtlasSprite sprite = isActive ? activeBladeSprite : idleBladeSprite;
        IVertexOperation[] color = ArrayUtils.add(pipeline, new ColourMultiplier(GTUtility.convertRGBtoOpaqueRGBA_CL(rotorRGB)));
        Textures.renderFace(renderState, cornerOffset, color, side, Cuboid6.full, sprite, BlockRenderLayer.CUTOUT_MIPPED);
    }
}
Also used : ColourOperation(gregtech.client.renderer.cclop.ColourOperation) IVertexOperation(codechicken.lib.render.pipeline.IVertexOperation) LightMapOperation(gregtech.client.renderer.cclop.LightMapOperation) TextureAtlasSprite(net.minecraft.client.renderer.texture.TextureAtlasSprite) Matrix4(codechicken.lib.vec.Matrix4) ColourMultiplier(codechicken.lib.render.pipeline.ColourMultiplier) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 3 with ColourOperation

use of gregtech.client.renderer.cclop.ColourOperation in project GregTech by GregTechCEu.

the class MetaTileEntityPrimitiveBlastFurnace method renderMetaTileEntity.

@Override
public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) {
    super.renderMetaTileEntity(renderState, translation, pipeline);
    getFrontOverlay().renderOrientedState(renderState, translation, pipeline, getFrontFacing(), recipeMapWorkable.isActive(), recipeMapWorkable.isWorkingEnabled());
    if (recipeMapWorkable.isActive() && isStructureFormed()) {
        EnumFacing back = getFrontFacing().getOpposite();
        Matrix4 offset = translation.copy().translate(back.getXOffset(), -0.3, back.getZOffset());
        CubeRendererState op = Textures.RENDER_STATE.get();
        Textures.RENDER_STATE.set(new CubeRendererState(op.layer, CubeRendererState.PASS_MASK, op.world));
        Textures.renderFace(renderState, offset, ArrayUtils.addAll(pipeline, new LightMapOperation(240, 240), new ColourOperation(0xFFFFFFFF)), EnumFacing.UP, Cuboid6.full, TextureUtils.getBlockTexture("lava_still"), BloomEffectUtil.getRealBloomLayer());
        Textures.RENDER_STATE.set(op);
    }
}
Also used : ColourOperation(gregtech.client.renderer.cclop.ColourOperation) CubeRendererState(gregtech.client.renderer.CubeRendererState) LightMapOperation(gregtech.client.renderer.cclop.LightMapOperation) EnumFacing(net.minecraft.util.EnumFacing) Matrix4(codechicken.lib.vec.Matrix4)

Aggregations

ColourOperation (gregtech.client.renderer.cclop.ColourOperation)3 LightMapOperation (gregtech.client.renderer.cclop.LightMapOperation)3 IVertexOperation (codechicken.lib.render.pipeline.IVertexOperation)2 Matrix4 (codechicken.lib.vec.Matrix4)2 TextureAtlasSprite (net.minecraft.client.renderer.texture.TextureAtlasSprite)2 EnumFacing (net.minecraft.util.EnumFacing)2 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)2 ColourMultiplier (codechicken.lib.render.pipeline.ColourMultiplier)1 CubeRendererState (gregtech.client.renderer.CubeRendererState)1 OrientedOverlayRenderer (gregtech.client.renderer.texture.cube.OrientedOverlayRenderer)1