Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split Mesh #5

Open
walbourn opened this issue Jun 18, 2015 · 2 comments
Open

Split Mesh #5

walbourn opened this issue Jun 18, 2015 · 2 comments
Labels

Comments

@walbourn
Copy link
Member

A function to break a mesh into multiple index buffers/vertex buffers based on a specified size.

void D3DXSplitMesh(
  _In_   LPD3DXMESH pMeshIn,
  _In_   const DWORD *pAdjacencyIn,
  _In_   const DWORD MaxSize,
  _In_   const DWORD Options,
  _Out_  DWORD *pMeshesOut,
  _Out_  LPD3DXBUFFER *ppMeshArrayOut,
  _Out_  LPD3DXBUFFER *ppAdjacencyArrayOut,
  _Out_  LPD3DXBUFFER *ppFaceRemapArrayOut,
  _Out_  LPD3DXBUFFER *ppVertRemapArrayOut
);

This primary use of this function is to take a mesh that requires 32-bit indices into a set of meshes that only requires 16-bit indices, which is most useful when preparing meshes for Feature Level 9.1 devices.

@walbourn
Copy link
Member Author

The need to support Direct3D Feature Level 9.1 is very low. Even UWP apps and Windows phone 8 can assume Feature Level 9.3 or better.

@walbourn
Copy link
Member Author

The split algorithm is basically a loop over faces. If the number of vertices required by adding a new face exceeds a threshold, a new mesh is created.

The function would need to return n IBs, n lists of attributes, and n VB remaps from the original.

It provides updated adjacency information for the new "meshes" by breaking links between split faces.

@walbourn walbourn pinned this issue Oct 16, 2021
@walbourn walbourn unpinned this issue Oct 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant