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?
5 replies to this topic
Sponsor:
#2 GDNet+ - Reputation: 2372
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.
Jason Zink :: DirectX MVP
Check out our (now available) D3D11 book: Practical Rendering and Computation with Direct3D 11
Check out my Direct3D 11 engine on CodePlex: Hieroglyph 3
Check out our free online D3D10 book: Programming Vertex, Geometry, and Pixel Shaders
Lunar Rift :: Dual-Paraboloid Mapping Article :: Parallax Occlusion Mapping Article :: Fast Silhouettes Article
Check out our (now available) D3D11 book: Practical Rendering and Computation with Direct3D 11
Check out my Direct3D 11 engine on CodePlex: Hieroglyph 3
Check out our free online D3D10 book: Programming Vertex, Geometry, and Pixel Shaders
Lunar Rift :: Dual-Paraboloid Mapping Article :: Parallax Occlusion Mapping Article :: Fast Silhouettes Article
#5 Members - Reputation: 148
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.
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.






