Jump to content

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


Recommended Posts

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);

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



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?

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

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.

  • Create New...

Important Information

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