Jump to content
  • Advertisement
Sign in to follow this  
Florian22222

ParticleSystem - Updating on CPU?

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

I am trying to write a particleSystem for my little engine.
I took a look in 2 books and both are updating the particles on the CPU and copy it to the GPU every frame. I wondered if this is the best method.
Isn´t inefficient, is it?

Share this post


Link to post
Share on other sites
Advertisement
It depends on how many particles you will be using, as well as what the particles must do. If you don't have that many particles, and they must interact with objects in your scene, then it may be better to use the CPU. However, if you are using lots of particles, then you will likely want to try out a GPU method. An example of a GPU based system can be found in Hieroglyph 3.

Share this post


Link to post
Share on other sites
In d3d9 sm3, you can store particle properties inside textures and update them with a pixel shader. When drawing your particles, their vertex shader fetches this data from the textures.

Share this post


Link to post
Share on other sites
You can also move the particles using a vertex shader. Store the initial values (initial position, initial velocity, ...) inside vertices.
The vertex shader calculates the current position based on those initial values and the current time.

This requires a formula that can calculate the particles position based only on the starting parameters, since there is no way to update the vertex data.

Share this post


Link to post
Share on other sites
Thanks for your replies. I was hoping, that there is an easy way for this. I´ll try to use as low particles as possible, and then i can update it using the cpu.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!