Sign in to follow this  

Multithreading Particles with Geometry Instancing

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

Hello, I've made a particle system that's running 500k+ particles at 30 fps using geometry instancing. I want to get as much particles as possible running on CPU, so I thought maybe I would multi thread it. I'm using DirectX 9 and I know it's a little iffy with multi-threading, that's why I'm asking before I even try it.

Will I benefit from multithreading particles with geometry instancing in D3D9? I know it has the multi-threaded flag... but it's known to cause problems.

Share this post


Link to post
Share on other sites
With the multithreaded flag in D3D9 the device will just lock every time you access it, which means if multiple threads are trying to use it they will serialize. However if you have lots and lots of particles, you could so something like this:

- lock buffers on main thread
- on multiple threads, simulate particles and write updated vertex data to the pointer from the locked buffer
- unlock on main thread and issue draw call

This may give you some gains if you're spending a lot of time simulating the particles and writing the data into the vertex buffer.

Share this post


Link to post
Share on other sites
Sign in to follow this