meshes and performance

Started by
8 comments, last by bratsj 21 years, 4 months ago
Hi :-) I have a mesh consisting of 40.000 points When I draw it (with DrawSubset), my framerate goes down to about 1 FPS :-( I don''t understand. The simple mesh-viewer that comes with the SDK renders it with no problem at all (about 50-fold my speed) Am I missing something crucial here ? Is it be the DrawSubset fuction that is so painstakingly slow ? If that is the case, it is perhaps common practice to move mesh data into your own vertex-and-index-buffers and render from there ...
Advertisement
Use DrawIndexPrimitive
Use Tri-Strips, best one Tri strip and degenerated tri''s-
So you are use the vertexcaches right.
And use on hardware vertex processing WRITEONLY+POOL_DEFAULT
optimizing your mesh may help.
did you forget to turn on hardware TNL ?
ty for the replys guys :-)

I''m now trying to get my mesh data out of the mesh
in this (too?) simple way:

LPDIRECT3DINDEXBUFFER8 indbuf;
LPDIRECT3DVERTEXBUFFER8 vertbuf;

mesh->GetIndexBuffer(&indbuf);
mesh->GetVertexBuffer(&vertbuf);

DWORD numf=mesh->GetNumFaces();
DWORD numv=mesh->GetNumVertices();

d->SetStreamSource(0,vertbuf,sizeof(vertex));
d->SetVertexShader(VFLAGS);
d->SetIndices(indbuf,0);

d->DrawIndexedPrimitive(D3DPT_TRIANGLELIST,0,numv,0,numf);

It fails horribly (scene goes garbage !)

By the way, what the heck is hardware TNL ??
Is it a renderstate thing ?
Please specify ...

ty all :-)
As what is VFLAGS define, this could be the error, the FVF must be right, check it !!
Look at the dx8.1b sdk sample Optimised Meshes.
Hardware tnl is the way in dx9 you creat the device
-Hardwarevertexprocessing(hardware only)
-Mixedvertexprocessing(both)
-Softwarevertexprocessing(sw only)

You have to create the meshes right, so they are in the video memory. The flags from Writeonly+default

Anonymous poster, you are spot on target !!

The mesh I loaded did not have the same FVF as mine.
I corrected this and now it''s fine

The framerate however is still down to 10 FPS
for a shape of 25.000 vertices

This may be the best I can get though,
as my Matrox G550 does not (!) support
hardware vertex processing.
I''m not kidding. CAPS really says: no :-(

It then probably follows, that the mesh memorypool
creation parameters on my habla gaburga card
is less relevant ...

As for the DX 9 settings, I am still in the
stoneage with DX 8.1 ...

ty all for your invaluable help :-)
If the problem was ur card , then the MeshView tool would NOT be able to render the same mesh at ~50 FPS .You are missing something .
-Da Mr.RaSt3RiZah-
quote:Original post by Anonymous Poster

You have to create the meshes right, so they are in the video memory. The flags from Writeonly+default



What do you mean by WriteOnly + Default?


I know of D3DXMESH_WRITEONLY from enum _D3DXMESH... But where does default come from? Or am Im totally thinking of something else?
Wikkyd~"Do what thou wilt shall be the whole of the Law!"~Aleister Crowley, The Beast 666
i ment POOL_DEFAULT in the POOL attrib of creatvertexbuffer or createindexbuffer

This topic is closed to new replies.

Advertisement