Performance?

Started by
48 comments, last by Dtag 21 years, 4 months ago
Hi Ive made an engine that renders the following Objects(Optimized Meshes): 1) World with 2600 vertices ( I dont really transform this one ( D3DXMatrixIdentity is used ) 2) Model with 768 vertices 3) Another model with 732 vertices I am getting like 135 frames @ 1024x768 24 bit depth buffer, 16 bit BackBufferFormat. Ive got an AMD 2Ghz GF3 with the newest detonator drivers. The result is a bit disappointing I think commercial games seem to have much less problems handling these performance issues. Whats different on their engines? Is my result that bad?
Advertisement
IMHO your result is TERRIBLE. Unless there is something very fishy in your scene (like tremendous shader scripts or other things like this), the result is WAY too low. Especially given your hardware. WAAAAYYYY too low.

Start reading up the tuning sections of the documentation.


Regards

Thomas Tomiczek
THONA Consulting Ltd.
(Microsoft MVP C#/.NET)
RegardsThomas TomiczekTHONA Consulting Ltd.(Microsoft MVP C#/.NET)
Hey thona!
Thanks for your answer...
I am actually not doing anything special but some simple Matrix Transformations ( Translation, RotationY, Scaling ) and after that the usual static mesh render function:


for(DWORD i = 0; i < m_dwNumMaterials; i++)
{
m_pD3DDevice->SetMaterial(&m_pMeshMaterials);
m_pD3DDevice->SetTexture(0, m_pMeshTextures);<br> m_pMesh->DrawSubset(i);<br>}<br></code><br><br>Another thing Iam rendering ( but I dont think thats the problem ) are some pseudo 2d ''Panels''. What result would you expect for these conditions? </i>
First - no clue what performance you should get exactly. I would say, though, at least 5-6 mio triangles (yes, this is million). I dont know how fast this card of yours is (never worked with the GF3 - went from GF 256DDR to GF4 4400 to RADEON 9700 pro), but your number of frames looks WAY too low. WAY to.

You do have a static mesh, so this should not be it. Clueless, really. Could it be your present parameters?


Regards

Thomas Tomiczek
THONA Consulting Ltd.
(Microsoft MVP C#/.NET)
RegardsThomas TomiczekTHONA Consulting Ltd.(Microsoft MVP C#/.NET)
it could be the creating of the meshes.(Use_Writeonly+Pool_Default)

to much renderstate changes(needed or not)

world is send as 2-8 Tri''s not in one part

There are a few things that I have done that caused my propgrams to slow down without realizing until later, I had done it


Make sure to compile to the release executable. The debug executables will naturally be slower, some times quite a bit slower.

Make sure your timing function is right(yeah it seems simple, but I''ve made dumb mistakes before) though from your results, it seems like it should be right.

Make sure to use the release version of Direct3d. You can change this in the DirectX control panel. I''ve had this make upwards of 100fps difference.

Also, try calculating the number of fps every 10 or 100 or even 1000 frames. This probably won''t make too much of a difference, but I find the average more useful than the per frame fps.

As a benchmark, I''ve got a modeler that is rendering about 1600 vertices and 3000 faces using software vertex shaders at about 220fps on a 1.5Ghz athlon and a GeForce 2mx. I''m sure the software vertex shaders slow things down a lot.

Try tinkering with the settings and see what you get.
______________________________"Man is born free, and everywhere he is in chains" - J.J. Rousseau
Thanks all for your answers!

Thona:
First my present parameters ( for my case ):

BOOL bWindowed=TRUE;
d3dpp.Windowed = bWindowed;
d3dpp.BackBufferCount = 1;
d3dpp.BackBufferFormat = D3DFMT_R5G6B5;
d3dpp.BackBufferWidth = 1024;
d3dpp.BackBufferHeight = 768;
d3dpp.hDeviceWindow = hWnd;
d3dpp.SwapEffect = bWindowed?D3DSWAPEFFECT_FLIP:D3DSWAPEFFECT_COPY_VSYNC;
d3dpp.MultiSampleType=D3DMULTISAMPLE_NONE;
if (!bWindowed)
{
d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
}

d3dpp.AutoDepthStencilFormat = D3DFMT_D24X8;
d3dpp.EnableAutoDepthStencil = TRUE;

{...}

m_pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd,
D3DCREATE_MIXED_VERTEXPROCESSING, &d3dpp, &m_pD3DDevice);
// I already tried using Hardware only but it didnt change anything


Anonymous:
I have tried what you suggested but it didnt really change my result ( currently using SYSTEMMEM and MANAGED )

Cold_Steel:
I am compiling in release ( in debug its even slower ) and the DX is also set to release except for d3dx8d.dll ( which is supposed to be like this i think )
My frames are already averaged. When i measure them, I start the program and let it run for several minutes until the frame number stops moving
I went into one of my programs and tried
d3dpp.AutoDepthStencilFormat = D3DFMT_D24X8; instead of
d3dpp.AutoDepthStencilFormat = D3DFMT_D16;

and it ate about 40 fps. I don''t know how the GeForce 3 is, but apparently my card sux for the 32 bit z buffer.

Try it with the 16 bit z buffer and see how much of a difference it makes. It might not matter too much for the GeForce 3.

Another strange thing I found

Just for reference, I updated one of my models to about 10000 vertices and 18000 faces. It renders at about 135 fps when fully animated, so there is definitely something amiss with your program.

Are you doing anything other than just rendering (input, sound, etc)? It does seem strange. Keep looking, hopefully you''ll find it.
______________________________"Man is born free, and everywhere he is in chains" - J.J. Rousseau
Afternoon, Dtag.

A couple of things:

1) Are you including the d3dx8d.lib in your application (i.e. using the debug version of the d3dx lib)?
You mentioned something about d3dx8d.dll .

2) Are you using ID3DXFont for drawing text on the screen? This interface use GDI, which would slow your fps.

Cheers,
Scronty
- "Has the world gone mad, or am I at work?"
For best performance, vertex buffers should be placed in MANAGED or DEFAULT pool. (most people want managed).

However, your major performance problem is probally because you have not optimized your mesh. meshes'' have sets of attributes, and if they are not grouped together the call is basicallys ending a ton of tiny batches down to the driver. This is fairly bad performance. Most meshes are in rather unoptimal formats when stored in a file (for some reason).

Always call Optimize on your meshes.

EvilDecl81

This topic is closed to new replies.

Advertisement