NEWS: This project is now hosted on GitHub https://github.com/Microsoft/DirectXTex. This site is being maintained for now, but please move to using GitHub. https://github.com/Microsoft/DirectXTex/wiki/Texconv

This DirectXTex sample is an implementation of the texconv command-line texture utility from the DirectX SDK utilizing DirectXTex rather than D3DX. This tool loads an image and prepares it for runtime use by resizing, format conversion, mip-map generation, block-compression, and writes the result in a file format suited for runtime use.

To create cubemaps, volume maps, or texture arrays from individual files, use Texassemble

Syntax

Texconv.exe uses the following command syntax:

texconv [-w number] [-h number] [-m number] [-f format] [-if filter] [-srgb | -srgbi | -srgbo] [-px  string] [-sx string] [-o directory] [-ft file-type] [-hflip] [-vflip] [-sepalpha] [-wrap | -mirror] [-pmalpha] [-fl feature-level] [-pow2] [-tu | -tf] [-dword] [-xlum] [-dx10]  [-nologo] [-singleproc] [-nogpu] [-aw number] [-nmap flags] [-nmapamp number] [-bcuniform] [-bcmax] [-bcdither] [-timing]
<file-name(s)>
The file-name parameter indicates the file(s) to convert.

The optional command-line switches are described in the following table.

Optional Switches Description

Examples

Open a Command Prompt, and change to the directory containing Texconv.exe (i.e. ...\DirectXTex\Texconv\Release)
http://windows.microsoft.com/en-us/windows/command-prompt-faq

Enter the following command-line after changing to the appropriate directory:
texconv -pow2 -f BC1_UNORM cat.jpg 

This loads a JPEG image 'cat.jpg', resizes the image to a power of 2 in each dimension (if the original was 512 x 683 it is resized to 256 x 512), mipmaps are generated, the file is converted to BC1_UNORM (aka DXT1) block compression, and written out as 'cat.dds'.

texconv -nmap lo -nmapamp 2 -f R8G8B8A8_UNORM heightmap.png

This loads the PNG image 'heightmap.png', converts it to a normal-map using luminance and an amplitude of 2, and writes the data out as a 'heightmap.dds' with mipmaps and an occlusion term in the alpha channel using the R8G8B8A8_UNORM format.