Re: Rain / Thunderstorms ...

New Message Reply Date view Thread view Subject view Author view

Marko Srdanovic (mas++at++swl.msd.ray.com)
Mon, 3 Feb 1997 17:03:08 -0500


On Jan 29, 4:19pm, Rambabu wrote:
> Subject: Rain / Thunderstorms ...
> Hi,
>
> Can anyone give me good pointers to implementing Rain/Thunderstorms
> using Performer ? I did read a posting on the archive sometime back.
> Did anybody try to implement this and if so how did it work .
> If I remember correctly, this implementation was suggesting using
> overlay planes to draw pixels at random. We intend to use the overlay
> planes for something else. So, I was just wondering if there is a better
> approach to this issue.

To implement rain, I took the suggestion from Dennis Pierce in the archive
ftp://sgigate.sgi.com/pub/Performer/selected-topics/atmospheric-fx for
implementing rain. He suggested using a 2d grid and placing "drops" randomly
along the top row and moving them down each frame. I used OpenGL in a postdraw
callback to implement this. I ended up using GL_LINES for the drops.
 Basically, the line gets moved down by one row each frame.

This worked well, but wasn't quite right because it was too rigid. I decided
to get rid of the columns and created the lines in a random position along the
screen and moved them down one row each frame. This was better, but still too
rigid. Basically, I ended up dumping the grid and created lines of random
length, randomly along the top row. Then, I move each line down the screen at
a rate proportional to its length (ie., longer lines "fall" faster than shorter
ones). All the drops are kept in a list and removed from the list when they
reach the bottom of the screen. The random length and rate sort of gives the
rainfall some sense of depth. It's not perfect, and a ton of random numbers
get generated, but it seems to work well.

I haven't tried creating geosets of PFGS_LINES but still think this might have
better results since drops drawn in the postdraw callback never seem to
"disappear" behind objects in the scene.

Good luck.

-- 
-----------------------------------------------------------------------
Marko Srdanovic                             mailto:mas++at++swl.msd.ray.com
Raytheon Electronic Systems                 voice: (508) 858-5680
Mailstop: T3MR8                             fax:   (508) 858-4336
50 Apple Hill Drive, Tewksbury, MA 01876    #include <std/disclaimer.h>
-----------------------------------------------------------------------
=======================================================================
List Archives, FAQ, FTP:  http://www.sgi.com/Technology/Performer/
            Submissions:  info-performer++at++sgi.com
        Admin. requests:  info-performer-request++at++sgi.com

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:54:35 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.