Updated Texassemble (markdown)

Chuck Walbourn 2023-06-09 10:58:39 -07:00
Родитель 61f5b0e7c8
Коммит ef3f9901f2
1 изменённых файлов: 60 добавлений и 31 удалений

@ -8,22 +8,14 @@ This DirectXTex sample is a command-line texture utility for creating ``DDS`` fi
``Texassemble.exe`` uses the following command syntax:
```
texassemble <command>
[-r] [-flist <filename>]
[-w width] [-h height] [-f format]
[-if filter] [-srgb | -srgbi | -srgbo]
[-sepalpha] [-nowic] [-wrap | -mirror] [-alpha]
[-o <outputfile>] [-l] [-y] [-dx10] [-tonemap]
[-nologo]
[-fl feature-level]
[-bgcolor]
[-swizzle rgbamask]
[-stripmips]
<file-name(s)>
texassemble <command> [options] [-flist <filename>] <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.).
> The command-line parsing uses Windows-style `-` or `/` for options. It also has some POSIX-like behavior: it supports ``--version`` and ``--help`` command-line options, and the use of ``--`` disables further options parsing to support filenames that begin with `-` or `/` characters.
# Commands
**cube**: Creates a cubemap. Must have six images to form each of the six faces. Faces are ordered as follows: positive-x, negative-x, positive-y, negative-y, positive-z, negative-z.
@ -42,56 +34,93 @@ The file-name parameter indicates the file(s) to use to create the assembled ima
![Cubemap image layouts](https://docs.unity3d.com/uploads/Textures/CubeLayout6Faces1.png)
**cube-from-hc**, **cube-from-vc**, **cube-from-vc-fnz**, **cube-from-ht**, **cube-from-hs**, **cube-from-vs**: Creates a cubemap from one of the layout style images above.
**array-strip**: Creates a horizontal strip image from an input 1D/2D array ``dds`` file.
**merge**: Creates a texture using two input images. You can control which channels are used with the ``-swizzle`` option below.
**gif**: Converts an animated ``gif`` into a texture array with properly composed frames.
# Optional Switches Description
## File options
**-r**: Input file names can contain wildcard characters (``?`` or ``*``). If this switch is used, subdirectories are also searched.
**-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.
**-w _number_**: Width of the output texture in pixels.
**-h _number_**: Height of the output texture in pixels. If no size is given, the size is taken from the first input image.
**-f _format_**: Output format. Specify the DXGI format without the ``DXGI_FORMAT_`` prefix (i.e. ``-f R10G10B10A2_UNORM``). If no format is given, the format of the first image file is used.
**-if _filter_**: Image filter used for resizing the images. 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.
**-srgb**, **-srgbi**, or **-srgbo**: Use sRGB if both the input and output data are in the sRGB color format (ie. gamma ~2.2). Use sRGBi if only the input is in sRGB; use sRGBo if only the output is in sRGB.
**-sepalpha**: Separates alpha channel for resize.
**-nowic**: Forces filtering to use non-WIC-based code paths. This is useful for working around known issues with WIC depending on which operating system you are using.
**-wrap**, **-mirror**: Sets the texture addressing mode for filtering to wrap or mirror, otherwise defaults to clamp.
**-alpha**: Converts a premultiplied alpha image to non-premultiplied alpha (a.k.a. straight alpha).
**-o _Output-filename_**: The default name is a ``.DDS`` file based on the first input image file. For cross/strip generation, the default is a ``.BMP`` file and you can specify any of the extensions supported for input.
**-l**: Forces the output path & filename to all lower-case. *Windows file system is case-insensitive by default, but some programs like git are case-sensitive*.
**-y**: overwrite existing output file if any. By default, the tool will abort if the output file already exists.
**-dx10**: Forces DDS file output to always use the "DX10" header extension, and allows the writing of alpha mode metadata information. The resulting file may not be compatible with the legacy D3DX10 or D3DX11 libraries.
## Pixel format options
**-f _format_**: Output format. Specify the DXGI format without the ``DXGI_FORMAT_`` prefix (i.e. ``-f R10G10B10A2_UNORM``). If no format is given, the format of the first image file is used.
## Resizing options
**-w _number_**: Width of the output texture in pixels.
**-h _number_**: Height of the output texture in pixels. If no size is given, the size is taken from the first input image.
## Filtering options
**-if _filter_**: Image filter used for resizing the images. 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.
**-wrap**, **-mirror**: Sets the texture addressing mode for filtering to wrap or mirror, otherwise defaults to clamp.
**-nowic**: Forces filtering to use non-WIC-based code paths. This is useful for working around known issues with WIC depending on which operating system you are using.
## Colorspace options
**-srgb**, **-srgbi**, or **-srgbo**: Use sRGB if both the input and output data are in the sRGB color format (ie. gamma ~2.2). Use sRGBi if only the input is in sRGB; use sRGBo if only the output is in sRGB.
**-tonemap**: Applies [tonemap operator](http://www.cs.utah.edu/~reinhard/cdrom/) based on maximum luminosity to ensure HDR image data is adjusted to an LDR range.
**-nologo**: Suppress copyright message.
## Alpha options
**-alpha**: Converts a premultiplied alpha image to non-premultiplied alpha (a.k.a. straight alpha).
**-sepalpha**: Separates alpha channel for resize.
## DirectDraw Surface (DDS) file options
**-dx10**: Forces DDS file output to always use the "DX10" header extension, and allows the writing of alpha mode metadata information. The resulting file may not be compatible with the legacy D3DX10 or D3DX11 libraries.
## Direct3D options
**-fl _feature-level_**: Sets the target feature level which determines the maximum supported texture size: ``9.1``, ``9.2``, ``9.3``, ``10.0``, ``10.1``, ``11.0``, ``11.1``, ``12.0``, or ``12.1``. Defaults to ``11.0`` which is 16834, the limit for 11.x and 12.x [Direct3D Hardware Feature Level](https://aka.ms/Apsgrj).
## GIF options
**-bgcolor**: When doing the ``gif`` command, by default it always uses a transparent background color which is consistent with most browsers. You can choose to use the background color metadata in the file with this switch instead, but the results are not likely to match most viewers.
## MERGE options
**-swizzle _rgbamask_**: When doing the ``merge`` command, by default it uses the Blue channel from the second image as the Alpha channel for the output; pulling Red, Green, and Blue from the first image which is same as the mask ``rgbB``. This option lets you provide alternative channel patterns using [HLSL-style](https://docs.microsoft.com/windows/win32/direct3dhlsl/dx9-graphics-reference-asm-ps-registers-modifiers-source-register-swizzling) swizzle masks. Lowercase letters indicate channels pulled from the first image (``rgbaxyzw``), and uppercase letters indicate the second image (``RGBAXYZW``). The mask is 1 to 4 characters in length. A ``0`` indicates setting that channel to zero, a ``1`` indicates setting that channel to maximum.
> The ``merge`` command default swizzle mask matches the legacy DirectX Texture Tool behavior when doing "Open Alpha onto Surface..."
## Miscellaneous options
**-stripmips**: For the ``cube``, ``array``, ``volume``, or ``cubearray`` command, the input images are expected to be single images. This option allows mip-mapped 1D or 2D textures to be used as inputs, which removes the mip-chain during processing.
**-nologo**: Suppress copyright message.
# Examples
```