1
0
mirror of https://github.com/microsoft/DirectXTex synced 2024-09-19 15:19:56 +00:00

Minor format cleanup

Chuck Walbourn 2020-05-02 01:13:37 -07:00
parent 6f5961f26a
commit 1fb643be4d
3 changed files with 254 additions and 195 deletions

@ -7,7 +7,8 @@ This DirectXTex sample is a command-line texture utility for creating ``DDS`` fi
# Syntax
``Texassemble.exe`` uses the following command syntax:
texassemble <command>
```
texassemble <command>
[-r] [-w width] [-h height] [-f format]
[-if filter] [-srgb | -srgbi | -srgbo]
[-sepalpha] [-nowic] [-wrap | -mirror] [-alpha]
@ -15,6 +16,7 @@ This DirectXTex sample is a command-line texture utility for creating ``DDS`` fi
[-nologo] [-flist <filename>]
[-bgcolor]
<file-name(s)>
```
The file-name parameter indicates the file(s) to use to create the assembled image using ``dds``, ``tga``, ``hdr``, or a WIC-supported format (``bmp``, ``jpg``, ``png``, ``jxr``, etc.).
@ -80,28 +82,48 @@ The file-name parameter indicates the file(s) to use to create the assembled ima
# Examples
texassemble volume -w 256 -h 256 -o volume.dds lena.jpg fishingboat.jpg peppers.tiff
```
texassemble volume -w 256 -h 256 -o volume.dds lena.jpg fishingboat.jpg peppers.tiff
```
This loads the three image files 'lena.jpg', 'fishingboat.jpg', and 'peppers.tiff', resizes them to 256 x 256, and then writes out a volume (3D) texture to 'volume.dds' sized 256 x 256 x 3 with each input image as a depth slice. The result uses a DXGI format derived from the 'lena.jpg' input image, or one could be provided via the '-f' command-line switch. _The result does not have mipmaps but 'volume.dds' could be use as input for **texconv** to finish the processing such as generating mipmaps or block-compression._
This loads the three image files 'lena.jpg', 'fishingboat.jpg', and 'peppers.tiff', resizes them to 256 x 256, and then writes out a volume (3D) texture to 'volume.dds' sized 256 x 256 x 3 with each input image as a depth slice. The result uses a DXGI format derived from the 'lena.jpg' input image, or one could be provided via the '-f' command-line switch.
texassemble cube -w 256 -h 256 -o cubemap.dds lobbyxposjpg lobbyxneg.jpg
> The result does not have mipmaps but 'volume.dds' could be use as input for **texconv** to finish the processing such as generating mipmaps or block-compression.
```
texassemble cube -w 256 -h 256 -o cubemap.dds lobbyxposjpg lobbyxneg.jpg
lobbyypos.jpg lobbyyneg.jpg lobbyzpos.jpg lobbyzneg.jpg
```
This loads the six image JPEG files, resizes them to 256 x 256, and then writes out a cubemap texture to 'cubemap.dds' sized 256 x 256 with six faces, with each input image as a distinct face (ordered positive-x, negative-x, positive-y, negative-y, positive-z, and negative-z). The result uses a DXGI format derived from 'lobbyxpos.jpg', or one could be provided via the '-f' command-line switch. _The result does not have mipmaps but 'cubemap.dds' could be use as input for **texconv** to finish the processing such as generating mipmaps or block-compression._
This loads the six image JPEG files, resizes them to 256 x 256, and then writes out a cubemap texture to 'cubemap.dds' sized 256 x 256 with six faces, with each input image as a distinct face (ordered positive-x, negative-x, positive-y, negative-y, positive-z, and negative-z). The result uses a DXGI format derived from 'lobbyxpos.jpg', or one could be provided via the '-f' command-line switch.
texassemble array -o array.dds lena.jpg peppers.tiff
> The result does not have mipmaps but 'cubemap.dds' could be use as input for **texconv** to finish the processing such as generating mipmaps or block-compression.
This loads the two image files 'lena.jpg' and 'peppers.tiff'. It resizes 'peppers.tiff' to the same size as 'lena.jpg', and then writes out an array 2D texture to 'array.dds' using the two input images. The result uses a DXGI format derived from 'lena.jpg', or one could be provided via the '-f' command-line switch. _The result does not have mipmaps but 'array.dds' could be use as input for **texconv** to finish the processing such as generating mipmaps or block-compression._ Note that loading 'array.dds' requires feature level 10.0 or better hardware.
```
texassemble array -o array.dds lena.jpg peppers.tiff
```
texassemble h-cross cubemap.dds
This loads the two image files 'lena.jpg' and 'peppers.tiff'. It resizes 'peppers.tiff' to the same size as 'lena.jpg', and then writes out an array 2D texture to 'array.dds' using the two input images. The result uses a DXGI format derived from 'lena.jpg', or one could be provided via the '-f' command-line switch.
> The result does not have mipmaps but 'array.dds' could be use as input for **texconv** to finish the processing such as generating mipmaps or block-compression.
> Loading 'array.dds' requires feature level 10.0 or better hardware.
```
texassemble h-cross cubemap.dds
```
This loads the cubemap, and outputs a ``cubemap.bmp`` with the cubemap faces arranged in a horizontal cross.
texassemble merge -o newimage.png baboon.tif texture1.bmp
```
texassemble merge -o newimage.png baboon.tif texture1.bmp
```
This will create a new image saved as a ``png`` with the RGB values read from the baboon.tif file and the blue channel from texture1.bmp copied to the alpha channel in the new image.
texassemble gif animated.gif -o output.dds
```
texassemble gif animated.gif -o output.dds
```
This creates a DDS that contains a texture 2D array with format ``DXGI_FORMAT_B8G8AR8A8_UNORM`` with one item for each frame in the animation.

