Posted September 29, 20196 yr 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?
September 29, 20196 yr 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 September 30, 20196 yr 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.