XNA UK User Group

A helping hand for bedroom coders throughout the land.
in

This Blog

Syndication

RandomChaos

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

Comments

 

Mike Cann said:

Hi nice work mate.

You can really do some amazing things with scaled point sprites check out some of this stuff that i did a while back for xna1.0:

www.artificial-studios.co.uk

www.gameprojects.com/project

www.artificial-studios.co.uk

December 26, 2007 12:27 PM
 

Nemo Krad said:

Thanks  Mike,

Had to remove the links as I was told by the system that this could have been spam. Don't know why removing these links got the post up, may just have been timing :P

Anyway, back to the tread... Having seen your 2D particle stuff I could not wait to see your scaled particle example, alas, the links you supplied did not take me to ant, please put them up again or mail me them and I will put them on here.

Thanks for the comment :)

December 26, 2007 9:11 PM
 

TrackBack said:

January 4, 2008 4:17 PM
 

RandomChaos said:

I have just put up a video showing my physics engine and scaled 3D particle system that I will be using

February 21, 2008 1:12 PM

Leave a Comment

(required)  
(optional)
(required)  
Add

About Nemo Krad

Have been a professional developer since 1995. My skill set ranges from C/C++, VB6,MSSQL, Java Script, VB Script, HTML/ASP, Java, C#, ASP.NET as well as others. I started 3D and games development when the first release of XNA came out in December 2006 and have become addicted to it.