microsoft / DirectXTex

DirectXTex texture processing library
https://walbourn.github.io/directxtex/
MIT License
1.82k stars 447 forks source link

DirectX Texture Tool #61

Closed matt77hias closed 7 years ago

matt77hias commented 7 years ago

I use the DirectX Texture Tool obsolete GUI utility provided in the DirectX 9.0 SDK for generating and modifying textures for my Direct3D 11 programs (which I load via the the DDSTextureLoader). This tool allows to change the surface format of .dds textures, but unfortunately does not support sRGB formats. The DDSTextureLoader provides a forceSRGB option, but I rather have the sRGB encoding in the .dds texture itself. Does Microsoft provides a less obsolete GUI alternative for this utility?

Furthermore, surface formats like X8R8G8B8 and A8R8G8B8 (which do not literally map to a DXGI_FORMAT based on their name) are loaded correctly by the DDSTextureLoader, but some third-party utilities fail to recognize them (as opposed to DXT1 surface formats for example)?

walbourn commented 7 years ago

The situation here is summed up by this blog post. In short, most of the 'unsupported' scenarios you speak of are because we have to use the DX10 header extension for DDS files which is not supported by the legacy DirectX Texture Tool or many 3rd party tools. I've been trying to get 3rd party tools updated, which is happening more recently but is still a very slow process.

I have an open task to port or re-create a version of DXTex.exe using DirectXTex. It's just not made the top of my todo list in many years.

Note that Visual Studio 2012 or later Image Editor does support modern DDS files because it already uses DirectXTex, so at least for viewing 2D textures it's a good choice.

matt77hias commented 7 years ago

Thanks for the answer and references.

matt77hias commented 6 years ago

My apologies for extending this closed and old issue, but recently I had some problems related to sRGB texture formats, and remembered you wrote:

Note that Visual Studio 2012 or later Image Editor does support modern DDS files because it already uses DirectXTex, so at least for viewing 2D textures it's a good choice.

If I convert a sRGB .png to a sRGB .dds by using texconv with -srgb -f BC7_UNORM_SRGB, the resulting .dds image is not represented in an appropriate color space in Visual Studio (i.e. a gamma value of 1.0 instead of ~2.2 is used). (The .dds image looks ok if I use -srgbo -f BC7_UNORM_SRGB or -f BC7_UNORM_SRGB.) It is a bit counter-intuitive that no gamma encoding options are exposed in the viewer for sRGB formats. (I actually need to use my own renderer to verify that texconv works as intended, whereas the Visual Studio viewer is counter-intuitive.)