Login  Register

Re: Texture compression

Posted by elect on Dec 18, 2014; 1:42pm
URL: https://forum.jogamp.org/Texture-compression-tp4032185p4033782.html

The problem is, to create a DDSImage a need the byteBuffer[] array containing the mipmaps

I can get that from the textureData, but textureData *dont* really create the mipmaps

            textureData = TextureIO.newTextureData(gl3.getGLProfile(), file, true, TextureIO.PNG);
           
            System.out.println("textureData.getMipmap() "+textureData.getMipmap());
            System.out.println("textureData.getMipmapData().length "+textureData.getMipmapData().length);



This prints true and then crashes because textureData.getMipmapData().length is null

and if I look in the code, I reach the

    public TextureData newTextureData(GLProfile glp, File file,
                                      int internalFormat,
                                      int pixelFormat,
                                      boolean mipmap,
                                      String fileSuffix) throws IOException;

in the TextureProvider, but it has only methods in DDS/IIO/StreamBased TextureProvider, no PNG