Jump to content

Recommended Posts

Posted

Hey, I seem to be having a problem with rendering my TESR. It only renders the outline if a mob is in my view. It use to work fine on 1.6.4 but since I've updated to 1.7.2, it has changed.

 

I've also correctly made sure I'm binding it correctly and that it renders past the standard limit.

 

In ClientProxy

ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBuildingBlock.class, new OutlineRenderer());

 

In TileEntity

@Override
public double getMaxRenderDistanceSquared()
{
return 16384D;
}

@Override
@SideOnly(Side.CLIENT)
public AxisAlignedBB getRenderBoundingBox()
{
return INFINITE_EXTENT_AABB;
}

 

width=800 height=449https://dl.dropboxusercontent.com/s/4fm4onyzlnkr3s6/2014-03-17_18.40.08.png[/img]

width=800 height=449https://dl.dropboxusercontent.com/s/zg38ka0fs36q461/2014-03-17_18.40.10.png[/img]

 

If you have any answers to why this might be happening, let me know!

Posted

This is the only other relevant code besides the one I posted above.

package com.mrcrayfish.construction.client.render;

import org.lwjgl.opengl.GL11;

import com.mrcrayfish.construction.tileentity.TileEntityBuildingBlock;

import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;

public class OutlineRenderer extends TileEntitySpecialRenderer
{
    @Override
    public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f)
    {
TileEntityBuildingBlock tebb = (TileEntityBuildingBlock) tileentity;
if (tebb.renderOn)
{
    int metadata = tebb.getWorldObj().getBlockMetadata(tebb.xCoord, tebb.yCoord, tebb.zCoord);

    int width = tebb.width - 2;
    int height = tebb.height - 2;
    int depth = tebb.depth - 2;

    int offsetX = 0;
    int offsetY = tebb.offsetY;
    int offsetZ = 0;

    int colour = tebb.lineColours[tebb.count];

    if (metadata == 2)
    {
	offsetX = -tebb.offsetZ - width - 1;
	offsetZ = tebb.offsetX;
	offsetX -= tebb.bOffsetZ;
	offsetZ += tebb.bOffsetX;
    }
    if (metadata == 5)
    {
	int temp = width;
	width = height;
	height = temp;
	offsetX = -tebb.offsetX - (width + 1);
	offsetZ = -tebb.offsetZ - (height + 1);
	offsetX -= tebb.bOffsetX;
	offsetZ -= tebb.bOffsetZ;
    }
    if (metadata == 3)
    {
	offsetX = tebb.offsetZ;
	offsetZ = -tebb.offsetX - (height + 1);
	offsetX += tebb.bOffsetZ;
	offsetZ -= tebb.bOffsetX;
    }
    if (metadata == 4)
    {
	int temp = width;
	width = height;
	height = temp;
	offsetX = tebb.offsetX;
	offsetZ = tebb.offsetZ;
	offsetX += tebb.bOffsetX;
	offsetZ += tebb.bOffsetZ;
    }

    offsetY += tebb.bOffsetY;

    if (tebb.hasDrawnBlueprint)
    {
	Tessellator tessellator = Tessellator.instance;
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glDisable(GL11.GL_LIGHTING);
	GL11.glDisable(GL11.GL_CULL_FACE);
	GL11.glDisable(GL11.GL_TEXTURE_2D);

	if (tebb.renderAll) GL11.glDisable(GL11.GL_DEPTH_TEST);

	GL11.glLineWidth(5F);
	tessellator.startDrawing(3);
	tessellator.setColorOpaque_I(colour);
	tessellator.setBrightness(255);
	tessellator.addVertex(x + 0.5D + offsetX, y + 0.5D + offsetY, z + 0.5D + offsetZ);
	tessellator.addVertex(x + width + 1.5D + offsetX, y + 0.5D + offsetY, z + 0.5D + offsetZ);
	tessellator.draw();
	tessellator.startDrawing(3);
	tessellator.setColorOpaque_I(colour);
	tessellator.setBrightness(255);
	tessellator.addVertex(x + 0.5D + offsetX, y + 0.5D + offsetY, z + 0.5D + offsetZ);
	tessellator.addVertex(x + 0.5D + offsetX, y + 0.5D + offsetY, z + 1.5D + height + offsetZ);
	tessellator.draw();
	tessellator.startDrawing(3);
	tessellator.setColorOpaque_I(colour);
	tessellator.setBrightness(255);
	tessellator.addVertex(x + 0.5D + offsetX, y + 0.5D + offsetY, z + 0.5D + offsetZ);
	tessellator.addVertex(x + 0.5D + offsetX, y + 0.5D + depth + offsetY, z + 0.5D + offsetZ);
	tessellator.draw();
	tessellator.startDrawing(3);
	tessellator.setColorOpaque_I(colour);
	tessellator.setBrightness(255);
	tessellator.addVertex(x + width + 1.5D + offsetX, y + depth + 0.5D + offsetY, z + height + 1.5D + offsetZ);
	tessellator.addVertex(x + 0.5D + offsetX, y + depth + 0.5D + offsetY, z + height + 1.5D + offsetZ);
	tessellator.draw();
	tessellator.startDrawing(3);
	tessellator.setColorOpaque_I(colour);
	tessellator.setBrightness(255);
	tessellator.addVertex(x + width + 1.5D + offsetX, y + depth + 0.5D + offsetY, z + height + 1.5D + offsetZ);
	tessellator.addVertex(x + width + 1.5D + offsetX, y + depth + 0.5D + offsetY, z + 0.5D + offsetZ);
	tessellator.draw();
	tessellator.startDrawing(3);
	tessellator.setColorOpaque_I(colour);
	tessellator.setBrightness(255);
	tessellator.addVertex(x + width + 1.5D + offsetX, y + depth + 0.5D + offsetY, z + height + 1.5D + offsetZ);
	tessellator.addVertex(x + width + 1.5D + offsetX, y + 0.5D + offsetY, z + height + 1.5D + offsetZ);
	tessellator.draw();
	tessellator.startDrawing(3);
	tessellator.setColorOpaque_I(colour);
	tessellator.setBrightness(255);
	tessellator.addVertex(x + 0.5D + offsetX, y + depth + 0.5D + offsetY, z + 0.5D + offsetZ);
	tessellator.addVertex(x + width + 1.5D + offsetX, y + depth + 0.5D + offsetY, z + 0.5D + offsetZ);
	tessellator.draw();
	tessellator.startDrawing(3);
	tessellator.setColorOpaque_I(colour);
	tessellator.setBrightness(255);
	tessellator.addVertex(x + 0.5D + offsetX, y + 0.5D + depth + offsetY, z + 0.5D + offsetZ);
	tessellator.addVertex(x + 0.5D + offsetX, y + 0.5D + depth + offsetY, z + 1.5D + height + offsetZ);
	tessellator.draw();
	tessellator.startDrawing(3);
	tessellator.setColorOpaque_I(colour);
	tessellator.setBrightness(255);
	tessellator.addVertex(x + width + 1.5D + offsetX, y + 0.5D + offsetY, z + 0.5D + offsetZ);
	tessellator.addVertex(x + width + 1.5D + offsetX, y + depth + 0.5D + offsetY, z + 0.5D + offsetZ);
	tessellator.draw();
	tessellator.startDrawing(3);
	tessellator.setColorOpaque_I(colour);
	tessellator.setBrightness(255);
	tessellator.addVertex(x + 0.5D + offsetX, y + 0.5D + offsetY, z + 1.5D + height + offsetZ);
	tessellator.addVertex(x + 0.5D + offsetX, y + 0.5D + depth + offsetY, z + 1.5D + height + offsetZ);
	tessellator.draw();
	tessellator.startDrawing(3);
	tessellator.setColorOpaque_I(colour);
	tessellator.setBrightness(255);
	tessellator.addVertex(x + width + 1.5D + offsetX, y + 0.5D + offsetY, z + height + 1.5D + offsetZ);
	tessellator.addVertex(x + 0.5D + offsetX, y + 0.5D + offsetY, z + height + 1.5D + offsetZ);
	tessellator.draw();
	tessellator.startDrawing(3);
	tessellator.setColorOpaque_I(colour);
	tessellator.setBrightness(255);
	tessellator.addVertex(x + width + 0.5D + 1.0D + offsetX, y + 0.5D + offsetY, z + height + 0.5D + 1.0D + offsetZ);
	tessellator.addVertex(x + width + 0.5D + 1.0D + offsetX, y + 0.5D + offsetY, z + 0.5D + offsetZ);
	tessellator.draw();

	if (tebb.renderAll) GL11.glEnable(GL11.GL_DEPTH_TEST);

	GL11.glEnable(GL11.GL_LIGHTING);
	GL11.glEnable(GL11.GL_TEXTURE_2D);
    }
}
    }

}

