Sign in to follow this  

VertexBuffer/DrawPrimitive Question

Recommended Posts

Hi, I'm currently programming a static object rendering system, could be used for terrian or whatever. Pseudo--code for the way it works -Setup -Read quad details from file into a linked list (Not vertices) -Create another linked list. This will hold brief details of each quad group. Initially each quad is in its own group. -Sort the new list by texture. -Group nodes together so instead of having lots of calls for 1 quad with 1 texture, get less calls of lots of quad with 1 texture. -take 6 vertices for a standard quad and transform in software according to the nodes, then copy these new verts incrementally into a VB, moving through the VB every 6 verts. -Frame -Run through the 'Brief Details' list and set texture and call drawprimitive. Draw Primitve is told where to start drawing form and how many prims to draw from the brief list that i loop thorugh at this time. This maybe a little confusing and probably isnt the best method. In simple terms: - Each frame at the moment calls DrawPrimitive() only twice and each call renders 30 vertices in a triangle list. - The first call draws vertices 0-29, theyre of texture 1 - The second call draws vertices 26-59, theyre of texture 2 I cant for the life of me work out why when doing this i get 41FPS. Trust me my computer specs are far beyond this so that isnt a problem. I have stepped through the code so many times and checked the data that gets written to the vertex buffer and eveything and still cant get it. any help appreciated, thanx, ace

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