Friday 30 March 2007

XNAGPUParticles (1,000,000 Dynamic Particles)

This is another submission of work i have done in my final year. This time the project is all my own work.

The project is a continuation based on work from before Christmas and is an experiment into state preserving particle systems. I started out with examining the basic particle systems such as a static system and one that updates on the CPU. I then moved onto more advanced systems such as the GPU based system described by Lance Latta and others. I soon discovered however that XNA doesn't support "uber buffers" and as such had to invent a new solution using vertex textures. The result is a particle system written in XNA that is able to update and render 1,000,000 particles at about 22 frames a second with 4 forces.

To view this demo you first need to have the XNA runtimes. If you dont have those just go HERE.

Once installed you can grab the binary for this project http://www.mikecann.co.uk/Work/XNAGPUParticles.zip

If you are interested in seeing the source code for this project, just drop me an email: mike.cann@gmail.com

Oh also, the written report for this can be found http://www.mikecann.co.uk/Work/GPUParticles2003.doc

11 comments:

  1. Looks pretty cool :)
    Is there any kind of support for assigning shaders to particle systems?
    (Like a for use as texture on a billboarded sprite?)
    A million particles?! I'm so jealous. We're working with the Unreal3 engine and let's just say the particle performance is somewhat lacking. We make up for it with shaders though. It's amazing what you can do with them. To bad we have to actually have a game running at the same time as the effects...
    Cheers!

    ReplyDelete
  2. The way this system works is to use point sprites so a single texture per vertex. Tho having just thought about it i dont see why it couldnt use billboarded quads to render as nothing is being passed from CPU to GPU per render so the increase in number of verts shouldnt affect performance too much. Hehe ye, well you have to work out whether you have more GPU power on your system than CPU power. If you do then this type of system may be a good idea but if u have a CPU powerfull system (multi-core) then it may be more productive to create particle systems on the CPU instead. Perhaps ill do some more investigations in the future to see. Mike

    ReplyDelete
  3. Yo Muppet,
    Have you run this on any 8800 hardware. I get a nice black screen for all the demos apart from the last one (GPUVTForces) where I see a green grid, 3 blue dots and 1 yellow one.

    Worked okay at work today tho, pretty cool. Only 1 mill particles tho, surely Worms had more than that :-P

    Let me know if you suss out what's causing the black screen.

    Take it easy
    Lee C

    ReplyDelete
  4. Almost forgot, you know you made the news page on Ziggyware with this and Portal2D... nice one matey.

    ReplyDelete
  5. ack,
    Sounds like its a problem with point sprites on the new hardware.

    I have looked into 8800 papers but the only mention about point sprites is that "they are greatly improved in performance".

    I have posted in a coupple of places asking anyone has had any troubles with it, waitin on replys.

    Ye i know about ziggy, cool huh :D

    Mike

    ReplyDelete
  6. Mike,
    This 8800 thing might be a driver issue. I have just updated to the latest drivers and now none of the demos show anything on screen... well apart from the last one that still shows the grid and the force markers.

    Bah!

    ReplyDelete
  7. Hi Lee,

    Thats not good :( Someone on the XNA forums suggested i try to debug the app in ref rast mode which means everything is simulated on the CPU. Apparently if it works in that mode then its something with the graphics card not with my code. Ill take a look at it when i get round to it :D

    Cheers for the update,
    Mike

    ReplyDelete
  8. [...] always need something to be working on in my free time. All this year it has been my University projects that have been keeping me busy. But now all i have left is one exam I have been seeking a [...]

    ReplyDelete
  9. [...] around abit, I discovered that it was the same problem I encountered before when I released my 1,000,000 particles demo a few months ago. The problem is that ATi dont include the ability to use Vertex Textures in their [...]

    ReplyDelete
  10. From looking at this particle system im really intrigued as to how it works and try and implement something myself,

    unfortuently i cant seem to finds the downloads, there no longer working on this blog. If there is another dl link or if you could email me the dl link if this is still a function application

    ReplyDelete
  11. Hi John,

    Sorry about that mate it seems that in the hosting transferr a whole load of my posts got borked. Im working to fix them now and will mail you when I have it all up and working again :)

    Cheers,
    Mike

    ReplyDelete