Jump to content
  • Advertisement
Sign in to follow this  
michael879

drawing many particles in groups

This topic is 4418 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
Advertisement
i think render all at once is better for performance

maybe the tutorial is a simple version, can you post the adresse of it ?

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!