ID3DXPatchMesh::Optimize method

Optimizes the patch mesh for efficient tessellation.

Syntax

HRESULT Optimize(
  [in] DWORD Flags
);

Parameters

Flags [in]

Type: DWORD

Currently unused.

Return value

Type: HRESULT

If the method succeeds, the return value is D3D_OK. If the method fails, the return value can be one of the following: D3DERR_INVALIDCALL, D3DXERR_CANNOTATTRSORT.

Remarks

After an application generates adjacency information for a mesh, the mesh data can be optimized (reordered) for better drawing performance. This method determines which patches are adjacent (within the provided tolerance).

Adjacency information is also used to optimize tessellation. Generate adjacency information once and tessellate repeatedly by calling ID3DXPatchMesh::Tessellate. The optimization performed is independent of the actual tessellation level used. However, if the mesh vertices are changed, you must regenerate the adjacency information.

Requirements

Requirement Value
Header
D3DX9Mesh.h
Library
D3dx9.lib

See also

ID3DXPatchMesh

ID3DXPatchMesh::GenerateAdjacency