- OpenGL compresses textures very slowly, maybe I should write my own compression code
You are suppose to send the DDS raw data to GL. GL will not decompress or recompress. It is fast.
- OpenGL compresses textures very slowly, maybe I should write my own compression code
Thanks for replays. I'll investigate GL_BGRA for sure as I'm using RGBA at this point. Most of textures are in jpeg format so switch to DDS means much larger files. One odf the features of DDS files is it contains mip maps but that means +50% larger files.
I have played a little with this issue. I cannot use DDS files, because I want source data to be as small as possible to minimize download time. What I found is:
- OpenGL compresses textures very slowly, maybe I should write my own compression code.
- If I switch compression off glTexImage2D is still relatively slow.
- gluBuild2DMipmaps is much slower than generating mipmaps on client side and calling glTexImage2D for each mipmap level.
So my questions now are:
- Is there a third party library of some kind that can compress textures fast ?
- Why is glTexImage2D so slow ? it takes 3 sec for a ~2500 calls (with mipmaps and with out compresson) that is extreamly slow for just coping data.
But I am using ::glTexParameteri( GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE );
[quote name='Kario' timestamp='1312735651' post='4845818']
I have played a little with this issue. I cannot use DDS files, because I want source data to be as small as possible to minimize download time. What I found is:
- OpenGL compresses textures very slowly, maybe I should write my own compression code.
- If I switch compression off glTexImage2D is still relatively slow.
- gluBuild2DMipmaps is much slower than generating mipmaps on client side and calling glTexImage2D for each mipmap level.
So my questions now are:
- Is there a third party library of some kind that can compress textures fast ?
- Why is glTexImage2D so slow ? it takes 3 sec for a ~2500 calls (with mipmaps and with out compresson) that is extreamly slow for just coping data.
That brings me to DDS again. I'm quite surprised that you found DDS files to be excessively large. It will give you between 8:1 and 4:1 compression over TGA, so unless you're using something like PNG as your image format (which will also contribute to slowness as it needs to be decompressed before being sent through glTexImage2D) DDS should be optimal.
Using JPEGs will definitely give you much slower loading times, by the way[/quote]
Depends where your bottle neck is. Sometimes PNG or JPEG decompression is faster than reading larger files off disk. In my experience JPEG decompression can be especially fast if the lib is hardware assisted.
I do have a question regarding DDS though, anyone know licensing issues and restrictions for using this format in commercial applications?
[quote name='Kario' timestamp='1312735651' post='4845818']
I have played a little with this issue. I cannot use DDS files, because I want source data to be as small as possible to minimize download time. What I found is:
- OpenGL compresses textures very slowly, maybe I should write my own compression code.
- If I switch compression off glTexImage2D is still relatively slow.
- gluBuild2DMipmaps is much slower than generating mipmaps on client side and calling glTexImage2D for each mipmap level.
So my questions now are:
- Is there a third party library of some kind that can compress textures fast ?
- Why is glTexImage2D so slow ? it takes 3 sec for a ~2500 calls (with mipmaps and with out compresson) that is extreamly slow for just coping data.
I do have a question regarding DDS though, anyone know licensing issues and restrictions for using this format in commercial applications?