Sign in to follow this  
brucelee

How to optimize DrawIndexedPrimitive call??

Recommended Posts

I render a scene which is consisted by 10000 vertices, using DrawIndexedPrimitive(). When frustum has been done, only 500 faces are been rendered, but I get 3fps on my 32M video card.I read SDK document that MinIndex and NumVertices can be optimized, but I do not know how to use them. I currently set NumVertices to 10000, so it is so slow( I use a static VertexBuffer and a static IndexBuffer ). Can somebody explain the two parameter's meaning to me? Thanx.

Share this post


Link to post
Share on other sites
You should not be getting only 3 fps for 500 faces. the Draw*Primitive calls want to be fed anywhere from 500-2000 polys per call if possible.

Make sure that when you created your index and vertex buffers, you specify them to be created in video memory and not system memory. So you want to use D3DPOOL_DEFAULT instead of D3DPOOL_SYSTEMMEM. If you are creating your buffers in system memory, then all the data has to be transfered to the graphics card every time to call Draw*Primitive. This will be very slow.

Also make sure that you are using hardware vertex processing. You specify this when you create your D3D device.

As far as a good explanation of what all the parameters in DrawIndexedPrimitive mean, Tom Forsyth wrote a great description of all the parameters along with a bunch of other usefull DX9 info. You can find it here.

Hope this helps,
neneboricua

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