Jump to content
  • Advertisement
Sign in to follow this  
Quat

D3DXWeldVertices

This topic is 3721 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

A file format I am supporting is just a vertex list (every three vertices is a triangle), with no real index info. So there are a lot of duplicate vertices. Will D3DXWeldVertices combine duplicate vertices and recreate the optimal index buffer for me? I'm just trying to figure out if this is the function I want, so I don't have to program an algorithm myself. Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
As far as I'm aware D3DXWeldVertices only looks at and modifies the vertex data. It's not used to generate a brand new index buffer for your mesh.

Having said that, you should be able to use this function along with ::OptimizeInPlace() to generate a reasonably good index buffer from only the vertex data. Create an 'identity' index buffer with no re-use and then perform your weld operation and collapse indices where necessary and then optimize it to try and get the best rendering order.

hth
Jack

Share this post


Link to post
Share on other sites
You may wish to check out the D3DXCleanMesh function. Also, its my experience that D3DXWeldVertices doesn't work all that well, but YMMV. I should also mention that I've also experienced that D3DXCleanMesh can actually produce worse results than without, even on well formed meshes. This was happening some time ago and may be fix by now. Whilst I generally think the Microsoft D3DX functions are great, these two particular functions have been somewhat problematic for me.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!