Jump to content

[1.7.10] Custom Tile Entity Renderer has a shadowy overlay


Max9403

Recommended Posts

I'm creating a block and when the player is close or looks directly at my block the block has a shadowy overlay (it is meant to be completely white), this the code for my render:

@Override
    public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float scale) {
        Minecraft.getMinecraft().renderEngine.bindTexture(MainMod.RUNES.get(tileEntity.getBlockMetadata()).getTextureLocation());
        Tessellator tessellator = Tessellator.instance;
        GL11.glPushMatrix();
        GL11.glTranslated(x, y, z); // +1 so that our "drawing" appears 1 block over our block (to get a better view)
        tessellator.startDrawingQuads();

        tessellator.addVertexWithUV(0, 0.01, 1, 0, 0);
        tessellator.addVertexWithUV(1, 0.01, 1, 0, 1);
        tessellator.addVertexWithUV(1, 0.01, 0, 1, 1);
        tessellator.addVertexWithUV(0, 0.01, 0, 1, 0);

        tessellator.draw();
        GL11.glPopMatrix();
    }

 

My blocks source has the bounds of 0, 0, 0, 1, 0, 1

canRenderInPass is set to false,

shouldSideBeRendered is false,

isOpaqueCube is false

and renderAsNormalBlock is false

 

some screenshots:

With shadow:

3c29bf31ca.png

 

Without shadow:

c49e72407a.png

Link to comment
Share on other sites

Well.  You didn't say what's wrong, my guess is that it's rendering ALL of the shading when ANY block is looked at (based on your screenshots, also you shouldn't have turned off the GUI, because that removed the reticule).

 

You're missing the code-bit that deals with the "looking" in your post (probably the TileEntity).  So I can't be sure.

 

But it looks like you've got something static that shouldn't be.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

I'm not doing anything when it comes to checking if it is being looked at (it's more when looking downwards it happens, my mistake, not so much when my block is looked at).

btw this is my tile entity code:

 

public int runeType; //This only decides what image is shown
    @Override
    public void writeToNBT(NBTTagCompound par1)
    {
        super.writeToNBT(par1);
        par1.setInteger("runeType", runeType);
    }

    @Override
    public void readFromNBT(NBTTagCompound par1)
    {
        super.readFromNBT(par1);
        this.runeType = par1.getInteger("runeType");
    }

 

Here is the images with the UI:

e2177c6d54.png

e7dab89c7d.png

Link to comment
Share on other sites

Ok, now I know even LESS about your problem than I had before:

 

WTF are you trying to achieve that is not currently working?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Before the calls to

Tessellator#addVertexWithUV()

, add

Tessellator#setColorOpaque_F(1, 1, 1)

.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

That might have been a bit rude, but the point still stands, I don't want the shadowy overlay

 

He starts that it does and the pictures show it, but he doesn't actually state that that is the problem and that he wants it to go away.

 

The OP was equivalent to,  "the sky is blue."

 

Yes, yes it is. And..?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

@Draco18s if you don't have anything useful to post please don't post also btw what didn't you get from

I'm creating a block and when the player is close or looks directly at my block the block has a shadowy overlay (it is meant to be completely white), this the code for my render:

 

@larsgerrits any other idea what might be causing it?

 

Link to comment
Share on other sites

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.

 

Good day, sir.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Hi

 

When you tried Lars' suggestion, did you do

 

          tessellator.startDrawingQuads();

            tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F);

 

or

            tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F);

          tessellator.startDrawingQuads();

 

?  The first one is the correct one.

 

You could also try

 

      GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
    GL11.glDisable(GL11.GL_LIGHTING);

all your rendering here

      GL11.glPopAttrib();

-TGG

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...

Important Information

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