D3DXUVAtlasPack
Pack mesh partitioning data into an atlas.
HRESULT D3DXUVAtlasPack(
LPD3DXMESH pMesh,
UINT dwWidth,
UINT dwHeight,
FLOAT fGutter,
DWORD dwTextureIndex,
CONST DWORD * pdwPartitionResultAdjacency,
LPD3DXUVATLASCB pCallback,
FLOAT fCallbackFrequency,
LPVOID pUserContent,
DWORD dwOptions,
LPD3DXBUFFER pFacePartitioning
);
Parameters
- pMesh
- [in] Pointer to an input mesh (see ID3DXMesh) which contains the object geometry for calculating the atlas. At a minimum, the mesh must contain position data and 2D texture coordinates.
- dwWidth
- [in] Texture width.
- dwHeight
- [in] Texture height.
- fGutter
- [in] The minimum distance, in texels, between two charts on the atlas. The gutter is always scaled by the width; so, if a gutter of 2.5 is used on a 512x512 texture, then the minimum distance between two charts is 2.5 / 512.0 texels.
- dwTextureIndex
- [in] Zero-based texture coordinate index that identifies which set of texture coordinates to use.
- pdwPartitionResultAdjacency
- [in] Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the mesh. It should be derived from the ppPartitionResultAdjacency returned from D3DXUVAtlasPartition. This value cannot be NULL, because Pack needs to know where charts were cut in the partition step in order to find the edges of each chart.
- 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] A void pointer to be passed back to the callback function.
- dwOptions
- [in] This options parameter is currently reserved.
- pFacePartitioning
- [in] A pointer to an ID3DXBuffer containing the array of the final face-partioning. Each element contains one DWORD per face.
Return Values
If the function succeeds, the return value is D3D_OK; otherwise, the value is D3DERR_INVALIDCALL.
Requirements
Header: Declared in D3dx9mesh.h.