0
votes

I have been trying to figure out how to create and use cube maps for my Direct3D 11 program.

I have been led to believe that if I export my 6 images to a DDS file, I can simply load that one file using CreateDDSTextureFromFile(_device, inName, (ID3D11Resource**)&_texture, &_shaderResourceView). However I cannot find the tool that seems like it's supposed to be used for compiling the textures into DDS: dxtex.exe. In theory, it ships with the DirectX SDK, which has become defunct since Windows 8.1 (http://blogs.msdn.com/b/chuckw/archive/2013/07/01/where-is-the-directx-sdk-2013-edition.aspx). I have searched my hard drive and it does not exist (so presumably wasn't installed alongside Visual Studio -- I have 2013 and 2015; I'm running Windows 10, upgraded from 8.1).

There is also an Nvidia plugin for Photoshop which hasn't been updated in 3 years and crashes my copy of Photoshop when I try to run it (CC 2015). There are rumors of an AMD tool, but I read that it's not been supported for a while, like the Nvidia tool.

I even saw this post from a couple years back where they are simply loading up each texture individually (but for which it seems you are expected to use an outside library, as the CreateXXXTextureFromFile(...) functions expect to assign a resource view, which I don't need until I've set up the array of texture data as a single cube map.

My question is this: how is someone intended to save out and load up cube maps these days? There doesn't appear to be any route that seems intentional so much as incidental.

I would prefer to load a single texture if possible.

1

1 Answers

1
votes

You can install the legacy DirectX SDK (June 2010) to get the old DXTex tool. Keep in mind that there are known issues with installing the legacy DirectX SDK, that some of the legacy DirectX SDK is not compatible with DirectX 11.1 or later runtimes, and that the DXTex tool does not support all DXGI formats--for details see The DDS File Format Lives.

The DirectXTex library project includes a command-line tool texassemble which you can use to build up complex arrays, cubemaps, and volume maps from individual image files into a DDS. You can then process that DDS into other formats (like block compressing it to a BC format) using the texconv command-line tool.

Making a new version of DXTex using DirectXTex is a backlog item.

You can use the DDSTextureLoader code to create a resource at runtime from your complex DDS file.