Jump to content
  • Advertisement
Sign in to follow this  
Endriu

100.000 polys once again...

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

In mesh view editor my 100.000 plygons model goes with 30fps but when I run it in my engine it goes only with 5fps. Why? I used standard methods of loading and rendering .x file as in tutorial. Please help.

Share this post


Link to post
Share on other sites
Advertisement
100,000 polys is way too much. I think most models are between 2000-7000 polys. What is the model of?

Share this post


Link to post
Share on other sites
Its a man model but it does'n metter. I know it can be done. In Mesh Viewer it runs just fine.

Share this post


Link to post
Share on other sites
Try

pMesh->OptimizeInplace(D3DXMESHOPT_ATTRSORT, ... )

right after D3DXLoadMesh...

Hope this will help

Share this post


Link to post
Share on other sites
// this buffer holds adjacency information, as DXSDK says:
// "The adjacency data contains an array of three DWORDs per face that specify
// the three neighbors for each face in the mesh. For more information about
// accessing the buffer, see ID3DXBuffer"
LPD3DXBUFFER pAdjBuffer;

// this one for materials
LPD3DXBUFFER pMaterials;

// number of materials in buffer
DWORD dwNumMaterials;

//load our mesh
D3DXLoadMeshFromX("mesh.x", D3DXMESH_MANAGED, pDevice, &pAdjBuffer, &pMaterials, NULL, &dwNumMaterials, &pMesh);


//we have to specify adjacency when doing ATTRSORT
pMesh->OptimizeInplace(D3DXMESHOPT_ATTRSORT, NULL, &pAdjBuffer, NULL, NULL, NULL);

pAdjBuffer->Release();

You can also try D3DXMESHOPT_COMPACT and D3DXMESHOPT_VERTEXCACHE OR'ed with D3DXMESHOPT_ATTRSORT

Share this post


Link to post
Share on other sites
shit, im having an error that
&g_pMesh->OptimizeInplace(D3DXMESHOPT_ATTRSORT, NULL, &pAdjBuffer, NULL, NULL, NULL);
can hold only 4 parameters and:
'ID3DXMesh::OptimizeInplace' : cannot convert parameter 2 from 'LPD3DXBUFFER *__w64 ' to 'const DWORD *'

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Take out that second parameter so that it's:
&g_pMesh->OptimizeInplace(D3DXMESHOPT_ATTRSORT, &pAdjBuffer, NULL, NULL, NULL);

Share this post


Link to post
Share on other sites
Ok I tried all aptions with NULL parameters and none of them seams to improve fps rate:(

Share this post


Link to post
Share on other sites
With code:

&g_pMesh->OptimizeInplace(D3DXMESHOPT_ATTRSORT, &pAdjBuffer, NULL, NULL, NULL);

I'm having this error :

'ID3DXMesh::OptimizeInplace' : cannot convert parameter 2 from 'LPD3DXBUFFER *__w64 ' to 'const DWORD *'


Why? Are u shure it should be like that?

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!