XNA UK User Group

A helping hand for bedroom coders throughout the land.
in

RandomChaos

December 2007 - Posts

  • Rolling Fog

     

    After playing around with my clouds in the sky sphere I thought that the principle could also be carried over to fog, and it seems to work quite well!

    I am yet to tidy up the source and test on the XBox 360, as soon as I have it sorted I will post it.

    It's hard to see in a still, but the fog is actually animated and is rolling across the scene.

    Well I hope you all had a great Christmas and hope you like playing with this rolling fog :)

  • 3D Scaled PointSprite Particles

    http://www.youtube.com/v/_sx0KDO-ZbA <p><a href="http://www.youtube.com/v/_sx0KDO-ZbA">http://www.youtube.com/v/_sx0KDO-ZbA</a></p>  

    Well as mentioned in my previous post, here is the 3D particle system again only this time the particles are scaled. Now I didn't think that you could scale pointsprites, but it turns out you can :P

    I found out after going to an XNA meeting set up by the .NET Developer Network, a friend of mine, Dave, was giving a talk there and so I tagged along and was interested to see another speaker, Peter McGann, describing his game being demoed and as he was talking us through it he happened to mention that his particles were point sprite particles and I noticed they were being scaled, so I asked how he was doing it and he said he would mail me the shader. In the mean time I got home, and me being me wanted to know how it was done so mailed Leaf, who sent me almost an identical chunk of code as Peter McGann then sent me.

    So thanks to both of you for showing me how this is done.

    Basically you need to set up a parameter in your vertex shader return structure that tells the hardware to scale the point sprites, this is done with the PSIZE semantic. In the vertex shader you can then calculate the size the given particle needs to be. In my shader I have set a default particle size that can be altered by passing in a new value as well as the height of the view port.

     You will find 4 projects in the download, 2 for XNA 1.0 Refresh with one being for the PC the other for the XBox and the same again for XNA 2.0

    3D Scaled PointSprite Particles

  • Merry Christmas!

    Well it's almost here and as you can imagine, I will not be posting as often due to the holiday season, so I thought I would let you know what I am thinking of doing in the new year.

    Next few posts will be relating to scaled point sprite particles and simple physics, my current point sprite particle system is not scaled which is fine for a close up particle effect but it lacks volume, the next point sprite particle system will remedy this. I have not really looked much at game physics but the more I play and write the more obvious it is to me that regardless what game it is you need some form of rudimentary physics (I know it's a no brainier!) I guess there are a few physics engines out there like BulletX and JiggleX etc.. but personally I like to reinvent the wheel, that way I know exactly how the wheel works (admittedly, not all of my reinvented wheels are perfectly round..) Also I think it would be nice to have a physics engine that covers all the very basic elements that will be required by a home brew game.

    Also in the new year I intend to be going back over my Generic XNA posts and convert the projects over to work with XNA 2.0 and now that I have a Creators Club subscription on the XBox360. I also intend to revisit a few topics like A.I and the FSM to add messaging between agents and singleton states and the Sky Sphere and clouds aiming to give more volume. I just hope I can get it all in!

    So planed for the new year:

    • Scaled PointSprite Particles
    • Simple Physics System
    • Revisit old topics and improve on or add to.
    • Download Projects to include XBox 360 Projects
    • Download Projects moved to XNA 2.0 (once on full release)

    I am kind of hoping I can get the particle system out on here before the end of the month, but if I don't, then Merry Christmas to all those that read this blog, hope you have a good one :)