use of codechicken.lib.render.pipeline.ColourMultiplier in project GregTech by GregTechCE.
the class FluidPipeRenderer method renderPipeBlock.
public boolean renderPipeBlock(Material material, FluidPipeType pipeType, int insulationColor, CCRenderState state, IVertexOperation[] pipeline, int connectMask) {
int pipeColor = GTUtility.convertRGBtoOpaqueRGBA_CL(getPipeColor(material, insulationColor));
ColourMultiplier multiplier = new ColourMultiplier(pipeColor);
PipeTextureInfo textureInfo = this.pipeTextures.get(pipeType);
PipeModelInfo modelInfo = this.pipeModels.get(pipeType);
IVertexOperation[] openingTexture = ArrayUtils.addAll(pipeline, new IconTransformation(textureInfo.inTexture), multiplier);
IVertexOperation[] sideTexture = ArrayUtils.addAll(pipeline, new IconTransformation(textureInfo.sideTexture), multiplier);
int sidedConnMask = connectMask & 0b111111;
CCModel fullBlockModel = null;
if (sidedConnMask == 0b000011) {
fullBlockModel = modelInfo.fullBlockModels[0];
} else if (sidedConnMask == 0b001100) {
fullBlockModel = modelInfo.fullBlockModels[1];
} else if (sidedConnMask == 0b110000) {
fullBlockModel = modelInfo.fullBlockModels[2];
}
if (fullBlockModel != null) {
state.setPipeline(fullBlockModel, 0, fullBlockModel.verts.length, sideTexture);
state.render();
return true;
}
Cuboid6 centerCuboid = BlockFluidPipe.getSideBox(null, pipeType.getThickness());
state.setPipeline(openingTexture);
BlockRenderer.renderCuboid(state, centerCuboid, 0);
for (EnumFacing side : EnumFacing.VALUES) {
if ((connectMask & 1 << side.getIndex()) > 0) {
CCModel model = modelInfo.connectionModels[side.getIndex()];
state.setPipeline(model, 0, model.verts.length, sideTexture);
state.render();
}
}
return true;
}
use of codechicken.lib.render.pipeline.ColourMultiplier in project GregTech by GregTechCE.
the class MetaTileEntityQuantumTank 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);
}
use of codechicken.lib.render.pipeline.ColourMultiplier in project GregTech by GregTechCE.
the class StoneRenderer method renderBlock.
@Override
public boolean renderBlock(IBlockAccess world, BlockPos pos, IBlockState state, BufferBuilder buffer) {
// otherwise, we are in solid rendering layer and render primary stone
CCRenderState renderState = CCRenderState.instance();
renderState.reset();
renderState.bind(buffer);
Matrix4 translation = new Matrix4();
translation.translate(pos.getX(), pos.getY(), pos.getZ());
TextureAtlasSprite stoneSprite = TextureUtils.getBlockTexture("stone");
Material material = ((BlockSurfaceRock) state.getBlock()).getStoneMaterial(world, pos, state);
int renderingColor = GTUtility.convertRGBtoOpaqueRGBA_CL(material.materialRGB);
IVertexOperation[] operations = new IVertexOperation[] { new IconTransformation(stoneSprite), new ColourMultiplier(renderingColor), new TransformationList(translation) };
if (world != null) {
renderState.setBrightness(world, pos);
}
renderState.setPipeline(operations);
CCModel actualModel = getActualModel(world, pos);
renderState.setModel(actualModel);
renderState.render();
return true;
}
use of codechicken.lib.render.pipeline.ColourMultiplier in project GregTech by GregTechCE.
the class TieredMetaTileEntity 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);
}
use of codechicken.lib.render.pipeline.ColourMultiplier in project GregTech by GregTechCE.
the class MetaTileEntity method renderMetaTileEntity.
/**
* Renders this meta tile entity
* Note that you shouldn't refer to world-related information in this method, because it
* will be called on ItemStacks too
*
* @param renderState render state (either chunk batched or item)
* @param pipeline default set of pipeline transformations
*/
@SideOnly(Side.CLIENT)
public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) {
TextureAtlasSprite atlasSprite = TextureUtils.getMissingSprite();
IVertexOperation[] renderPipeline = ArrayUtils.add(pipeline, new ColourMultiplier(GTUtility.convertRGBtoOpaqueRGBA_CL(getPaintingColorForRendering())));
for (EnumFacing face : EnumFacing.VALUES) {
Textures.renderFace(renderState, translation, renderPipeline, face, Cuboid6.full, atlasSprite);
}
}
Aggregations