Hi, I'm working on a (ComputerCraft controlled) hologram projector.
The hologram projector projects above it smaller versions of blocks which are set by a lua program, that runs on a computer.
The projector tile entity implements IWorldAccess, so before rendering the RenderBlocks BlockAccess will be swapped out with mine and then I render the block by using RenderStandardBlock.
My problem is that if the sky isn't occluded by other blocks, the model is displayed too dark, but the grass colors(and colors generally work). If the sky is rendered then the model renders with full brightness, but the colors aren't rendered.
I already tried to disable brightness with reflection and with a custom tessellator draw method, nothing of this worked.
Here is my rendering code:
TileEntity projector = tile.getWorldObj().getTileEntity(tile.xCoord, tile.yCoord - 1, tile.zCoord);
if (projector instanceof TileHologramProjector) {
Tessellator t = Tessellator.instance;
t.startDrawingQuads();
IBlockAccess backupAccess = RenderBlocks.getInstance().blockAccess;
RenderBlocks.getInstance().blockAccess = (IBlockAccess) projector;
try {
int previousVertexCount = fVertexCount.getInt(t);
for (int y1 = 0; y1 < TileHologramProjector.hologramHeight; y1++) {
for (int z1 = 0; z1 < TileHologramProjector.hologramDepth; z1++) {
for (int x1 = 0; x1 < TileHologramProjector.hologramWidth; x1++) {
RenderBlocks.getInstance().renderBlockByRenderType(
((TileHologramProjector) projector).getBlock(x1, y1, z1), x1, y1, z1);
if (fVertexCount.getInt(t) == previousVertexCount
&& !((TileHologramProjector) projector).isAirBlock(x1, y1, z1)) {
RenderBlocks.getInstance().renderStandardBlock(
((TileHologramProjector) projector).getBlock(x1, y1, z1), x1, y1, z1);
// RandomPeripherals.logger.info("Fallback
// renderer!");
}
previousVertexCount = fVertexCount.getInt(t);
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
RenderBlocks.getInstance().blockAccess = backupAccess;
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
GL11.glScalef(0.125f, 0.125f, 0.125f);
bindTexture(RandomPeripherals.proxy.blockResLoc);
t.draw();
GL11.glPopMatrix();
}