Jump to content
  • Advertisement
Sign in to follow this  
Jamiernmd

Particle System

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

Haven't used DirectX in a while so just trying to get back into it, so I decided to develop a simple particle system. The question I have is, is it quicker/more efficient to create a vertex buffer with a single quad in it, and loop the translation and rendering every time for each particle.... or Create a vertex buffer to contain all particles and render them all in one call to DrawPrimitive(). Obviously this will mean locking and unlocking the vertex buffer every frame to update the positions, velocities etc. So which is quicker, or is there perhaps a better way? Thanks

Share this post


Link to post
Share on other sites
Advertisement
Rendering a bunch of triangles in one go will be much much faster than hundreds of DrawPrimitive calls. You should almost always aim to have as few calls to Direct3D functions, since they can result in an expensive switch from user-mode to kernel-mode so that the driver can take over. DrawPrimitive is especially expensive in this regard.

There are alternatives to locking a vertex buffer, however. For example you could shader constant instancing, or SM3.0 hardware instancing. See Humus's instancing demo for an example.

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!