Jump to content

  • Log In with Google      Sign In   
  • Create Account


ParticleSystem - Updating on CPU?


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
5 replies to this topic

#1 IceBreaker23   Members   -  Reputation: 601

Like
0Likes
Like

Posted 14 January 2012 - 09:40 AM

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?

Sponsor:

#2 Jason Z   Crossbones+   -  Reputation: 4720

Like
0Likes
Like

Posted 15 January 2012 - 11:01 AM

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.

#3 IceBreaker23   Members   -  Reputation: 601

Like
0Likes
Like

Posted 15 January 2012 - 02:02 PM

In direct3d 10 i can use a geometry shader for updating on the gpu side. Is there a possibility in dx9?

#4 Hodgman   Moderators   -  Reputation: 27908

Like
0Likes
Like

Posted 15 January 2012 - 05:02 PM

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.

#5 Tubos   Members   -  Reputation: 153

Like
1Likes
Like

Posted 15 January 2012 - 05:48 PM

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.

#6 IceBreaker23   Members   -  Reputation: 601

Like
0Likes
Like

Posted 16 January 2012 - 12:30 AM

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.




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