D3DXComputeIMTFromSignal

Calculates per-triangle IMT's from a custom application-specified signal that varies over the surface of the mesh (generally at a higher frequency than vertex data). The signal is evaluated via a user-specified callback function.

HRESULT D3DXComputeIMTFromSignal(
  LPD3DXMESH pMesh,
  DWORD dwTextureIndex,
  UINT uSignalDimension,
  FLOAT fMaxUVDistance,
  DWORD dwOptions,
  LPD3DXIMTSIGNALCALLBACK pSignalCallback,
  VOID * pUserData,
  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.
dwTextureIndex
[in] Zero-based texture coordinate index that identifies which set of texture coordinates to use.
uSignalDimension
[in] The number of components in each data point in the signal.
fMaxUVDistance
[in] The maximum distance between vertices; the algorithm continues subdividing until the distance between all vertices is less than or equal to fMaxUVDistance.
dwOptions
[in] Texture wrap options. This is a combination of one or more D3DXIMT FLAGS.
pSignalCallback
[in] A pointer to a user-provided evaluator function, which will be used to compute the signal value at arbitrary U,V coordinates. The function follows the prototype of LPD3DXIMTSIGNALCALLBACK.
pUserData
[in] A pointer to a user-defined value which is passed to the signal callback function. Typically used by an application to pass a pointer to a data structure that provides context information for the callback function.
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

This function requires that the input mesh contain a signal-to-mesh texture mapping (ie. texture coordinates). It allows the user to define a signal arbitrarily over the surface of the mesh.

Requirements

Header: Declared in D3dx9mesh.h.

See Also

Using UVAtlas