Jump to content
  • Advertisement
Sign in to follow this  
grunt123

rain rendering

This topic is 4499 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i read about the rain rendering used in Toybox demo that was presented in GDC. Could anyone explain what exactly they did to create rain rendering? They say that they are using 'composite rain rendering technique' ... Any idea? ps: Here is a link to the paper (refer to 'Rendering Rain' title) http://www.ati.com/developer/gdc/2006/GDC06-Advanced_D3D_Tutorial_Day-Tatarchuk-Rain.pdf

Share this post


Link to post
Share on other sites
Advertisement
ok, ATI demo is using some kind of post-processing effect for the actual rain rendering ... i'm wondering if there is any previous research on this technique of rendering rain? This sounds pretty new (or i haven't heard about it ... I usually make rain effect by utilizing particle effect)

From the presentaion slide, it almost looks like that some algorithm composes a full-screen rain texture and render it in full-quad (full screen). Any thought?

Also, what could be an effective way of rendering rain? (besides particle effects)

Share this post


Link to post
Share on other sites
It seems they use 1 or 2 greyscale "rain maps" that are scrolled at different rates and added together. I'm guessing kinda like this (In GLSL form, I don't know HLSL ;) ):



//pseudocode
uniform sampler2D rainmap1;
uniform sampler2D rainmap2;
uniform vec3 rain_direction;
uniform float time;
varying vec2 texcoords;

void main(){
vec2 rain_direction2d(rain_direction.x/rain_direction.z, rain_direction.y/rain_direction.z);
//use whatever scroll values you want here
float perturb1 = 0.5*time;
float perturb2 = 0.7*time;
float c1 = texture2D(rainmap1, perturb1*rain_direction2d + texcoords).r;
float c2 = texture2D(rainmap2, perturb2*rain_direction2d + texcoords).r;
float outcol = max(c1, c2)*vec3(1.0, 1.0, 1.0, 1.0);
glFragColor(outcol);
}

Share this post


Link to post
Share on other sites
I remember making a rain demo years ago using 3Dfx API. It would only render "real" rain around you and we tested for hits in puddles (pre-placed areas for water to collect). It was sweet but slow, might try something like that again soon just to see how it works on modern hardware (sure it won't be an issue).

Edit: After watching that seems to be what they do. Least for the stuff not right up front. Stuff upfront could just be like others said, dual combined gray scale maps. The stuff behind is more impressive, running off the roof :)

Share this post


Link to post
Share on other sites
It looks pretty but looking at the paper its definitly not something you can just plug in.


The majority of the rain looks like it was a single texture which was accumulated and motion blured. this way they can change the settings of the motion blur to change speed, direction, and opacity. a higher rain velocity means a higher blur distance per frame. it also looks like they devided the blur by a depth map to give the layers. according to the paper its a single texture they use not multiple layers


for the reflections on sidewalks they rendered the objects geometry in a different buffer and put that onto a quad. which was stretched. this was only done for objects that move. static lights where put into a lightmap.


the mist off the surface is an easy one its fins over the object multiplied by the light and mapped with the rain texture.


forgot to mention that the splashes are still collision tested using a particle system. same thing with the flowing water. seems like a hog to me there has to be a better way by using montecarlo int and randomly selecting a pixel on the depth buffer then scale the collision animation by the depth. sounds complicated but to me it sounds much more effcient then using particle systems for all of the dynamic rain.



I find particle systems usually like a brute force way of doing things.

[Edited by - Lemonaid on June 26, 2006 11:27:38 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by grunt123
ok, ATI demo is using some kind of post-processing effect for the actual rain rendering ... i'm wondering if there is any previous research on this technique of rendering rain? This sounds pretty new (or i haven't heard about it ... I usually make rain effect by utilizing particle effect)

From the presentaion slide, it almost looks like that some algorithm composes a full-screen rain texture and render it in full-quad (full screen). Any thought?

Also, what could be an effective way of rendering rain? (besides particle effects)




actually microsoft did work on rain in there old flight sim that used a cone over the camera and the rain was animated by modifying the UV map on the rain textures (which was multipassed). this was before pixel shading and I think ATIs method is a better one with better looks, but is a bitch to implement. MS method was pretty efficent and looked pretty good.

Share this post


Link to post
Share on other sites
Game Programming Gems 5 has an article on the way Microsoft did it in Flight Simulator. Although no code samples are given, it's still interesting and it looks pretty good(although, ATi's looks way better). It presents some of the matrix math that they used to make it customizable.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!