S3TC/DXT compression by CPU in thread


How I can compress large textures to S3TC by CPU in separate thread ? It’s possible (maybe not via OpenGL, maybe third-party libraries available for compressing bmp to S3TC by CPU)?

I want to load textures from disk, compress it, build mipmaps in separate thread then feed result to OpenGL in main (rendering) thread.

I want it becuse my textures is large and I must avoid lags during loading/compressing.

Thanx for help.

you can look at nvdxt or

BTW, it is much more effective to compress the texture offline, store the compressed image in a file and upload it vie glCompressedTexImage call. And to my experience, even if you call glTexImage with compressed internal format, driver may choose not to compress the texture.

Do you query the texture’s internal format after it’s created? What conditions make the driver reject compression?

Well, I didn’t query the internal format, but there was no quality reduction in the image that supposedly should be compressed by the driver… On the other hand, the same texture compressed offline with hight quality compressor did show some reduction in quality. Also, there was no slowdown in downloading the texture as it would be expected if the compression was applied. My texture was simple bgra 512x512 image