PDA

View Full Version : S3TC/DXT compression by CPU in thread



Max Terentiev
02-20-2007, 10:59 AM
Hi,

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.

Zengar
02-20-2007, 11:10 AM
you can look at nvdxt or
http://www.sjbrown.co.uk/?code=squish

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.

CatAtWork
02-21-2007, 09:25 AM
Do you query the texture's internal format after it's created? What conditions make the driver reject compression?

Zengar
02-21-2007, 10:57 AM
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