Posted

Hi

 

I'd guess that probably one of the OpenGL flags isn't set right.

 

Perhaps

    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

?

 

I wrote a brief class to print the current OpenGL settings, that might help figure out which flag(s) are different when the mob is in view vs when it isn't in view.

Some more info here plus the link

http://www.minecraftforge.net/forum/index.php/topic,16562.msg84272.html#msg84272

 

-TGG

Posted

Just tried the flag but didn't make any difference.

 

I also used your debugger, outputs were both the same.

 

When looking at mobs

 

GL_VERTEX_ARRAY:false (Vertex array enable)
GL_NORMAL_ARRAY:false (Normal array enable)
GL_COLOR_ARRAY:false (RGBA color array enable)
GL_INDEX_ARRAY:false (Color-index array enable)
GL_TEXTURE_COORD_ARRAY:false (Texture coordinate array enable)
GL_EDGE_FLAG_ARRAY:false (Edge flag array enable)
GL_NORMALIZE:false (Current normal normalization on/off)
GL_FOG:true (True if fog enabled)
GL_LIGHTING:true (True if lighting is enabled)
GL_COLOR_MATERIAL:true (True if color tracking is enabled)
GL_LIGHT0:true (True if light 0 enabled)
GL_LIGHT1:true (True if light 1 enabled)
GL_LIGHT2:false (True if light 2 enabled)
GL_LIGHT3:false (True if light 3 enabled)
GL_LIGHT4:false (True if light 4 enabled)
GL_LIGHT5:false (True if light 5 enabled)
GL_LIGHT6:false (True if light 6 enabled)
GL_LIGHT7:false (True if light 7 enabled)
GL_POINT_SMOOTH:false (Point antialiasing on)
GL_LINE_SMOOTH:false (Line antialiasing on)
GL_LINE_STIPPLE:false (Line stipple enable)
GL_CULL_FACE:true (Polygon culling enabled)
GL_POLYGON_SMOOTH:false (Polygon antialiasing on)
GL_POLYGON_OFFSET_POINT:false (Polygon offset enable for GL_POINT mode rasterization)
GL_POLYGON_OFFSET_LINE:false (Polygon offset enable for GL_LINE mode rasterization)
GL_POLYGON_OFFSET_FILL:false (Polygon offset enable for GL_FILL mode rasterization)
GL_POLYGON_STIPPLE:false (Polygon stipple enable)
GL_TEXTURE_1D:false (True if 1-D texturing enabled )
GL_TEXTURE_2D:true (True if 2-D texturing enabled )
GL_TEXTURE_GEN_S:false (Texgen enabled (x is S, T, R, or Q))
GL_TEXTURE_GEN_T:false (Texgen enabled (x is S, T, R, or Q))
GL_TEXTURE_GEN_R:false (Texgen enabled (x is S, T, R, or Q))
GL_TEXTURE_GEN_Q:false (Texgen enabled (x is S, T, R, or Q))
GL_SCISSOR_TEST:false (Scissoring enabled)
GL_ALPHA_TEST:true (Alpha test enabled)
GL_STENCIL_TEST:false (Stenciling enabled)
GL_DEPTH_TEST:true (Depth buffer enabled)
GL_BLEND:false (Blending enabled)
GL_DITHER:true (Dithering enabled)
GL_INDEX_LOGIC_OP:false (Color index logical operation enabled)
GL_COLOR_LOGIC_OP:false (RGBA color logical operation enabled)
GL_AUTO_NORMAL:false (True if automatic normal generation enabled)

 

 

