Results 1 to 4 of 4

Thread: Performance of Samples

  1. #1

    Performance of Samples

    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

  2. #2

    Performance of Samples

    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.
    There are only 10 types of people in this world; those who understand binary and those who don't.

  3. #3

    Performance of Samples

    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

  4. #4

    Performance of Samples

    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!
    There are only 10 types of people in this world; those who understand binary and those who don't.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •