Things are coming along nicely now. I've finished almost all of the major particle system features I wanted and only made one blunder along the way (I didn't consider how difficult it would be to sort particles in a freelist).
So whilst the following screen shots might not look like they have anything to do with Space Crusade rest assured that a good particle system should make blowing stuff up look great. And with no further ado, here is the first shot:
It's a field of pretty flowers and the embryonic alien. Why? Just because!
All the expected particle goodness is here: Specifiable UV coords, sizes and rotations. It's also possible to fade and/or shrink particles as they turn away from the camera as well as alowing the particles to be axis aligned (for billboarding). The space ship that can be seen (sort of) here has nothing to do with anything; I just use it as point of reference - it's actually a concept model I did for someone else.
The next two screen shots are considerably more boring. They demonstrate that it is possible to set the number of triangles that a particle can be drawn with (1 or 2). The reason being two triangles give a nice square particle which is easily textured but requires 6 vertices whereas one triangle only requires vertices 3 and is perfect for round particles.
All in all I'm happy with the weekends work although it would have been nice to get some Space Crusade specific code going. I might have, had I not run into an interesting renderstate issue. Which took about 3 hours to track down (don't use D3DRS_WRAP0 with D3DWRAP_U as well as D3DTADDRESS_WRAP this has some seriously strange behaviour and gives a maximum UV range of 0.5).
And on that technical note I'm going to leave my computer alone now.
Later!
So whilst the following screen shots might not look like they have anything to do with Space Crusade rest assured that a good particle system should make blowing stuff up look great. And with no further ado, here is the first shot:
It's a field of pretty flowers and the embryonic alien. Why? Just because!
All the expected particle goodness is here: Specifiable UV coords, sizes and rotations. It's also possible to fade and/or shrink particles as they turn away from the camera as well as alowing the particles to be axis aligned (for billboarding). The space ship that can be seen (sort of) here has nothing to do with anything; I just use it as point of reference - it's actually a concept model I did for someone else.
The next two screen shots are considerably more boring. They demonstrate that it is possible to set the number of triangles that a particle can be drawn with (1 or 2). The reason being two triangles give a nice square particle which is easily textured but requires 6 vertices whereas one triangle only requires vertices 3 and is perfect for round particles.
All in all I'm happy with the weekends work although it would have been nice to get some Space Crusade specific code going. I might have, had I not run into an interesting renderstate issue. Which took about 3 hours to track down (don't use D3DRS_WRAP0 with D3DWRAP_U as well as D3DTADDRESS_WRAP this has some seriously strange behaviour and gives a maximum UV range of 0.5).
And on that technical note I'm going to leave my computer alone now.
Later!
3 Comments:
Nice!! Particles are always fun. When you say 'Sorting', do you mean you are z-sorting your particles?
The reason I ask is that for particles I generally disable depth-write (but keep depth read enabled ) and it is normally not noticable when you don't bother to z-sort - unless of course you have the pathological case where every particle is draw in exactly the wrong order :)
By Justin Paver, at 9:02 am
Yup all particles are drawn with z reading and writing because I don't do any sorting myslef - I'm just leaving it to the z-buffer for now. This is why there are no translucent particles.
I'll probably fix this next weekend. Basically the problem I ran into was I couldn't decide if I wanted sorting within one particle system or across multiple systems.
One alternative I have to real sorting is to just draw the particles in reverse order if thats their average ordering. eg: a rocket trail viewed from the front vs from the back.
By Andrew, at 9:55 am
Nice idea!
I suppose if you have a generally continuous motion vector for a system that is emitting the particles, you could simply dot-product that against the camera's 'at' vector to determine the direction to render from ;)
By Justin Paver, at 1:32 pm
Post a Comment
<< Home