Minimizing Progressive Mesh GetMinVertices

Started by
-1 comments, last by Budai 12 years, 11 months ago
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.

B

This topic is closed to new replies.

Advertisement