Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


optimized progressive mesh problem

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

Hi, I have a problem when trying to generate a PMesh from previously optimized non-P mesh. In the debug output there are about 550 assertion failures, for example: D3DX: Assertion failure! (d:\builds\nt32_chk\multimedia\directx\dxg\d3dx8\mesh\simplify.inl 2480): iNextPoint < 3 or D3DX: Assertion failure! (d:\builds\nt32_chk\multimedia\directx\dxg\d3dx8\mesh\simplify.inl 5727): m_tmTriMesh.FindPoint(m_tmTriMesh.m_pFaces[iCurFace].m_wIndices, pwFace[iPoint]) < 3 and some other. Here''s a fragment of code doing the optimization&PMesh conversion: //tempMesh is correctly loaded mesh and pAdjBuffer is valid pointer to buffer containing mesh adjacency DWORD *dwAdj=new DWORD[tempMesh->GetNumFaces()*3]; LPD3DXMESH cM; D3DXCleanMesh(tempMesh, (DWORD*)pAdjBuffer->GetBufferPointer(), &cM, dwAdj, NULL); cM->Optimize(D3DXMESHOPT_COMPACT|D3DXMESHOPT_ATTRSORT, dwAdj, dwAdj, NULL, NULL, &tempMesh); SAFE_RELEASE(cM); tempMesh->OptimizeInplace(D3DXMESHOPT_COMPACT|D3DXMESHOPT_ATTRSORT|D3DXMESHOPT_VERTEXCACHE, dwAdj, NULL, NULL, NULL); tempMesh->CloneMeshFVF(dw32bit|D3DXMESH_MANAGED, tempMesh->GetFVF(),pd3dDevice, &m_pMesh); D3DXCleanMesh(m_pMesh, dwAdj, &cM, dwAdj, NULL); D3DXGeneratePMesh(cM, dwAdj, NULL, NULL, 1, D3DXMESHSIMP_VERTEX, &m_pPMesh); //here are interface releases... Please help... Thank you

Share this post

Link to post
Share on other sites
Is the assertion happening on the D3DXGeneratePMesh() call or one of the earlier calls (i.e. have you tried a breakpoint and a single step to confirm that it is actually that call which asserts).

Also which mesh are you trying to use ? - is it one of the ones from the SDK (i.e. can you confirm that your source mesh is valid).

You could try setting up a buffer to recieve the error messages and warnings when you call D3DXCleanMesh to see what problems there are with the mesh.

Also ensure that you link with d3dx8d.lib rather than d3dx8.lib and ramp up the D3D debug output level - that way you''ll get much more descriptive debug output and more checks.

Simon O''''Connor
Creative Asylum Ltd

Share this post

Link to post
Share on other sites
The assertion fails only on D3DXGeneratePMesh. The non-P mesh is optimized correctly and works fine. The problem occurs only when I try to generate a PMesh from optimized mesh. If the source mesh is unoptimized, the PMesh conversion succeeds.

Edited by - malyskolacek on January 12, 2002 8:47:16 AM

Share this post

Link to post
Share on other sites

  • 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!