Hello,
There is a serious bug in loading compressed (like DDS) images as cubemap faces.
The error is in LWJGLTextureState.java (int JOGL too) around line 743:
Here is what we got for cubemap:
ARBTextureCompression.glCompressedTexImage2DARB(
getGLCubeMapFace(face),
m,
TextureStateRecord
.getGLDataFormat(image
.getFormat()),
width, height,
hasBorder ? 1 : 0, data);
You should rather use following:
ARBTextureCompression.glCompressedTexImage2DARB(
getGLCubeMapFace(face),
m,
TextureStateRecord
.getGLDataFormat(image
.getFormat()),
width, height,
hasBorder ? 1 : 0,
image.getData(face.ordinal()));
But is still doesn't solve the problem is images contains mipmaps. For this you have to rework from scratch entire loop here.
Hope that helps in fixing bug.
Thanks,
Konrad.
Actually I got cubemaps to work with DXT. But there are two bugs:
- You can't flip DXT images, so DXT compressed cubemaps loaded from DDS files will look wrong.
- Mipmaps don't work when used with cubemaps. If you enable Nearest/LinearMipmaps in the mini filter, the PositiveX (first image) is used for all faces in the cubemap.
Maybe you're right, but for me it makes no sense to use cubemap without mipmaps That's why I wrote about this problem and possible solution for it.
Thanks,
Konrad