Microsoft DirectX 8.1 (C++)

D3DXWeldVertices

Welds replicated vertices together, which have vertex attributes that are equal. This method used specified epislions for equality comparisons.

HRESULT D3DXWeldVertices(
  CONST LPD3DXMESH pMesh,
  LPD3DXWELDEPSILONS pEpsilon,
  CONST DWORD* pAdjacencyIn,
  DWORD* pAdjacencyOut,
  DWORD* pFaceRemap,
  LPD3DXBUFFER* ppVertexRemap
);

Parameters

pMesh
[in] Pointer to an ID3DXMesh object, the mesh from which to weld vertices.
pEpsilon
[in] Pointer to a D3DXWELDEPSILONS structure, specifying the epsilons values to be used for this method.
pAdjacencyIn
[in] Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the source mesh. If this parameter is set to NULL, then ID3DXBaseMesh::GenerateAdjacency will be called to create logical adjacency information.
pAdjacencyOut
[in, out] Pointer to a destination buffer for the face adjacency array of the optimized mesh. The face adjacency is stored as an array of arrays. The innermost array is three indices of adjacent triangles, and the outer array is one set of face adjacency per triangle in the mesh.
pFaceRemap
[out] Pointer to a destination buffer containing the new index for each face.
ppVertexRemap
[out] Address of a pointer to an ID3DXBuffer interface, containing the new index for each vertex.

Return Values

If the function succeeds, the return value is D3D_OK.

If the function fails, the return value can be one of the following values.

D3DERR_INVALIDCALL
E_OUTOFMEMORY

Remarks

This method uses the provided adjacency information to determine the points that are replicated. This method uses an epsilon compare to merge vertices and requires vertices with equal position to already have been calculated and represented by point representative data.

This method takes logically welded vertices and combines the ones that have similar components. Such as normals within fEpsilon or texture coordinates within fEpsilon.

Requirements

  Header: Declared in D3dx8mesh.h.
  Import Library: Use D3dx8.lib.