Jump to content

  • Log In with Google      Sign In   
  • Create Account


Need help making wet/rain shader


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
9 replies to this topic

#1 TianWolf   Members   -  Reputation: 131

Like
0Likes
Like

Posted 28 May 2013 - 01:57 PM

I have just started learning how to write shaders, and written a few simple ones (Diffuse specular etc). But I still don't have the skills to reach my original goal of writing a wet/rain shader. If anyone can point me in the right direction that'd be great. Working in Unity3d BTW.



Sponsor:

#2 TianWolf   Members   -  Reputation: 131

Like
0Likes
Like

Posted 28 May 2013 - 03:13 PM

I'm thinking I'm going to need some sort of height map to decide where the water would pool up, and also something for ripples for when the rain hits. I don't have much experience, and I'm practicing writing a normal shader right now. If there any suggestions about learning shaders that would be helpful for this one, that would be really helpful.



#3 Jason Z   Crossbones+   -  Reputation: 4687

Like
1Likes
Like

Posted 28 May 2013 - 04:26 PM

I think there was an AMD demo a while back that showed off parallax mapping with cobblestones, and it was used for rendering a rainy street scene.  You can check that out as a source of ideas for how they did it - I believe Natalya Tatarchuk was the author of the presentation that I read.



#4 Yourself   Crossbones+   -  Reputation: 1040

Like
3Likes
Like

Posted 29 May 2013 - 01:51 AM

Sébastien Lagarde is writing some fantastic articles about this on his blog



#5 ATEFred   Members   -  Reputation: 1002

Like
1Likes
Like

Posted 29 May 2013 - 02:40 AM

Some ideas / tricks I used in the past:

A mix of particles and camera locked rain sheet cones. We used an offline generated rain mask / top down heightmap to mask out rain drops in occluded areas. We also used that texture to place rain drop splash particles on the surfaces, which refract the scene buffer.

 

then increase colour saturation and change specular settings on materials, also applying additional scrolling normal maps for dripping water, displacing them in the approximated "down" direction. I used our sky hemisphere precomputed occlusion factor to fade the impact of these effects.

If you already have reflection support, you will also want to increase reflectivity on wet sufaces. Finally, lighting rain drops works really well. An easy way of doing that is to push lighting data into a low-ish res volume texture, diffuse through volume, and just texture fetch for the rain particles. 



#6 SuperVGA   Members   -  Reputation: 1118

Like
1Likes
Like

Posted 29 May 2013 - 04:02 AM

I think there was an AMD demo a while back that showed off parallax mapping with cobblestones, and it was used for rendering a rainy street scene.  You can check that out as a source of ideas for how they did it - I believe Natalya Tatarchuk was the author of the presentation that I read.

Exactly. I was really impressed by that one back when it came out. Still am, to be frank.

It's the AMD (ATI, actually) "Toy Shop" Tech demo

 

I found a couple of slideshows on it, but no actual shaders or explanations of their approach. sad.png

http://developer.amd.com/wordpress/media/2012/10/ToyShop-Eurographics_AnimationFestival.pdf

http://www.ati.com/developer/gdc/2006/GDC06-Advanced_D3D_Tutorial_Day-Tatarchuk-Rain.pdf

http://developer.amd.com/wordpress/media/2012/10/Tatarchuk-Rain.pdf (A little more technical)

 

I found this though! Seems like an interesting read! (It's a whole series on wet weather stuff - maybe you should read from its first page!)

 

EDIT: Looks like I relinked to the blog Yourself mentioned a link to. My bad.


Edited by SuperVGA, 29 May 2013 - 06:13 AM.


#7 Alessio1989   Members   -  Reputation: 1661

Like
0Likes
Like

Posted 29 May 2013 - 01:08 PM

There is also a sample by NVIDIA in D3D10, but I think it's more about particles rendering http://developer.download.nvidia.com/SDK/10/direct3d/samples.html#rain



#8 TianWolf   Members   -  Reputation: 131

Like
0Likes
Like

Posted 29 May 2013 - 04:13 PM

Awesome! I'm going through everything now, but wanted to thank everyone more responding first.



#9 ZenDavis   Members   -  Reputation: 133

Like
0Likes
Like

Posted 31 May 2013 - 11:34 PM

So after a bit of research, the shader would have to cover: Diffuse, Normal, Specular, Height, Flow Maps, Cubemap, Vertex Blending, Phong-Blinn, Porosity. Does this sound about right?


Work hard. Become something.

#10 SuperVGA   Members   -  Reputation: 1118

Like
0Likes
Like

Posted 03 June 2013 - 12:25 PM

So after a bit of research, the shader would have to cover: Diffuse, Normal, Specular, Height, Flow Maps, Cubemap, Vertex Blending, Phong-Blinn, Porosity. Does this sound about right?

It won't *have* to. You can probably get by with using only a few of those, but as with so many things, it's a trade-off.

Also, I'm not sure why you're mentioning both types of light, lighting models, the application of flow maps and cube maps. And where would you apply porosity?






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS