PDA

View Full Version : Performance of Samples



Carsten
30-03-2003, 01:17 PM
when I modify the Render-section of Clootie-Sample03 (rotating triangle) the framerate is extremely low:

if (SUCCEEDED(g_pd3dDevice.BeginScene)) then
begin
// Setup the world, view, and projection matrices
SetupMatrices;

// Render the vertex buffer contents
g_pd3dDevice.SetStreamSource(0, g_pVB, 0, SizeOf(TCustomVertex));
g_pd3dDevice.SetFVF(D3DFVF_CUSTOMVERTEX);


for a:=0 to 5000 do
begin

g_pd3dDevice.DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 1 );

end;


// End the scene
g_pd3dDevice.EndScene;
end;

Drawing 5000 triangles should be an easy job even for my Geforce2, shouldn't it? Do these samples not use the fastest way of rendering the scene?

Carsten

Clootie
30-03-2003, 05:01 PM
You gor low framerate due to 2 reasons:
1) For better performance you should minimize total count of DrawPrimitive calls per frame. Optimal is about 500~1000
2) Triangle you are drawing is LARGE, so your bottleneck not in geometry engine of GF2 but in FILLRATE - shrinking triangle size will give you better framerate.

You could get about 10~20 million triangles per second on GF2 card in optimal case.

Carsten
30-03-2003, 08:46 PM
thanks for the explanation!

So rendering one TriangleList containing 1000 triangles is faster than 1000 TriangleLists with 1 triangle?

Is there a documentation where these effects are explained in detail? I have read two direct3D-books but it still seems to be a question of many trials.
I would prefer to work systematically.....

Bye

Carsten

Clootie
30-03-2003, 09:39 PM
So rendering one TriangleList containing 1000 triangles is faster than 1000 TriangleLists with 1 triangle? Definetly!
First, it's just less DirectX API overhead, next is driver overhead, and in this case (DrawPrimitive) is videocard state change overhead!