d3d9.dllOptimize
Microsoft DirectX 9.0 SDK Update (October 2004)

ID3DXPatchMesh::Optimize Method


Optimizes the patch mesh for efficient tessellation.

Syntax

HRESULT Optimize(      

    DWORD Flags );

Parameters

Flags
[in] Currently unused.

Return Value

If the method succeeds, the return value is D3D_OK.

If the method fails, the return value can be one of the following:

D3DERR_INVALIDCALLThe method call is invalid. For example, a method's parameter may have an invalid value.
D3DXERR_CANNOTATTRSORTAttribute sort (D3DXMESHOPT_ATTRSORT) is not supported as an optimization technique.
E_OUTOFMEMORYMicrosoft Direct3D could not allocate sufficient memory to complete the call.


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.

See Also

ID3DXPatchMesh::GenerateAdjacency


© 2004 Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center.