D3DXComputeIMTFromTexture
Calculates per-triangle IMT's from a texture mapped onto a mesh, to be used optionally as input to the D3DX UVAtlas Functions.
HRESULT D3DXComputeIMTFromTexture(
LPD3DXMESH pMesh,
LPDIRECT3DTEXTURE9 pTexture,
DWORD dwTextureIndex,
DWORD dwOptions,
LPD3DXUVATLASCB pStatusCallback,
LPVOID pUserContext,
LPD3DXBUFFER * ppIMTData
);
Parameters
- pMesh
- [in] A pointer to an input mesh (see ID3DXMesh) which contains the object geometry for calculating the IMT.
- pTexture
- [in] A pointer to the texture (see IDirect3DTexture9) that is mapped to the mesh.
- dwTextureIndex
- [in] Zero-based texture coordinate index that identifies which set of texture coordinates to use.
- dwOptions
- [in] Texture wrap options. This is a combination of one or more D3DXIMT FLAGS.
- pStatusCallback
- [in] A pointer to a callback function to monitor IMT computation progress.
- pUserContext
- [in] A pointer to a user-defined variable which is passed to the status callback function. Typically used by an application to pass a pointer to a data structure that provides context information for the callback function.
- ppIMTData
- [out] A pointer to the buffer (see ID3DXBuffer) containing the returned IMT array. This array can be provided as input to the D3DX UVAtlas Functions to prioritize texture-space allocation in the texture parameterization.
Return Values
If the function succeeds, the return value is D3D_OK; otherwise, the value is D3DERR_INVALIDCALL.
Remarks
Given a texture that maps over the surface of the mesh, the algorithm computes the IMT for each face. This will cause triangles containing lower-frequency signal data to take up less space in the final texture atlas when parameterized with the UVAtlas functions. The texture is assumed to be interpolated over the mesh bilinearly.
Requirements
Header: Declared in D3dx9mesh.h.
See Also
Using UVAtlas