|
I'm using
gl.glTexImage3D(GL3.GL_TEXTURE_2D_ARRAY, 0, GL3.GL_RGB, 64, 64, 5, 0, GL3.GL_RGB, GL3.GL_UNSIGNED_BYTE, null);
for(int i=0; i<5; i++)
{
data = ...
gl.glTexSubImage3D(GL3.GL_TEXTURE_2D_ARRAY, 0, 0, 0, i, 64, 64, 1, GL3.GL_BGR, GL3.GL_UNSIGNED_BYTE, data.getBuffer());
}
to load 5 64x64 png images into a 2D texture array. Note that glTexImage3D uses GL_RGB, but glTexSubImage3D uses GL_GBR. If I use GL_RGB in both calls, the images when displayed have their reds and blues swapped. I would expect that the format value in each call should be the same, but the code above works as-is.
What's going on here? What don't I understand?
(jogl-2.0-b23-20110303-windows-amd64 on Windows 7)
Thanks.
PJDM
|