Sign in to follow this  
CastorX

XNA particle system

Recommended Posts

CastorX    132
Hy! I'm working on a GPU computed 3D particle system (a very simple one). How can I do that? I've tried to store the particle data position, velocity, ... in textures, but to translate a particle I need to access that texture in my vertex shader code, but that is not possible in D3D9 vshader 3.0 version. I was thinking of use of Vertex textures, but after some reading I've realized that ATi cards (for ex. my MobilityRadeon X1600XT) do not support Vertex textures, and render to vertex buffer is not supported in XNA. Any ideas?

Share this post


Link to post
Share on other sites
Adam_42    3629
Without one of those two features, you'll have to get the CPU involved somewhere although it could be as simple as copying data out of a texture and into a vertex buffer.

Alternatively base the particle position simply off some initial parameters and a time variable, so you avoid the need to feed back the results from the last frame into the calculations for the next frame. For example:

position = initial_position + (initial_velocity * time) + (acceleration * time * time)

Share this post


Link to post
Share on other sites
talhadad    100
Quote:
Original post by Adam_42
Without one of those two features, you'll have to get the CPU involved somewhere although it could be as simple as copying data out of a texture and into a vertex buffer.

Alternatively base the particle position simply off some initial parameters and a time variable, so you avoid the need to feed back the results from the last frame into the calculations for the next frame. For example:

position = initial_position + (initial_velocity * time) + (acceleration * time * time)


I think it should be:
position = initial_position + (initial_velocity * time) + (acceleration * time * time / 2)

Share this post


Link to post
Share on other sites
Mike77    122
The sample on the creators club page does exactly what you are trying to do, you might want to take a look at that.

http://creators.xna.com/en-US/sample/particle3d

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this