Search in sources :

Example 16 with IVertexOperation

use of codechicken.lib.render.pipeline.IVertexOperation 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 IVertexOperation

use of codechicken.lib.render.pipeline.IVertexOperation 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 IVertexOperation

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

the class MetaTileEntityPump method renderMetaTileEntity.

@Override
@SideOnly(Side.CLIENT)
public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) {
    super.renderMetaTileEntity(renderState, translation, pipeline);
    ColourMultiplier multiplier = new ColourMultiplier(GTUtility.convertRGBtoOpaqueRGBA_CL(getPaintingColorForRendering()));
    IVertexOperation[] coloredPipeline = ArrayUtils.add(pipeline, multiplier);
    for (EnumFacing renderSide : EnumFacing.HORIZONTALS) {
        if (renderSide == getFrontFacing()) {
            Textures.PIPE_OUT_OVERLAY.renderSided(renderSide, renderState, translation, pipeline);
        } else {
            Textures.ADV_PUMP_OVERLAY.renderSided(renderSide, renderState, translation, coloredPipeline);
        }
    }
    Textures.SCREEN.renderSided(EnumFacing.UP, renderState, translation, pipeline);
    Textures.PIPE_IN_OVERLAY.renderSided(EnumFacing.DOWN, renderState, translation, pipeline);
}
Also used : IVertexOperation(codechicken.lib.render.pipeline.IVertexOperation) EnumFacing(net.minecraft.util.EnumFacing) ColourMultiplier(codechicken.lib.render.pipeline.ColourMultiplier) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 19 with IVertexOperation

use of codechicken.lib.render.pipeline.IVertexOperation 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)

Example 20 with IVertexOperation

use of codechicken.lib.render.pipeline.IVertexOperation 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)

Aggregations

IVertexOperation (codechicken.lib.render.pipeline.IVertexOperation)23 ColourMultiplier (codechicken.lib.render.pipeline.ColourMultiplier)16 EnumFacing (net.minecraft.util.EnumFacing)8 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)8 TextureAtlasSprite (net.minecraft.client.renderer.texture.TextureAtlasSprite)7 CCRenderState (codechicken.lib.render.CCRenderState)6 Matrix4 (codechicken.lib.vec.Matrix4)6 Cuboid6 (codechicken.lib.vec.Cuboid6)4 Translation (codechicken.lib.vec.Translation)4 IconTransformation (codechicken.lib.vec.uv.IconTransformation)4 BlockRenderLayer (net.minecraft.util.BlockRenderLayer)4 ICoverable (gregtech.api.cover.ICoverable)3 Material (gregtech.api.unification.material.type.Material)3 CCModel (codechicken.lib.render.CCModel)2 ArrayList (java.util.ArrayList)2 I3DOperation (logisticspipes.proxy.object3d.interfaces.I3DOperation)2 IndexedCuboid6 (codechicken.lib.raytracer.IndexedCuboid6)1 BakingVertexBuffer (codechicken.lib.render.buffer.BakingVertexBuffer)1 Rotation (codechicken.lib.vec.Rotation)1 Scale (codechicken.lib.vec.Scale)1