Is there any way to blit a texture in opengl es 2.0 with a pitch that differs from its width. Normally I would fix this by using a PBO or adjusting the GL_PACK_ROW_LENGTH via glPixelStore. However it seems neither GL_PIXEL_UNPACK_BUFFER for binding a buffer to or GL_PACK_ROW_LENGTH exist on the Android platform.
glTex(Sub)Image2D does not support this.
Any tips?
Quoting @Halsafar
In some scenarios, this can be solved by adjusting texture coordinates.
Lets say I have a 512
x 512
texture pitched at 512
* bitdepth
but the data I want to use is pitched to 256
* bitdepth
I go ahead and glSubTexImage2D
still but adjust the texture coords to be 0
to (256/512
)
instead of 0
to 1
.
In other words strip off the part of the texture I'm not using.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With