use of codechicken.lib.render.pipeline.ColourMultiplier in project GregTech by GregTechCE.
the class TieredMetaTileEntity method renderMetaTileEntity.
@Override
public void renderMetaTileEntity(CCRenderState renderState, IVertexOperation[] pipeline) {
IVertexOperation[] colouredPipeline = ArrayUtils.add(pipeline, new ColourMultiplier(paintingColor));
Textures.VOLTAGE_CASINGS[tier].render(renderState, colouredPipeline);
}
use of codechicken.lib.render.pipeline.ColourMultiplier in project GregTech by GregTechCE.
the class ICoverable method renderCovers.
@SideOnly(Side.CLIENT)
default void renderCovers(CCRenderState renderState, Matrix4 translation, BlockRenderLayer layer) {
renderState.lightMatrix.locate(getWorld(), getPos());
double coverPlateThickness = getCoverPlateThickness();
IVertexOperation[] platePipeline = new IVertexOperation[] { new ColourMultiplier(GTUtility.convertRGBtoOpaqueRGBA_CL(getPaintingColor())) };
IVertexOperation[] coverPipeline = new IVertexOperation[] { renderState.lightMatrix };
for (EnumFacing sideFacing : EnumFacing.values()) {
CoverBehavior coverBehavior = getCoverAtSide(sideFacing);
if (coverBehavior == null)
continue;
Cuboid6 plateBox = getCoverPlateBox(sideFacing, coverPlateThickness);
if (coverBehavior.canRenderInLayer(layer) && coverPlateThickness > 0) {
renderState.preRenderWorld(getWorld(), getPos());
coverBehavior.renderCoverPlate(renderState, translation, platePipeline, plateBox, layer);
}
if (coverBehavior.canRenderInLayer(layer)) {
coverBehavior.renderCover(renderState, translation.copy(), coverPipeline, plateBox, layer);
if (coverPlateThickness == 0.0 && shouldRenderBackSide() && coverBehavior.canRenderBackside()) {
// machine is full block, but still not opaque - render cover on the back side too
Matrix4 backTranslation = translation.copy();
if (sideFacing.getAxis().isVertical()) {
REVERSE_VERTICAL_ROTATION.apply(backTranslation);
} else {
REVERSE_HORIZONTAL_ROTATION.apply(backTranslation);
}
backTranslation.translate(-sideFacing.getXOffset(), -sideFacing.getYOffset(), -sideFacing.getZOffset());
coverBehavior.renderCover(renderState, backTranslation, coverPipeline, plateBox, layer);
}
}
}
}
use of codechicken.lib.render.pipeline.ColourMultiplier in project GregTech by GregTechCE.
the class MetaTileEntityLockedSafe method renderMetaTileEntityFast.
@Override
public void renderMetaTileEntityFast(CCRenderState renderState, Matrix4 translation, float partialTicks) {
ColourMultiplier colourMultiplier = new ColourMultiplier(GTUtility.convertRGBtoOpaqueRGBA_CL(GTValues.VC[unlockComponentTier]));
float angle = prevDoorAngle + (doorAngle - prevDoorAngle) * partialTicks;
angle = 1.0f - (1.0f - angle) * (1.0f - angle) * (1.0f - angle);
float resultDoorAngle = angle * 120.0f;
Textures.SAFE.render(renderState, translation, new IVertexOperation[] { colourMultiplier }, getFrontFacing(), resultDoorAngle);
}
use of codechicken.lib.render.pipeline.ColourMultiplier in project GregTech by GregTechCE.
the class MetaTileEntityChest method renderMetaTileEntityFast.
@Override
public void renderMetaTileEntityFast(CCRenderState renderState, Matrix4 translation, float partialTicks) {
float angle = prevLidAngle + (lidAngle - prevLidAngle) * partialTicks;
angle = 1.0f - (1.0f - angle) * (1.0f - angle) * (1.0f - angle);
float resultLidAngle = angle * 90.0f;
if (ModHandler.isMaterialWood(material)) {
ColourMultiplier multiplier = new ColourMultiplier(GTUtility.convertRGBtoOpaqueRGBA_CL(getPaintingColorForRendering()));
Textures.WOODEN_CHEST.render(renderState, translation, new IVertexOperation[] { multiplier }, getFrontFacing(), resultLidAngle);
} else {
ColourMultiplier multiplier = new ColourMultiplier(ColourRGBA.multiply(GTUtility.convertRGBtoOpaqueRGBA_CL(material.materialRGB), GTUtility.convertRGBtoOpaqueRGBA_CL(getPaintingColorForRendering())));
Textures.METAL_CHEST.render(renderState, translation, new IVertexOperation[] { multiplier }, getFrontFacing(), resultLidAngle);
}
}
use of codechicken.lib.render.pipeline.ColourMultiplier in project GregTech by GregTechCE.
the class CableRenderer method renderCableBlock.
public void renderCableBlock(Material material, Insulation insulation1, int insulationColor1, CCRenderState state, IVertexOperation[] pipeline, int connectMask) {
int wireColor = GTUtility.convertRGBtoOpaqueRGBA_CL(material.materialRGB);
float thickness = insulation1.thickness;
IVertexOperation[] wire = ArrayUtils.addAll(pipeline, new IconTransformation(wireTexture), new ColourMultiplier(wireColor));
IVertexOperation[] overlays = wire;
IVertexOperation[] insulation = wire;
if (insulation1.insulationLevel != -1) {
int insulationColor = GTUtility.convertRGBtoOpaqueRGBA_CL(insulationColor1);
ColourMultiplier multiplier = new ColourMultiplier(insulationColor);
insulation = ArrayUtils.addAll(pipeline, new IconTransformation(insulationTextures[5]), multiplier);
overlays = ArrayUtils.addAll(pipeline, new IconTransformation(insulationTextures[insulation1.insulationLevel]), multiplier);
}
Cuboid6 cuboid6 = BlockCable.getSideBox(null, thickness);
for (EnumFacing renderedSide : EnumFacing.VALUES) {
if ((connectMask & 1 << renderedSide.getIndex()) == 0) {
int oppositeIndex = renderedSide.getOpposite().getIndex();
if ((connectMask & 1 << oppositeIndex) > 0 && (connectMask & ~(1 << oppositeIndex)) == 0) {
// if there is something on opposite side, render overlay + wire
renderCableSide(state, wire, renderedSide, cuboid6);
renderCableSide(state, overlays, renderedSide, cuboid6);
} else {
renderCableSide(state, insulation, renderedSide, cuboid6);
}
}
}
renderCableCube(connectMask, state, insulation, wire, overlays, EnumFacing.DOWN, thickness);
renderCableCube(connectMask, state, insulation, wire, overlays, EnumFacing.UP, thickness);
renderCableCube(connectMask, state, insulation, wire, overlays, EnumFacing.WEST, thickness);
renderCableCube(connectMask, state, insulation, wire, overlays, EnumFacing.EAST, thickness);
renderCableCube(connectMask, state, insulation, wire, overlays, EnumFacing.NORTH, thickness);
renderCableCube(connectMask, state, insulation, wire, overlays, EnumFacing.SOUTH, thickness);
}
Aggregations