Java Code Examples for codechicken.lib.render.CCRenderState#setColour()

The following examples show how to use codechicken.lib.render.CCRenderState#setColour() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ItemTranslocatorRenderer.java    From Translocators with MIT License 6 votes vote down vote up
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
    Vector3 d = new Vector3();
    if (type != ItemRenderType.EQUIPPED && type != ItemRenderType.EQUIPPED_FIRST_PERSON)
        d.add(-0.5, -0.5, -0.5);
    else
        d.add(0, -0.2, -0.2);
    d.add(0, 0, 0.5);

    GL11.glPushMatrix();
    GL11.glScaled(1.5, 1.5, 1.5);

    CCRenderState.changeTexture("translocator:textures/tex.png");
    CCRenderState.pullLightmap();
    CCRenderState.setColour(-1);
    CCRenderState.useNormals = true;
    CCRenderState.startDrawing(4);
    TileTranslocatorRenderer.renderAttachment(2, item.getItemDamage(), 1, 0, d.x, d.y, d.z);
    CCRenderState.draw();

    GL11.glPopMatrix();
}
 
Example 2
Source File: RenderTracker.java    From WirelessRedstone with MIT License 6 votes vote down vote up
public void renderTracker(int freq)
{
    GL11.glDisable(GL11.GL_LIGHTING);

    TextureUtils.bindAtlas(0);
    CCRenderState.reset();
    CCRenderState.startDrawing(7);
    CCRenderState.setColour(0xFFFFFFFF);
    model.render(new IconTransformation(Blocks.obsidian.getIcon(0, 0)));
    CCRenderState.draw();
    
    Matrix4 pearlMat = CCModelLibrary.getRenderMatrix(
        new Vector3(0, 0.44+RedstoneEther.getSineWave(ClientUtils.getRenderTime(), 7)*0.02, 0),
        new Rotation(RedstoneEther.getRotation(ClientUtils.getRenderTime(), freq), new Vector3(0, 1, 0)),
        0.04);

    CCRenderState.changeTexture("wrcbe_core:textures/hedronmap.png");
    CCRenderState.startDrawing(4);
    CCRenderState.setColour(freq == 0 ? 0xC0C0C0FF : 0xFFFFFFFF);
    CCModelLibrary.icosahedron4.render(pearlMat);
    CCRenderState.draw();
    
    GL11.glEnable(GL11.GL_LIGHTING);
}
 
Example 3
Source File: LightMatrix.java    From CodeChickenLib with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public void operate() {
    LC lc = CCRenderState.lc;
    float[] a = ao(lc.side);
    float f = (a[0] * lc.fa + a[1] * lc.fb + a[2] * lc.fc + a[3] * lc.fd);
    int[] b = brightness(lc.side);
    CCRenderState.setColour(ColourRGBA.multiplyC(CCRenderState.colour, f));
    CCRenderState.setBrightness((int) (b[0] * lc.fa + b[1] * lc.fb + b[2] * lc.fc + b[3] * lc.fd) & 0xFF00FF);
}
 
Example 4
Source File: PlanarLightModel.java    From CodeChickenLib with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public void operate() {
    CCRenderState.setColour(ColourRGBA.multiply(CCRenderState.colour, colours[CCRenderState.side]));
}
 
Example 5
Source File: LightModel.java    From CodeChickenLib with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public void operate() {
    CCRenderState.setColour(apply(CCRenderState.colour, CCRenderState.normal));
}