1
0
mirror of https://github.com/microsoft/DirectXTex synced 2024-11-28 23:21:06 +00:00

Created Texconv (markdown)

Chuck Walbourn 2015-04-18 18:03:17 -07:00
parent 2187af3392
commit 534209aa1c

16
Texconv.md Normal file

@ -0,0 +1,16 @@
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]]_
# Examples
Open a [Command Prompt](http://windows.microsoft.com/en-us/windows/command-prompt-faq), and change to the directory containing Texconv.exe (i.e. ...\DirectXTex\Texconv\Release)
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.