Sign in to follow this  

lots of dynamic vertices

This topic is 4222 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I need to render upwards of 100,000 dynamic vertices. I've got the vertices and indices stored in vectors. I'm dividing the vertex and index buffer into 3 chunks. I fill in the indices as 0, 1, 2, 2, 1, 3... while putting the vertices into each chunk as I go. When the chunk is full, I call drawprim and start on the next chunk. The indices in my vector get mapped to different indices in the ibuffer because I have many more vertices than I can fit into my vbuffer. I use a hashmap to remember if I've sent a vertex to the vbuffer yet. I clear this hashmap each chunk to make sure the indices do not reference vertices from multiple "parts" of the vbuffer. Anything else I should make sure to do? (assume my lock flags are right). Do the same rules apply for vertex buffer size? Around 2-3k?

Share this post


Link to post
Share on other sites
Quote:
Original post by blaze02
Anything else I should make sure to do? (assume my lock flags are right).
Make sure your hashing function takes into account that two vertices that should be indentical may not be, because of floating point errors.

Quote:
Original post by blaze02
Do the same rules apply for vertex buffer size? Around 2-3k?
I seem to recall that there's a presentation by ATI or NVidia about this (Although it may be out of date). From what I remember, you generally want a dynamic VB to be between 1 and 4MB. Static VBs should be 4MB - 32MB. Both sizes are in bytes, not number of veritces, so if you have a 32-byte vertex structure, you're looking at 32k - 128k vertices for a dynamic VB.

Share this post


Link to post
Share on other sites

This topic is 4222 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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