Sign in to follow this  
Budai

Minimizing Progressive Mesh GetMinVertices

Recommended Posts

Budai    100
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:
[list][*]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[i] = (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);[/list]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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this