@ -7,14 +7,16 @@ This DirectXTex sample is an implementation of the **texconv** command-line text
# Syntax
``Texconv.exe`` uses the following command syntax:
texconv [-r] [-flist <filename>]
```
texconv [-r] [-flist <filename>]
[-w number] [-h number] [-m number] [-f format]
[-if filter] [-srgb | -srgbi | -srgbo]
[-px string] [-sx string] [-o directory] [-l] [-y] [-ft file-type]
[-if filter] [-srgb | -srgbi | -srgbo]
[-px string] [-sx string] [-o directory] [-l] [-y]
[-ft file-type]
[-hflip] [-vflip]
[-sepalpha] [-keepcoverage number]
[-nowic] [-wrap | -mirror]
[-pmalpha | -alpha]
[-pmalpha | -alpha]
[-fl feature-level] [-pow2]
[-nmap flags] [-nmapamp number]
[-tu | -tf] [-dword] [-badtails] [-fixbc4x4] [-xlum]
@ -26,6 +28,7 @@ This DirectXTex sample is an implementation of the **texconv** command-line text
[-c colorkey] [-rotatecolor rot] [-nits number] [-tonemap]
[-x2bias] [-inverty]
<file-name(s)>
```
The file-name parameter indicates the file(s) to convert using ``dds``, ``tga``, ``hdr``, or a WIC-supported format (``bmp``, ``jpg``, ``png``, ``jxr``, etc.).
@ -164,23 +167,33 @@ Open a [Command Prompt](http://windows.microsoft.com/en-us/windows/command-promp
Enter the following command-line after changing to the appropriate directory:
texconv -pow2 -f BC1_UNORM cat.jpg
```
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 ``DXGI_FORMAT_BC1_UNORM`` (aka DXT1) block compression, and written out as 'cat.dds'.
texconv -r C:\Textures\*.png
```
texconv -r C:\Textures\*.png
```
This converts all the ``.png`` files in the ``C:\Textures`` directory tree to ``dds`` files written into the current working directory.
texconv -nmap lo -nmapamp 2 -f R8G8B8A8_UNORM heightmap.png
```
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 ``DXGI_FORMAT_R8G8B8A8_UNORM`` format.
texconv myimage.hdr -tonemap -ft BMP
```
texconv myimage.hdr -tonemap -ft BMP
```
This loads the HDR (Radiance RGBE) image `myimage.hdr`, performs a tone-mapping operation, and then writes the result to `myimage.bmp`.
texconv -pow2 -fl 9.3 -f BC3_UNORM -m 1 *.bmp
```
texconv -pow2 -fl 9.3 -f BC3_UNORM -m 1 *.bmp
```
This creates a ``DDS`` file for each ``BMP`` file in the current directory that is sized to a power-of-2 respecting aspect ratio with a maximum size of 4096 for a given dimension. The results are compressed as ``DXGI_FORMAT_BC3_UNORM`` (a.k.a. DXT5) and have no mipmaps.

@ -7,13 +7,15 @@ DirectXTex sample is a command-line utility analyzing the content of images.
# Syntax
``Texdiag.exe`` uses the following command syntax:
texdiag <command> [-r]
```
texdiag <command> [-r]
[-if filter] [-tu | -tf] [-dword] [-badtails] [-xlum]
[-f format] [-o filename] [-l] [-y]
[-targetx <num>] [-targety <num>]
[-nologo] [-flist <filename>]
[-ft <filetype>]
<file-name(s)>
```
The file-name parameter indicates the file(s) to diagnose using ``dds``, ``tga``, ``hdr``, or a WIC-supported format (``bmp``, ``jpg``, ``png``, ``jxr``, etc.).
@ -31,13 +33,13 @@ The file-name parameter indicates the file(s) to diagnose using ``dds``, ``tga``
**dumpdds**: Writes out each individual frame of a complex DDS file.
# Optional Switches Description
# Optional Switches Description
**-r**: Input file names can contain wildcard characters (``?`` or ``*``). If this switch is used, subdirectories are also searched.
**-if _filter_**: Image filter used for loading WIC-based images required for some formats. Use one of the following: ``POINT``, ``LINEAR``, ``CUBIC``, ``FANT``, ``BOX``, ``TRIANGLE``, ``POINT_DITHER``, ``LINEAR_DITHER``, ``CUBIC_DITHER``, ``FANT_DITHER``, ``BOX_DITHER``, ``TRIANGLE_DITHER``, ``POINT_DITHER_DIFFUSION``, ``LINEAR_DITHER_DIFFUSION``, ``CUBIC_DITHER_DIFFUSION``, ``FANT_DITHER_DIFFUSION``, ``BOX_DITHER_DIFFUSION``, or ``TRIANGLE_DITHER_DIFFUSION``. Filters with ``DITHER`` in their name indicate that the 4x4 ordered dither algorithm, while ``DITHER_DIFFUSION`` is error diffusion dithering.
**-if _filter_**: Image filter used for loading WIC-based images required for some formats. Use one of the following: ``POINT``, ``LINEAR``, ``CUBIC``, ``FANT``, ``BOX``, ``TRIANGLE``, ``POINT_DITHER``, ``LINEAR_DITHER``, ``CUBIC_DITHER``, ``FANT_DITHER``, ``BOX_DITHER``, ``TRIANGLE_DITHER``, ``POINT_DITHER_DIFFUSION``, ``LINEAR_DITHER_DIFFUSION``, ``CUBIC_DITHER_DIFFUSION``, ``FANT_DITHER_DIFFUSION``, ``BOX_DITHER_DIFFUSION``, or ``TRIANGLE_DITHER_DIFFUSION``. Filters with ``DITHER`` in their name indicate that the 4x4 ordered dither algorithm, while ``DITHER_DIFFUSION`` is error diffusion dithering.
**-tu**: DDS files with TYPELESS formats are treated as UNORM
**-tf**: DDS files with TYPELESS formats are treated as FLOAT
**-tf**: DDS files with TYPELESS formats are treated as FLOAT
> Generally typeless formats will fail most operations, so these options let you override the type.
@ -57,7 +59,7 @@ The file-name parameter indicates the file(s) to diagnose using ``dds``, ``tga``
**-targetx** _num_, **-targety** _num_: Provides a target pixel location for the ``dumpbc`` command. For ``DDS`` files with mipmap chains it will match the block that maps to the pixel location in subsequently lower mip-levels. By default ``dumpbc`` dumps out all blocks.
**-nologo**: Suppress copyright message.
**-nologo**: Suppress copyright message.
**-flist _filename_**: Uses the provided filename as a text file containing a list of input files (one per line). Ignores lines that begin with ``#`` (used for comments). Does not support providing additional command-line arguments or the use of filename wildcards.
@ -74,228 +76,250 @@ The file-name parameter indicates the file(s) to diagnose using ``dds``, ``tga``
The basic use for this tool is just printing out the metadata for the image:
texdiag info reftexture.dds
```
texdiag info reftexture.dds
```
Results in the following output:
reftexture.dds
width = 256
height = 256
depth = 1
mipLevels = 9
arraySize = 1
format = B8G8R8A8_UNORM
dimension = 2D
alpha mode = Unknown
```
reftexture.dds
width = 256
height = 256
depth = 1
mipLevels = 9
arraySize = 1
format = B8G8R8A8_UNORM
dimension = 2D
alpha mode = Unknown
```
The analyzer computes statistics for the image:
```
texdiag analyze tex_dxt1.DDS
```
Results in the following output:
tex_dxt1.DDS
Results by item ( 1) and mip ( 8)
```
tex_dxt1.DDS
Results by item ( 1) and mip ( 8)
Result item 0, mip 0:
Minimum - (0.000000 0.000000 0.000000 1.000000)
Average - (0.046211 0.051364 0.043492 1.000000)
Maximum - (0.870968 0.825397 0.806452 1.000000)
Variance - (438.820526 402.858032 295.667084 0.000000)
Std Dev - (20.948044 20.071323 17.194973 0.000000)
Luminance - 0.794695 (maximum)
Compression - BC1_UNORM
Total blocks - 1024
4 color blocks - 132
3 color blocks - 892
Result item 0, mip 0:
Minimum - (0.000000 0.000000 0.000000 1.000000)
Average - (0.046211 0.051364 0.043492 1.000000)
Maximum - (0.870968 0.825397 0.806452 1.000000)
Variance - (438.820526 402.858032 295.667084 0.000000)
Std Dev - (20.948044 20.071323 17.194973 0.000000)
Luminance - 0.794695 (maximum)
Compression - BC1_UNORM
Total blocks - 1024
4 color blocks - 132
3 color blocks - 892
Result item 0, mip 1:
Minimum - (0.000000 0.000000 0.000000 1.000000)
Average - (0.046072 0.051374 0.043398 1.000000)
Maximum - (0.838710 0.746032 0.677419 1.000000)
Variance - (108.159210 98.821289 71.980316 0.000000)
Std Dev - (10.399962 9.940889 8.484121 0.000000)
Luminance - 0.762739 (maximum)
Compression - BC1_UNORM
Total blocks - 256
4 color blocks - 45
3 color blocks - 211
Result item 0, mip 1:
Minimum - (0.000000 0.000000 0.000000 1.000000)
Average - (0.046072 0.051374 0.043398 1.000000)
Maximum - (0.838710 0.746032 0.677419 1.000000)
Variance - (108.159210 98.821289 71.980316 0.000000)
Std Dev - (10.399962 9.940889 8.484121 0.000000)
Luminance - 0.762739 (maximum)
Compression - BC1_UNORM
Total blocks - 256
4 color blocks - 45
3 color blocks - 211
Result item 0, mip 2:
Minimum - (0.000000 0.000000 0.000000 1.000000)
Average - (0.046266 0.051228 0.043741 1.000000)
Maximum - (0.806452 0.698413 0.612903 1.000000)
Variance - (26.114519 23.424675 17.333866 0.000000)
Std Dev - (5.110237 4.839904 4.163396 0.000000)
Luminance - 0.721418 (maximum)
Compression - BC1_UNORM
Total blocks - 64
4 color blocks - 14
3 color blocks - 50
Result item 0, mip 2:
Minimum - (0.000000 0.000000 0.000000 1.000000)
Average - (0.046266 0.051228 0.043741 1.000000)
Maximum - (0.806452 0.698413 0.612903 1.000000)
Variance - (26.114519 23.424675 17.333866 0.000000)
Std Dev - (5.110237 4.839904 4.163396 0.000000)
Luminance - 0.721418 (maximum)
Compression - BC1_UNORM
Total blocks - 64
4 color blocks - 14
3 color blocks - 50
Result item 0, mip 3:
Minimum - (0.000000 0.000000 0.000000 1.000000)
Average - (0.045741 0.050141 0.042297 1.000000)
Maximum - (0.677419 0.650794 0.645161 1.000000)
Variance - (6.148984 5.431025 3.997676 0.000000)
Std Dev - (2.479715 2.330456 1.999419 0.000000)
Luminance - 0.602960 (maximum)
Compression - BC1_UNORM
Total blocks - 16
4 color blocks - 8
3 color blocks - 8
Result item 0, mip 3:
Minimum - (0.000000 0.000000 0.000000 1.000000)
Average - (0.045741 0.050141 0.042297 1.000000)
Maximum - (0.677419 0.650794 0.645161 1.000000)
Variance - (6.148984 5.431025 3.997676 0.000000)
Std Dev - (2.479715 2.330456 1.999419 0.000000)
Luminance - 0.602960 (maximum)
Compression - BC1_UNORM
Total blocks - 16
4 color blocks - 8
3 color blocks - 8
Result item 0, mip 4:
Minimum - (0.000000 0.000000 0.000000 1.000000)
Average - (0.044355 0.052497 0.041667 1.000000)
Maximum - (0.666667 0.544974 0.451613 1.000000)
Variance - (1.234477 0.926867 0.652908 0.000000)
Std Dev - (1.111070 0.962739 0.808027 0.000000)
Luminance - 0.568846 (maximum)
Compression - BC1_UNORM
Total blocks - 4
4 color blocks - 4
3 color blocks - 0
Result item 0, mip 4:
Minimum - (0.000000 0.000000 0.000000 1.000000)
Average - (0.044355 0.052497 0.041667 1.000000)
Maximum - (0.666667 0.544974 0.451613 1.000000)
Variance - (1.234477 0.926867 0.652908 0.000000)
Std Dev - (1.111070 0.962739 0.808027 0.000000)
Luminance - 0.568846 (maximum)
Compression - BC1_UNORM
Total blocks - 4
4 color blocks - 4
3 color blocks - 0
Result item 0, mip 5:
Minimum - (0.000000 0.015873 0.032258 1.000000)
Average - (0.044355 0.051587 0.056452 1.000000)
Maximum - (0.354839 0.301587 0.225806 1.000000)
Variance - (0.164383 0.106576 0.048907 0.000000)
Std Dev - (0.405442 0.326460 0.221150 0.000000)
Luminance - 0.309227 (maximum)
Compression - BC1_UNORM
Total blocks - 1
4 color blocks - 1
3 color blocks - 0
Result item 0, mip 5:
Minimum - (0.000000 0.015873 0.032258 1.000000)
Average - (0.044355 0.051587 0.056452 1.000000)
Maximum - (0.354839 0.301587 0.225806 1.000000)
Variance - (0.164383 0.106576 0.048907 0.000000)
Std Dev - (0.405442 0.326460 0.221150 0.000000)
Luminance - 0.309227 (maximum)
Compression - BC1_UNORM
Total blocks - 1
4 color blocks - 1
3 color blocks - 0
Result item 0, mip 6:
Minimum - (0.000000 0.031746 0.032258 1.000000)
Average - (0.048387 0.055556 0.048387 1.000000)
Maximum - (0.096774 0.079365 0.064516 1.000000)
Variance - (0.009365 0.002268 0.001041 0.000000)
Std Dev - (0.096774 0.047619 0.032258 0.000000)
Luminance - 0.082954 (maximum)
Compression - BC1_UNORM
Total blocks - 1
4 color blocks - 0
3 color blocks - 1
Result item 0, mip 6:
Minimum - (0.000000 0.031746 0.032258 1.000000)
Average - (0.048387 0.055556 0.048387 1.000000)
Maximum - (0.096774 0.079365 0.064516 1.000000)
Variance - (0.009365 0.002268 0.001041 0.000000)
Std Dev - (0.096774 0.047619 0.032258 0.000000)
Luminance - 0.082954 (maximum)
Compression - BC1_UNORM
Total blocks - 1
4 color blocks - 0
3 color blocks - 1
Result item 0, mip 7:
Minimum - (0.048387 0.055556 0.048387 1.000000)
Average - (0.048387 0.055556 0.048387 1.000000)
Maximum - (0.048387 0.055556 0.048387 1.000000)
Variance - (0.000000 0.000000 0.000000 0.000000)
Std Dev - (0.000000 0.000000 0.000000 0.000000)
Luminance - 0.052616 (maximum)
Compression - BC1_UNORM
Total blocks - 1
4 color blocks - 0
3 color blocks - 1
Result item 0, mip 7:
Minimum - (0.048387 0.055556 0.048387 1.000000)
Average - (0.048387 0.055556 0.048387 1.000000)
Maximum - (0.048387 0.055556 0.048387 1.000000)
Variance - (0.000000 0.000000 0.000000 0.000000)
Std Dev - (0.000000 0.000000 0.000000 0.000000)
Luminance - 0.052616 (maximum)
Compression - BC1_UNORM
Total blocks - 1
4 color blocks - 0
3 color blocks - 1
```
The tool can be used to compute an error metric between two images:
texdiag.exe compare reftexture.dds reftexture_dxt1.DDS
```
texdiag.exe compare reftexture.dds reftexture_dxt1.DDS
```
Results in the following output:
1: reftexture.dds
2: reftexture_dxt1.DDS
Results by item ( 1) and mip ( 9)
```
1: reftexture.dds
2: reftexture_dxt1.DDS
Results by item ( 1) and mip ( 9)
[ 0, 0]: 0.000007 (0.000003 0.000001 0.000003 0.000000) PSNR 56.426357 dB
[ 0, 1]: 0.000094 (0.000033 0.000029 0.000033 0.000000) PSNR 45.034111 dB
[ 0, 2]: 0.000240 (0.000083 0.000073 0.000083 0.000000) PSNR 40.974899 dB
[ 0, 3]: 0.005770 (0.000604 0.000579 0.004586 0.000000) PSNR 27.159737 dB
[ 0, 4]: 0.067044 (0.033618 0.001000 0.032426 0.000000) PSNR 16.507608 dB
[ 0, 5]: 0.014921 (0.007250 0.000319 0.007352 0.000000) PSNR 23.033331 dB
[ 0, 6]: 0.001642 (0.000840 0.000101 0.000701 0.000000) PSNR 32.618088 dB
[ 0, 7]: 0.000287 (0.000125 0.000012 0.000151 0.000000) PSNR 40.190742 dB
[ 0, 8]: 0.000425 (0.000208 0.000009 0.000208 0.000000) PSNR 38.488575 dB
[ 0, 0]: 0.000007 (0.000003 0.000001 0.000003 0.000000) PSNR 56.426357 dB
[ 0, 1]: 0.000094 (0.000033 0.000029 0.000033 0.000000) PSNR 45.034111 dB
[ 0, 2]: 0.000240 (0.000083 0.000073 0.000083 0.000000) PSNR 40.974899 dB
[ 0, 3]: 0.005770 (0.000604 0.000579 0.004586 0.000000) PSNR 27.159737 dB
[ 0, 4]: 0.067044 (0.033618 0.001000 0.032426 0.000000) PSNR 16.507608 dB
[ 0, 5]: 0.014921 (0.007250 0.000319 0.007352 0.000000) PSNR 23.033331 dB
[ 0, 6]: 0.001642 (0.000840 0.000101 0.000701 0.000000) PSNR 32.618088 dB
[ 0, 7]: 0.000287 (0.000125 0.000012 0.000151 0.000000) PSNR 40.190742 dB
[ 0, 8]: 0.000425 (0.000208 0.000009 0.000208 0.000000) PSNR 38.488575 dB
Minimum MSE: 0.000007 (0.000003 0.000001 0.000003 0.000000) PSNR 56.426357 dB
Average MSE: 0.010048 (0.004751 0.000236 0.003603 0.000000) PSNR 25.431186 dB
Maximum MSE: 0.067044 (0.033618 0.001000 0.032426 0.000000) PSNR 16.507608 dB
Minimum MSE: 0.000007 (0.000003 0.000001 0.000003 0.000000) PSNR 56.426357 dB
Average MSE: 0.010048 (0.004751 0.000236 0.003603 0.000000) PSNR 25.431186 dB
Maximum MSE: 0.067044 (0.033618 0.001000 0.032426 0.000000) PSNR 16.507608 dB
```
The tool can be used to create a difference image:
texdiag.exe diff reftexture.dds reftexture_dxt1.DDS
```
texdiag.exe diff reftexture.dds reftexture_dxt1.DDS
```
This results in a file ``reftexture.bmp`` with the absolute value of the differences in RGB (alpha is always fully opaque).
For block-compressed (BC) DDS files, the tool can dump out details about particular blocks in the compressed image for more detailed debugging:
texdiag.exe dumpbc -targetx 8 -targety 12 tex_dxt1.DDS
```
texdiag.exe dumpbc -targetx 8 -targety 12 tex_dxt1.DDS
```
Results in the following output:
tex_dxt1.DDS
Compression: BC1_UNORM
Results by item ( 1) and mip ( 8)
```
tex_dxt1.DDS
Compression: BC1_UNORM
Results by item ( 1) and mip ( 8)
[ 0, 0]:
Block 2 (pixel: 8 x 12)
Transparent - E0: (R: 0.000, G: 0.000, B: 0.000)
E1: (R: 0.000, G: 0.000, B: 0.032)
Index: 0 0 0 0 | 0 0 0 0 | 0 0 0 0 | 0 0 0 0
[ 0, 0]:
Block 2 (pixel: 8 x 12)
Transparent - E0: (R: 0.000, G: 0.000, B: 0.000)
E1: (R: 0.000, G: 0.000, B: 0.032)
Index: 0 0 0 0 | 0 0 0 0 | 0 0 0 0 | 0 0 0 0
[ 0, 1]:
Block 1 (pixel: 4 x 4)
Transparent - E0: (R: 0.000, G: 0.000, B: 0.000)
E1: (R: 0.000, G: 0.000, B: 0.032)
Index: 0 0 0 0 | 0 0 0 0 | 0 0 0 0 | 0 0 0 0
[ 0, 1]:
Block 1 (pixel: 4 x 4)
Transparent - E0: (R: 0.000, G: 0.000, B: 0.000)
E1: (R: 0.000, G: 0.000, B: 0.032)
Index: 0 0 0 0 | 0 0 0 0 | 0 0 0 0 | 0 0 0 0
[ 0, 2]:
Block 0 (pixel: 0 x 0)
Transparent - E0: (R: 0.000, G: 0.000, B: 0.000)
E1: (R: 0.000, G: 0.000, B: 0.032)
Index: 0 0 0 0 | 0 0 0 0 | 0 0 0 0 | 0 0 0 0
[ 0, 2]:
Block 0 (pixel: 0 x 0)
Transparent - E0: (R: 0.000, G: 0.000, B: 0.000)
E1: (R: 0.000, G: 0.000, B: 0.032)
Index: 0 0 0 0 | 0 0 0 0 | 0 0 0 0 | 0 0 0 0
[ 0, 3]:
Block 0 (pixel: 0 x 0)
Transparent - E0: (R: 0.000, G: 0.000, B: 0.000)
E1: (R: 0.000, G: 0.000, B: 0.032)
Index: 0 0 0 0 | 0 0 0 0 | 0 0 0 0 | 0 0 0 0
[ 0, 3]:
Block 0 (pixel: 0 x 0)
Transparent - E0: (R: 0.000, G: 0.000, B: 0.000)
E1: (R: 0.000, G: 0.000, B: 0.032)
Index: 0 0 0 0 | 0 0 0 0 | 0 0 0 0 | 0 0 0 0
[ 0, 4]:
Block 0 (pixel: 0 x 0)
Opaque - E0: (R: 0.000, G: 0.206, B: 0.194)
E1: (R: 0.000, G: 0.000, B: 0.000)
Index: 1 1 1 1 | 1 1 1 0 | 1 1 1 2 | 1 1 1 1
[ 0, 4]:
Block 0 (pixel: 0 x 0)
Opaque - E0: (R: 0.000, G: 0.206, B: 0.194)
E1: (R: 0.000, G: 0.000, B: 0.000)
Index: 1 1 1 1 | 1 1 1 0 | 1 1 1 2 | 1 1 1 1
[ 0, 5]:
Block 0 (pixel: 0 x 0)
Opaque - E0: (R: 0.355, G: 0.302, B: 0.226)
E1: (R: 0.000, G: 0.016, B: 0.032)
Index: 1 1 1 1 | 1 1 1 1 | 1 0 2 1 | 1 1 3 1
[ 0, 5]:
Block 0 (pixel: 0 x 0)
Opaque - E0: (R: 0.355, G: 0.302, B: 0.226)
E1: (R: 0.000, G: 0.016, B: 0.032)
Index: 1 1 1 1 | 1 1 1 1 | 1 0 2 1 | 1 1 3 1
[ 0, 6]:
Block 0 (pixel: 0 x 0)
Transparent - E0: (R: 0.000, G: 0.032, B: 0.032)
E1: (R: 0.097, G: 0.079, B: 0.065)
Index: 0 0 3 3 | 1 1 3 3 | 3 3 3 3 | 3 3 3 3
[ 0, 6]:
Block 0 (pixel: 0 x 0)
Transparent - E0: (R: 0.000, G: 0.032, B: 0.032)
E1: (R: 0.097, G: 0.079, B: 0.065)
Index: 0 0 3 3 | 1 1 3 3 | 3 3 3 3 | 3 3 3 3
[ 0, 7]:
Block 0 (pixel: 0 x 0)
Transparent - E0: (R: 0.032, G: 0.048, B: 0.032)
E1: (R: 0.065, G: 0.063, B: 0.065)
Index: 2 3 3 3 | 3 3 3 3 | 3 3 3 3 | 3 3 3 3
[ 0, 7]:
Block 0 (pixel: 0 x 0)
Transparent - E0: (R: 0.032, G: 0.048, B: 0.032)
E1: (R: 0.065, G: 0.063, B: 0.065)
Index: 2 3 3 3 | 3 3 3 3 | 3 3 3 3 | 3 3 3 3
```
In addition to analyzing images, the tool can also be used to dump out individual images:
texdiag dumpdds reftexture.dds
```
texdiag dumpdds reftexture.dds
```
This results in a set of 9 image files, one for each miplevel:
reftexture_item000_mip000.BMP
reftexture_item000_mip001.BMP
reftexture_item000_mip002.BMP
reftexture_item000_mip003.BMP
reftexture_item000_mip004.BMP
reftexture_item000_mip005.BMP
reftexture_item000_mip006.BMP
reftexture_item000_mip007.BMP
reftexture_item000_mip008.BMP
```
reftexture_item000_mip000.BMP
reftexture_item000_mip001.BMP
reftexture_item000_mip002.BMP
reftexture_item000_mip003.BMP
reftexture_item000_mip004.BMP
reftexture_item000_mip005.BMP
reftexture_item000_mip006.BMP
reftexture_item000_mip007.BMP
reftexture_item000_mip008.BMP
```
# Remarks