Jump to content

  • Log In with Google      Sign In   
  • Create Account


Multithreading Particles with Geometry Instancing


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Muzzy A   Members   -  Reputation: 621

Like
0Likes
Like

Posted 13 December 2012 - 04:57 PM

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.

Sponsor:

#2 MJP   Moderators   -  Reputation: 10025

Like
2Likes
Like

Posted 13 December 2012 - 05:06 PM

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.

#3 Muzzy A   Members   -  Reputation: 621

Like
0Likes
Like

Posted 13 December 2012 - 05:19 PM

yeah that's the answer i was looking for =D thanks MJ (Michael Jackson?)




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS