Sign in to follow this  

drawing many particles in groups

This topic is 4202 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

so Im making this particle system and its working pretty nice. However I came across a tutorial in which they split the particles up into groups of size dw_flush (just some number). They would fill a vertex buffer up with that many particles, render them, and then continue from there until they hit that number again. Is there any performance reason for doing this instead of just filling the buffer and rendering them all at once?

Share this post


Link to post
Share on other sites
My guess is the person who wrote the tutorial did some performance tests and found the optimal batch size for their system. It is possible that they picked the size at random, but it's more likely that they have a specific reason for doing this (i.e. the number correlates to the width of their graphics card bus, and thus they dump as much as the bus can take, no more, no less)

Share this post


Link to post
Share on other sites
The reason Kevin (the Codesampler guru) wrote the sample that way, locking with the NO_OVERWRITE flag and writing dw_flush particles, was to show how you can update a buffer without causing a stall or flush. You can probably get similar performance by using a dynamic buffer and lock with the DISCARD flag, since that won't cause a stall or flush either. Both ways use extra memory, but using the DISCARD lock causes the driver to manage the extra memory, instead of the application.

Share this post


Link to post
Share on other sites

This topic is 4202 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