PDA

View Full Version : Exporting sRGB dds files for loading with GLI toolkit



mprime
02-25-2015, 06:56 AM
Not sure if this is the right place to ask this question, but here it goes.

I need to use proper color spaces in my next project, but I have problems with exporting compressed textures properly. I'm using GLI toolkit to load dds files. I've checked and seen that GLI is able to correctly process sRGB dds files. However, it requires data from the DXT10 header to determine if the texture is in linear or sRGB color space. And here's the problem - the software I tried (Nvidia Texture Tools from Ubuntu's repositories and GIMP's DDS plugin) seem to omit those headers and export the files like they were used in DirectX 9.

Naturally, I can manually check for what kind of texture is being loaded and change the flags myself:


// if flag is GL_COMPRESSED_RGB_S3TC_DXT1_EXT, replace it with GL_COMPRESSED_SRGB_S3TC_DXT1_EXT
int overridingFlag = (0x83F0 == gli::internal_format(Texture.format())) ? 0x8C4C : gli::internal_format(Texture.format());

This gives me the correct results, however, if I, or someone working with me, ever starts mixing textures that are in linear space with textres that are in sRGB space, this approach would start causing major headaches.

So, here's the question - what tool should I use (preferably one that works on Linux) to export dds files that DO have the DXT10 headers?

kaufenpreis
03-06-2015, 04:16 AM
Please write, did you find the way to decide your problem?

Groovounet
03-06-2015, 06:04 AM
Please write, did you find the way to decide your problem?

I uses PVRTexTool these days quite a lot to generate DDS files: http://community.imgtec.com/developers/powervr/tools/pvrtextool/
I am not sure whether it's available on Linux or not.

I think we need to move away from the DDS container and use the KTX container instead but I haven't even started implementing it for GLI.