Jump to content

Recommended Posts

Posted

Hi all,

 

I just want to apply a light level to 1 meta of a block so have used:

 

public int getLightValue(IBlockAccess world, int x, int y, int z) 
    {
    	this.setLightValue(world.getBlockMetadata(x, y, z) == 4 ? 1 : 0);
        return lightValue[blockID];
}

 

this works fine, however my texture has gone bright and really transparent, the block in question is a custom model and does have a slightly transparent texture (90&) the renderer is using GL11.glEnable(GL11.GL_BLEND); and GL11.glDisable(GL11.GL_BLEND); Im also calling adjustLightFixture in the renderer but not sure if I need to add something here to take into account the light level added.

Posted

Weird but ive removed that code and my models are still getting a bright VERY transparent version of my texture. They werent before....

 

ok so it seems that the GL blend and light values do not mix, does anyone know a solution to this issue?

Posted

Tried with a completely plain flat old texture does the same thing. If I add the GL11.glEnable(GL11.GL_BLEND); I get the nice transparency of my texture but the moment I set a light level it makes the texture go nuts, I cant seem to have both together, examples:

 

 

Heres my model with texture with just the light level set, no blend IN GL11

RCoLKdn.png

 

Heres my model with texture with the light level disabled and GL11 blnd turned on

XSpzXXS.png

 

Hers my model with both turned on

mqONeYi.png

 

Posted

You enabled GL_BLEND but you didn't set up a blend function.

Add

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

just after the GL_BLEND

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.

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.