Search in sources :

Example 16 with ColourMultiplier

use of codechicken.lib.render.pipeline.ColourMultiplier in project GregTech by GregTechCE.

the class SteamMetaTileEntity method renderMetaTileEntity.

@Override
public void renderMetaTileEntity(CCRenderState renderState, IVertexOperation[] pipeline) {
    IVertexOperation[] colouredPipeline = ArrayUtils.add(pipeline, new ColourMultiplier(paintingColor));
    if (isHighPressure) {
        Textures.STEAM_CASING_STEEL.render(renderState, colouredPipeline);
    } else
        Textures.STEAM_CASING_BRONZE.render(renderState, colouredPipeline);
    renderer.render(renderState, pipeline, getFrontFacing(), workableHandler.isActive());
}
Also used : IVertexOperation(codechicken.lib.render.pipeline.IVertexOperation) ColourMultiplier(codechicken.lib.render.pipeline.ColourMultiplier)

Example 17 with ColourMultiplier

use of codechicken.lib.render.pipeline.ColourMultiplier in project GregTech by GregTechCE.

the class SteamBoiler method renderMetaTileEntity.

@Override
public void renderMetaTileEntity(CCRenderState renderState, IVertexOperation[] pipeline) {
    IVertexOperation[] colouredPipeline = ArrayUtils.add(pipeline, new ColourMultiplier(paintingColor));
    if (isHighPressure) {
        Textures.STEAM_CASING_STEEL.render(renderState, colouredPipeline);
    } else
        Textures.STEAM_CASING_BRONZE.render(renderState, colouredPipeline);
    renderer.render(renderState, pipeline, getFrontFacing(), fuelBurnTimeLeft > 0);
}
Also used : IVertexOperation(codechicken.lib.render.pipeline.IVertexOperation) ColourMultiplier(codechicken.lib.render.pipeline.ColourMultiplier)

Example 18 with ColourMultiplier

use of codechicken.lib.render.pipeline.ColourMultiplier in project GregTech by GregTechCE.

the class TankRenderer method renderFluid.

@SideOnly(Side.CLIENT)
public void renderFluid(CCRenderState renderState, Matrix4 translation, int connectionMask, double fillPercent, FluidStack fluidStack) {
    if (fluidStack != null) {
        int fluidStackColor = fluidStack.getFluid().getColor(fluidStack);
        double fluidLevelOffset = (offset(EnumFacing.UP, connectionMask) + offset(EnumFacing.DOWN, connectionMask));
        double fluidLevel = fillPercent * (1.0 - fluidLevelOffset);
        Cuboid6 resultFluidCuboid = createFullOffsetCuboid(connectionMask);
        int resultFluidColor;
        if (fluidStack.getFluid().isGaseous(fluidStack)) {
            int opacity = (int) (fillPercent * 255);
            resultFluidColor = GTUtility.convertRGBtoRGBA_CL(fluidStackColor, opacity);
        } else {
            resultFluidCuboid.max.y = resultFluidCuboid.min.y + fluidLevel;
            resultFluidColor = GTUtility.convertRGBtoOpaqueRGBA_CL(fluidStackColor);
        }
        ColourMultiplier multiplier = new ColourMultiplier(resultFluidColor);
        IVertexOperation[] fluidPipeline = new IVertexOperation[] { multiplier };
        TextureAtlasSprite fluidSprite = TextureUtils.getTexture(fluidStack.getFluid().getStill(fluidStack));
        for (EnumFacing renderSide : EnumFacing.VALUES) {
            if (hasFaceBit(connectionMask, renderSide))
                continue;
            Textures.renderFace(renderState, translation, fluidPipeline, renderSide, resultFluidCuboid, fluidSprite);
        }
    }
}
Also used : IVertexOperation(codechicken.lib.render.pipeline.IVertexOperation) TextureAtlasSprite(net.minecraft.client.renderer.texture.TextureAtlasSprite) EnumFacing(net.minecraft.util.EnumFacing) Cuboid6(codechicken.lib.vec.Cuboid6) ColourMultiplier(codechicken.lib.render.pipeline.ColourMultiplier) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 19 with ColourMultiplier

use of codechicken.lib.render.pipeline.ColourMultiplier in project GregTech by GregTechCE.

the class MetaTileEntityQuantumChest method renderMetaTileEntity.

@Override
public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) {
    Textures.VOLTAGE_CASINGS[tier].render(renderState, translation, ArrayUtils.add(pipeline, new ColourMultiplier(GTUtility.convertRGBtoOpaqueRGBA_CL(getPaintingColorForRendering()))));
    translation.translate(0.5, 0.001, 0.5);
    translation.rotate(Math.toRadians(rotations[getFrontFacing().getIndex() - 2]), new Vector3(0.0, 1.0, 0.0));
    translation.translate(-0.5, 0.0, -0.5);
    Textures.SCREEN.renderSided(EnumFacing.UP, renderState, translation, pipeline);
}
Also used : Vector3(codechicken.lib.vec.Vector3) ColourMultiplier(codechicken.lib.render.pipeline.ColourMultiplier)

Example 20 with ColourMultiplier

use of codechicken.lib.render.pipeline.ColourMultiplier in project GregTech by GregTechCE.

the class SteamMetaTileEntity method renderMetaTileEntity.

@Override
public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) {
    IVertexOperation[] colouredPipeline = ArrayUtils.add(pipeline, new ColourMultiplier(GTUtility.convertRGBtoOpaqueRGBA_CL(getPaintingColorForRendering())));
    getBaseRenderer().render(renderState, translation, colouredPipeline);
    renderer.render(renderState, translation, pipeline, getFrontFacing(), workableHandler.isActive());
    Textures.PIPE_OUT_OVERLAY.renderSided(workableHandler.getVentingSide(), renderState, translation, pipeline);
}
Also used : IVertexOperation(codechicken.lib.render.pipeline.IVertexOperation) ColourMultiplier(codechicken.lib.render.pipeline.ColourMultiplier)

Aggregations

ColourMultiplier (codechicken.lib.render.pipeline.ColourMultiplier)21 IVertexOperation (codechicken.lib.render.pipeline.IVertexOperation)16 EnumFacing (net.minecraft.util.EnumFacing)7 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)7 TextureAtlasSprite (net.minecraft.client.renderer.texture.TextureAtlasSprite)5 Cuboid6 (codechicken.lib.vec.Cuboid6)3 IconTransformation (codechicken.lib.vec.uv.IconTransformation)3 CCModel (codechicken.lib.render.CCModel)2 CCRenderState (codechicken.lib.render.CCRenderState)2 Matrix4 (codechicken.lib.vec.Matrix4)2 Vector3 (codechicken.lib.vec.Vector3)2 IndexedCuboid6 (codechicken.lib.raytracer.IndexedCuboid6)1 BlockFace (codechicken.lib.render.BlockRenderer.BlockFace)1 TransformationList (codechicken.lib.vec.TransformationList)1 Translation (codechicken.lib.vec.Translation)1 Material (gregtech.api.unification.material.type.Material)1 BlockSurfaceRock (gregtech.common.blocks.surfacerock.BlockSurfaceRock)1 IBlockState (net.minecraft.block.state.IBlockState)1 Minecraft (net.minecraft.client.Minecraft)1 BlockRenderLayer (net.minecraft.util.BlockRenderLayer)1