• Advertisement
Sign in to follow this  

How to create a mesh with two subsets?

This topic is 4948 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

:) I want to create a mesh with two subsets. I successfully create a mesh with one subset by the function 'D3DXCreateMeshFVF', but how to insert another subset into it?

Share this post


Link to post
Share on other sites
Advertisement
Subsets are created in a D3DXMesh via setting the attribute buffer up and then calling Optimize().

The attribute buffer is a table of dwords, one for each face, that you can set to whatever you want to group faces together. For example you could put a index to the material used on each face in there.

Once you've filled in the attribute buffer make a call to Optimize() (or OptimizeInPlace()) and it will reorder the VB and IB data as needed to group your mesh into subsets based on the attribute values.

Alternatively you can directly create and set an attribute table (not to be confused with the attribute buffer), but that is a bit more work.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement