Sign in to follow this  
Endriu

100.000 polys once again...

Recommended Posts

Endriu    100
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
SHKiN    122
// 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
Endriu    100
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   
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
Endriu    100
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
Saruman    4339
I hope you arne't planning on using this 100k beast in a game, because you just blew your polycount budget with a single guy :)

And stop cross-posting.. you're making the mods do a bunch of work to lock your junk threads.

Share this post


Link to post
Share on other sites
Saruman    4339
Quote:
Original post by Endriu
My game will only have one model.

If it's 100k polys than yes... it will only have a single model on a black screen :) That is not a realtime model.

Share this post


Link to post
Share on other sites
Endriu    100
for ypur information Saruman. There is an example in Direct 3D SDK wich goes smooth with 1.000.000 polygons. Unfortunetly it does not work with my model.

Share this post


Link to post
Share on other sites
SHKiN    122
Check device creation:
- use D3DCREATE_HARDWARE_VERTEXPROCESSING if your VPU can do HWVP
- set D3DPRESENT_INTERVAL_IMMEDIATE for PresentParameters.PresentationInterval

Load mesh into D3DPOOL_DEFAULT or D3DPOOL_MANAGED, not into D3DPOOL_SYSTEMMEM, if you do

Switch do Debug D3D and check for error messages

And of course, (DWORD*)pAdjBuffer->GetBufferPointer instead of &pAdjBuffer

BTW, may be you should read DXSDK?..

Share this post


Link to post
Share on other sites
Drew_Benton    1861
Quote:
Original post by Endriu
for ypur information Saruman. There is an example in Direct 3D SDK wich goes smooth with 1.000.000 polygons. Unfortunetly it does not work with my model.


Do you have the name of that sample and what release of the SDK. That is something even I'd like to see.

Share this post


Link to post
Share on other sites
Saruman    4339
Quote:
Original post by Endriu
for ypur information Saruman. There is an example in Direct 3D SDK wich goes smooth with 1.000.000 polygons. Unfortunetly it does not work with my model.

Actually, no there isn't... that would cap out a 6800 Ultra at ~57fps or even lower depending on batching/materials. There is a reason games use 2000-11000 polygon models.. with the majority being in the 2000-5000 range.

Share this post


Link to post
Share on other sites
matches81    474
in fact 2000 to 5000 polygons should be enough for most things you would like to display like a human model or similar stuff... with normal mapping you don´t need a poly for every single wrinkle in the skin.
I´m currently rendering around 70.000 polys at around 140 to 150 fps (according to NVPerfHUD) on a GeForce 6800GT, 1680x1050 resolution with 4x FSAA and 4 textures and I am still a bit proud about it, though I am sure there is still room for much more.

So I´d guess, 100.000 polys at 5 fps is a bit slow. Do you use some stuff like anti-aliasing, normal mapping or anything special? Never used D3DXMESH yet, so I don´t know how well it handles that poly count. Too many subsets => draw-calls perhaps?

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