Sign in to follow this  
domin

D3DXSimplifyMesh

Recommended Posts

Hi all, I have some problems with D3DXSimplifyMesh function - it works perfectly for some meshes (teapot for example), but for others not work completely (even one polygon is not removed). What causes this? Are there some special requirements for simplified mesh? I try changing all attributes (in D3DXATTRIBUTEWEIGHTS) but nothing changes... Thanks for any sugestions.

Share this post


Link to post
Share on other sites
Maybe it doesn't work for meshes with UV co-ordinates? That might explain why it works with a primitive like the teapot and nothing else.

Share this post


Link to post
Share on other sites
Thanks for answer. Following your sugestion I try to simplify mesh that contains only position and normal data in FVF. I modeled simple sphere - first with separate normals for each vertex and second with shared normals (smooth). The second (smooth) model can be simplified without any problems, but the first model, where each vertex contains own normal cannot be simplified anyway (no polygons removed). This is true for both D3DXMESHSIMP_FACE and D3DXMESHSIMP_VERTEX modes and for various values of D3DXATTRIBUTEWEIGHTS struct. So this leads to conclusion that D3DXSimplifyMesh function works only on smooth meshes? So it is rather useless...

Share this post


Link to post
Share on other sites
Are you running with the debug runtimes enabled? Many of the D3DX mesh functions output information via this mechanism - not just errors, but general info/status details.

Might well be that some property of your mesh is indeed causing problems and the reason is echoed to the debug stream [wink]


A smoothed mesh will have common vertices that can be collapsed, whereas non-smoothed meshes have unique vertices that it might find hard to collapse. What values are you using for D3DXATTRIBUTEWEIGHTS?

Have you tried using D3DXCleanMesh() and/or D3DXWeldVertices() before calling D3DXSimplifyMesh()? Sometimes cleaning and welding can make the data-set more suitable for the various mesh operations...

hth
Jack

Share this post


Link to post
Share on other sites
Quote:

Are you running with the debug runtimes enabled? Many of the D3DX mesh functions output information via this mechanism - not just errors, but general info/status details.

Might well be that some property of your mesh is indeed causing problems and the reason is echoed to the debug stream


Sure, I try, but debug returns nothing about D3DXSimplifyMesh() (even with max debug info level).

Quote:

A smoothed mesh will have common vertices that can be collapsed, whereas non-smoothed meshes have unique vertices that it might find hard to collapse. What values are you using for D3DXATTRIBUTEWEIGHTS?


Almost anything possible - zeroing all, setting some value to one of them while zero to others and vice versa, setting some value to group of them while zero to others... Nothing work.

Quote:

Have you tried using D3DXCleanMesh() and/or D3DXWeldVertices() before calling D3DXSimplifyMesh()? Sometimes cleaning and welding can make the data-set more suitable for the various mesh operations...


Yes, tried this too - only solution is to weld vertices using D3DXWeldVertices() so they have one, shared normal. But this is not solution - mesh is fully smoothed what is not acceptable.

Reasuming - I cant find a way to simplify mesh (exactly: parts of the mesh) where vertices with same position have different normals (at least using D3DXSimplifyMesh()). Maybe somebody knowns other methods to decimate d3dxmeshes?

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