D3DXUVAtlasPartition
Create a UV atlas for a mesh.
HRESULT D3DXUVAtlasPartition(
LPD3DXMESH pMesh,
UINT dwMaxChartNumber,
FLOAT fMaxStretch,
DWORD dwTextureIndex,
CONST DWORD * pdwAdjacency,
CONST CHAR * pcFalseEdges,
FLOAT * pfIMTArray,
LPD3DXUVATLASCB pCallback,
FLOAT fCallbackFrequency,
LPVOID pUserContent,
DWORD dwOptions,
LPD3DXMESH * ppMeshOut,
LPD3DXBUFFER pFacePartitioning,
LPD3DXBUFFER * ppVertexRemapArray,
LPD3DXBUFFER * ppPartitionResultAdjacency,
FLOAT * pfMaxStretchOut,
UINT * pdwNumChartsOut
);
Parameters
- pMesh
- [in] Pointer to an input mesh (see ID3DXMesh) that contains the object geometry for calculating the atlas. At a minimum, the mesh must contain position data and 2D texture coordinates.
- dwMaxChartNumber
- [in] The maximum number of charts to partition the mesh into. See remarks about the partitioning modes. Use 0 to tell D3DX that the atlas should be parameterized based on stretch.
- fMaxStretch
- [in] The amount of stretching allowed. 0 means no stretching is allowed, 1 means any amount of stretching can be used.
- dwTextureIndex
- [in] Zero-based texture coordinate index that identifies which set of texture coordinates to use.
- pdwAdjacency
- [in] A pointer to an array of adjacency data with 3 DWORDs per face, indicating which triangles are adjacent to each other (see ID3DXBaseMesh::GenerateAdjacency).
- pcFalseEdges
- [in] An array, with one element for each edge in the mesh, that specifies whether each edge is a "false edge". False edges will not be split during partitioning.
- pfIMTArray
- [in] A pointer to an array of integrated metric tensors that describes how to stretch a triangle (see IntegratedMetricTensor).
- pCallback
- [in] A pointer to a callback function (see LPD3DXUVATLASCB) that is useful for monitoring progress.
- fCallbackFrequency
- [in] Specify how often D3DX will call the callback; a reasonable default value is 0.0001f.
- pUserContent
- [in] Pointer to a user-defined value that is passed to the callback function; typically used by an application to pass a pointer to a data structure that provides context information for the callback function.
- dwOptions
- [in] Specify the quality of the charts generated by combining one or more flags in the D3DXUVATLAS enum.
- ppMeshOut
- [in] Pointer to the created mesh with the atlas (see ID3DXMesh).
- pFacePartitioning
- [out] A pointer to an array of the final face-partioning data. Each element contains one DWORD per face (see ID3DXBuffer).
- ppVertexRemapArray
- [out] A pointer to an array of remapped vertices. Each array element identifies the original vertex each final vertex came from (if the vertex was split during remapping). Each array element contains one DWORD per vertex.
- ppPartitionResultAdjacency
- [out] Address of a pointer to an ID3DXBuffer interface. This buffer will contain an array of three DWORDs per face that specify the three neighbors for each face in the output mesh. This parameter must not be NULL, because the subsequent call to D3DXUVAtlasPack() requires it.
- pfMaxStretchOut
- [out] A pointer to the maximum stretch value generated by the atlas algorithm. The range is between 0.0 and 1.0.
- pdwNumChartsOut
- [out] A pointer to the number of charts created by the atlas algorithm. If dwMaxChartNumber is too low, this parameter will return the minimum number of charts required to create an atlas.
Return Values
If the function succeeds, the return value is D3D_OK; otherwise, the value is D3DERR_INVALIDCALL.
Remarks
D3DXUVAtlasPartition is similar to D3DXUVAtlasCreate, except that D3DXUVAtlasPartition does not performing the final packing step.
Requirements
Header: Declared in D3dx9mesh.h.
See Also
UVAtlas Functions, UV Atlas Command-Line Tool (uvatlas.exe)