Monday, 17 August 2009

Rain

Today I added a particle-based rain system, which you can see in the latest screen-shots. Currently it generates one thousand particles which are updated every frame based on their velocity. The system itself introduces gusts of wind at random intervals for random lengths of time, and this affects the movement of the particles.

Because rain tends to be at terminal velocity by the time we see it, the particles are given a starting velocity that only changes in the x- and z-dimensions (i.e. horizontal plane). Each frame, before gust influence is calculated, these values are decreased so that the particles will go back to straight downward motion, to simulate air resistance and to give a smooth reduction when a gust stops.

No comments:

Post a Comment