When not looking at mobs

 

GL_VERTEX_ARRAY:false (Vertex array enable)
GL_NORMAL_ARRAY:false (Normal array enable)
GL_COLOR_ARRAY:false (RGBA color array enable)
GL_INDEX_ARRAY:false (Color-index array enable)
GL_TEXTURE_COORD_ARRAY:false (Texture coordinate array enable)
GL_EDGE_FLAG_ARRAY:false (Edge flag array enable)
GL_NORMALIZE:false (Current normal normalization on/off)
GL_FOG:true (True if fog enabled)
GL_LIGHTING:true (True if lighting is enabled)
GL_COLOR_MATERIAL:true (True if color tracking is enabled)
GL_LIGHT0:true (True if light 0 enabled)
GL_LIGHT1:true (True if light 1 enabled)
GL_LIGHT2:false (True if light 2 enabled)
GL_LIGHT3:false (True if light 3 enabled)
GL_LIGHT4:false (True if light 4 enabled)
GL_LIGHT5:false (True if light 5 enabled)
GL_LIGHT6:false (True if light 6 enabled)
GL_LIGHT7:false (True if light 7 enabled)
GL_POINT_SMOOTH:false (Point antialiasing on)
GL_LINE_SMOOTH:false (Line antialiasing on)
GL_LINE_STIPPLE:false (Line stipple enable)
GL_CULL_FACE:true (Polygon culling enabled)
GL_POLYGON_SMOOTH:false (Polygon antialiasing on)
GL_POLYGON_OFFSET_POINT:false (Polygon offset enable for GL_POINT mode rasterization)
GL_POLYGON_OFFSET_LINE:false (Polygon offset enable for GL_LINE mode rasterization)
GL_POLYGON_OFFSET_FILL:false (Polygon offset enable for GL_FILL mode rasterization)
GL_POLYGON_STIPPLE:false (Polygon stipple enable)
GL_TEXTURE_1D:false (True if 1-D texturing enabled )
GL_TEXTURE_2D:true (True if 2-D texturing enabled )
GL_TEXTURE_GEN_S:false (Texgen enabled (x is S, T, R, or Q))
GL_TEXTURE_GEN_T:false (Texgen enabled (x is S, T, R, or Q))
GL_TEXTURE_GEN_R:false (Texgen enabled (x is S, T, R, or Q))
GL_TEXTURE_GEN_Q:false (Texgen enabled (x is S, T, R, or Q))
GL_SCISSOR_TEST:false (Scissoring enabled)
GL_ALPHA_TEST:true (Alpha test enabled)
GL_STENCIL_TEST:false (Stenciling enabled)
GL_DEPTH_TEST:true (Depth buffer enabled)
GL_BLEND:false (Blending enabled)
GL_DITHER:true (Dithering enabled)
GL_INDEX_LOGIC_OP:false (Color index logical operation enabled)
GL_COLOR_LOGIC_OP:false (RGBA color logical operation enabled)
GL_AUTO_NORMAL:false (True if automatic normal generation enabled)

 

Posted

I found the problem. I took a look at the rendering of the beacon beam. Just played around with chucking some of the flags from that render. I needed to add this flag in.

GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);

 

Thanks for your help anyway :)

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.