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);
}
}
}
}
}
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);
}
}
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);
}
}
Aggregations