D3DXUVAtlasPack function
Pack mesh partitioning data into an atlas.
Syntax
HRESULT D3DXUVAtlasPack(
_In_ LPD3DXMESH pMesh,
_In_ UINT dwWidth,
_In_ UINT dwHeight,
_In_ FLOAT fGutter,
_In_ DWORD dwTextureIndex,
const DWORD *pdwPartitionResultAdjacency,
_In_ LPD3DXUVATLASCB pCallback,
_In_ FLOAT fCallbackFrequency,
_In_ LPVOID pUserContent,
_In_ DWORD dwOptions,
_In_ LPD3DXBUFFER pFacePartitioning
);
Parameters
-
pMesh [in]
-
Type: LPD3DXMESH
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]
-
Type: UINT
Texture width.
-
dwHeight [in]
-
Type: UINT
Texture height.
-
fGutter [in]
-
Type: FLOAT
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]
-
Type: DWORD
Zero-based texture coordinate index that identifies which set of texture coordinates to use.
-
pdwPartitionResultAdjacency
-
Type: const DWORD*
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]
-
Type: LPD3DXUVATLASCB
A pointer to a callback function (see LPD3DXUVATLASCB) that is useful for monitoring progress.
-
fCallbackFrequency [in]
-
Type: FLOAT
Specify how often D3DX will call the callback; a reasonable default value is 0.0001f.
-
pUserContent [in]
-
Type: LPVOID
A void pointer to be passed back to the callback function.
-
dwOptions [in]
-
Type: DWORD
This options parameter is currently reserved.
-
pFacePartitioning [in]
-
Type: LPD3DXBUFFER
A pointer to an ID3DXBuffer containing the array of the final face-partitioning. Each element contains one DWORD per face.
Return value
Type: HRESULT
If the function succeeds, the return value is D3D_OK; otherwise, the value is D3DERR_INVALIDCALL.
Requirements
Requirement | Value |
---|---|
Header |
|
Library |
|
See also