Technical tips, tricks, and news about game development for Microsoft platforms including desktop, Xbox, and UWP
As part of myGamefest 2011 presentationModern Texture Content Pipelines (link), I demonstrated the “DirectXTex” library which is a shared source implementation of DDS file I/O (including the “DX10” header extension), texture content processing operations (resize, format conversion, mip-map-generation), software block compression (BC1 - BC7), height-map to normal-map conversion, and a simple .TGA file reader and writer.
The attached package includes:
See the ReadMe file in the package for more details.
Platforms:The code is designed to build with the Windows 8.x SDK using Visual Studio 2010, 2012, or 2013 and works on Windows Vista, Windows 7, Windows 8.x Win32 desktop, Windows Store apps, Windows phone 8.1, and Xbox One.
Note: DDSTextureLoader, WICTextureLoader, and ScreenGrab are also provided in theDirectX Tool Kit forDX11 /DX12
Here's a handy table of equivalents for D3DX (seeLiving without D3DX for a complete listing):
D3DX11ComputeNormalMap |
|
D3DX11CreateShaderResourceViewFromFile |
-or-
|
D3DX11CreateShaderResourceViewFromResource |
-or-
|
D3DX11CreateTextureFromFile |
-or-
|
D3DX11CreateTextureFromResource |
-or-
|
D3DX11FilterTexture |
|
D3DX11GetImageInfoFromFile |
|
D3DX11GetImageInfoFromResource |
|
D3DX11LoadTextureFromTexture |
|
D3DX11SaveTextureToFile |
-or-
|
D3DX11SaveTextureToMemory |
|
Where XXX is “DDS” for working with .DDS files, “WIC” for working with WIC-supported bitmap image formats such as .BMP, .JPG, .PNG, etc. or “TGA” for working with Targa Truvision files. Note that.TGA is supported by legacy D3DX and by DirectXTex, but not by WICTextureLoader or DirectXTK.
UPDATE: DirectXTex now also supports.HDR files. Seethis post. The XXX above would be “HDR”.
There is another version of the Texconv sample with the DirectXTex library that usesDirectXMath withDXGI 1.2 support available on the Windows SDK Samples Code Gallery. It can be built using eitherVisual Studio 2012 or VS 2010 with thenew Windows SDK. There is also a Windows Store app (a.k.a. Metro style app) version of the DDSTextureLoaderthere as well. TheWindows SDK Samples Code Gallery version of DirectXTex can be made to run on Windows Vista and Windows 7 by adding_WIN32_WINNT=0x0600 to the Preprocessor Definitions.
Update: DirectXTex is now hosted onCodePlexGitHub. The latest version of the library, documentation, notes on future work, release history, and other information is now available there.
vcpkg: The vcpkg C++ Package Manager has adirectxtex port available.
Related:DirectX Tool Kit for DX11,DirectXMesh,DirectX Tool Kit for DX12