Jump to content
  • Advertisement
Sign in to follow this  
CastorX

XNA particle system

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

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
Advertisement
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
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
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!