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.

Does Optifine prevent you from using bindTexture() on things other than TextureMap.LOCATION_BLOCKS_TEXTURE

Featured Replies

Posted

My code:

public static ResourceLocation location = new ResourceLocation(MahouTsukaiMod.modId + ":textures/block/mahoujin_changeable.png")
IntBuffer colorBuf = BufferUtils.createIntBuffer(PIXEL_COUNT);

MahoujinData image = new MahoujinData(order);
this.bindTexture(location);

GlStateManager.glGetTexImage(GL11.GL_TEXTURE_2D, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, colorBuf);
colorBuf.get(image.colors);

 

 

This crashes at the last line with a BufferUnderflowException, only when Optifine is installed. I believe this means the "remaining" integers in colorBuf is less than the length of image.colors, even though I allocate colorBuf and image.colors with the width*height of the bound texture. So this tells me that glGetTexImage may be working differently and returning less pixels than the actual image's size in Optifine? I think the more likely case is that it's returning 0 pixels for some reason, since I'm using 

int side_size = GlStateManager.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH)
side_size = GlStateManager.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_HEIGHT);

to grab the width and height dynamically. Any ideas why it would do this?

  • Author

Nevermind, just learned this is a problem with Dynamic Texture in Optifine. DynamicTexture has an array 3x the size of what it should be when Optifine is installed... because Optifine is doing this 

new int[textureWidth * textureHeight * 3]

 

Edited by stepsword

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.