Posted August 22, 201510 yr I am having problem with a custom rendering, I am using it to render blocks seemingly normally but with great diversity in a simple manner. The issue is that the sides come out darkened http://i1310.photobucket.com/albums/s644/EmperorZelos/2015-08-22_12.32.45_zpsvfkcwpoe.png[/img] Like this, this is my code package aerosteam.renderer.blocks; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.entity.item.EntityItem; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; import org.lwjgl.opengl.GL11; import aerosteam.AeroSteam; import aerosteam.model.blocks.ModelBarrel; import aerosteam.recipes.Beverages; import aerosteam.tileentity.TileEntityBarrel; public class RenderPipeBlock extends TileEntitySpecialRenderer{ float[] dx = {0.5F,0.5F,0F,0F,0.5F,0.5F}; float[] dy = {0F,0F,0.5F,0.5F,0.5F,0.5F}; float[] dz = {0.5F,0.5F,0.5F,0.5F,0F,0F}; Block test = Blocks.brick_block; public RenderPipeBlock(){ } @Override public void renderTileEntityAt(TileEntity entity, double x,double y, double z, float f) { //TileEntityBarrel barrel = (TileEntityBarrel) entity; IIcon icon = test.getIcon(5, 6); Tessellator t = Tessellator.instance; float minU = icon.getMinU(); float minV = icon.getMinV(); float maxU = icon.getMaxU(); float maxV = icon.getMaxV(); int sizeX = 16; int sizeY = 16; Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); GL11.glPushMatrix(); //GL11.glTranslatef((float)x+0.5F, (float)y+1.5F, (float)z+0.5F); //GL11.glRotatef(180, 0F, 0F, 1F); GL11.glTranslated(x, y, z); //GL11.glEnable(GL11.GL_BLEND); t.startDrawingQuads(); t.addVertexWithUV(1, 1, 0, minU, minV); //Top right t.addVertexWithUV(1, 0, 0, minU, maxV); //Bottom right t.addVertexWithUV(0, 0, 0, maxU, maxV); //Bottom left texture t.addVertexWithUV(0, 1, 0, maxU, minV); //Top left t.draw(); GL11.glPopMatrix(); } public void renderItem(TileEntity entity){ TileEntityBarrel ana = (TileEntityBarrel) entity; renderTileEntityAt(ana,0D,-0.5D,0D,0F); } } What is it missing that is causing this darkening? The "isOpaque" is set to false also.
August 23, 201510 yr Author I have noticed if I use GL11.glDisable(GL11.GL_LIGHTING); it looks good from the sides but underneath it gets too bright then.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.