Jump to content
  • Advertisement
Sign in to follow this  

Minimizing Progressive Mesh GetMinVertices

This topic is 2614 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 am currently struggling with ID3DXPMesh, trying to get the minimum number of vertices as low as I can get it. Currently, I can decimate down to between 20% and 30%, but that is not quite cutting it. I was hoping to be able to go down to ~1% and not have to create low-res versions or impostors.

My current method is as follows:
  • create an ID3DXMesh and load it with an OBJ file
  • generate adjacency
  • compute normals (right-hand <-> left hand messes up lighting somehow, this fixes it)
  • validate mesh, and if failed, clean using D3DXCLEAN_SIMPLIFICATION, and setting the output mesh and adjacency to the same as input
  • weld twice, using a zeroed epsilons structure
  • set a different weight for every vertex (in a for loop execute vertexWeights = (float)i / (float)vertexCount;)
  • create an ATTRIBUTEWEIGHTS structure, and zeromemory it
  • generate the mesh using HRESULT generateProgressiveMeshResult = D3DXGeneratePMesh(mesh, adjacency, &attributeWeights, vertexWeights, 100, D3DXMESHSIMP_VERTEX, &progressiveMesh);I have tried cleaning the mesh regardless of the validation result, but it does nothing. I have also attempted to adjust values for epsilons and attribute weights, which only seems to make the situation worse.

    Is this normal? Or am I missing something which would allow me to get the requested 100 vertices (or close to it)?

    I have also thought of upgrading the editor to allow editing of vertex weights, to see the result as you edit them, but that does not sound fun, and I'm pretty sure my artist would just lol.


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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!