UVAtlas.exe is a command line example tool that uses the D3DX UVAtlas and IMT computation functions to generate an optimal, unique texture parameterization for an input mesh.
uvatlas.exe [options] [filename1] [filename2] ... |
These switch are optional:
Optional Switches | Description | Default Value |
---|---|---|
[/n int] | Maximum number of charts to generate. This value is a positive integer >= 0. | 0 |
[/st float] | The maximum amount of stretch. This value is a positive float that ranges from no stretch (0.0) to any amount of stretch (1.0). | 0.16667 |
[/g float] | The gutter width (width between charts in texels). | 2.0 |
[/w int] | Texture width | 512 |
[/h int] | Texture height | 512 |
[/uvi int] | Specifies the output D3DDECLUSAGE_TEXCOORD index for the UVAtlas data. | 0 |
[/ta] | Generate topological adjacency, where triangles are marked adjacent if they share edge vertices. Mutually exclusive with /ga and /fa. | Do not generate topological adjacency. |
[/ga] | Generate geometric adjacency, where triangles are marked adjacent if edge vertices are positioned within 1e-5 of each other. Mutually exclusive with /ta and /fa. | Do not generate geometric adjacency. |
[/fa file] | Load adjacency array entries directly into memory from a binary file. Mutually exclusive with /ta and /ga. | N/A |
[/fe file] | Load false-edge adjacency-array entries directly into memory from a binary file. An edge that is not false is indicated by -1, while a false-edge is indicated by any other value, e.g. 0 or the original adjacency value. This enables the parameterization of meshes containing quads and higher order polygons, and the internal edges of each polygon will not be cut during the parameterization process. | N/A |
[/ip file] | Calculate the Integrated Metric Tensor (IMT) array for the mesh using a PRT buffer in file. | Must provide one filename. |
[/it file] | Calculate the IMT for the mesh using a texture map in file. | Must provide one filename. |
[/iv usage] | Calculate the IMT for the mesh using a per-vertex data from the mesh. The usage parameter lets you select which part of the mesh to use. It must be one of NORMAL, COLOR, TEXCOORD, TANGENT, or BINORMAL. | COLOR |
[/t] | Create a separate mesh in uv space and append _texture to the mesh file. | Do not create a separate mesh. |
[/c] | Modify the mesh materials to show which chart each triangle is in. | Do not display. |
[/rt file] | Resamples a texture using the new UVAtlas parameterization. The resampled texture is saved to a filename with "_resampled" appended. | Defaults to reading old texture parameterization from D3DDECLUSAGE_TEXCOORD[0] in original mesh. Use /rtu and /rti to override this. |
[/rtu usage] | Specifies the vertex data usage for texture resampling. It must be one of NORMAL, POSITION, COLOR, TEXCOORD, TANGENT, or BINORMAL. | TEXCOORD |
[/rti int] | Specifies the usage index for texture resampling. | 0 |
[/o file] | Output mesh filename. Using this option disables batch processing. | Original filename with "_result" appended. |
[/f] | Overwrite the original file with the output. | Off |
[/s] | Search for files in sub-directories | No search |
These switches are required:
Required Switches | Description | Default Value |
---|---|---|
[filenames*] | Specifies the files to generate atlases for. Wildcards and quotes are supported. At least one source file must be provided. | N/A |
For example, to generate a unique texture atlas for the airplane model:
uvatlas /t /o mesh.x airplane.x