Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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.

  • Author

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?

Light values shouldn't make your texture bright, it must be something wrong with the texture. Try re-creating the texture.

  • Author

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

 

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.