ParticleSystem - Updating on CPU?

Started by
4 comments, last by Florian22222 12 years, 3 months ago
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?
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.
In direct3d 10 i can use a geometry shader for updating on the gpu side. Is there a possibility in dx9?
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.
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.
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.

This topic is closed to new replies.

Advertisement