Jump to content
  • Advertisement
Sign in to follow this  
TianWolf

Need help making wet/rain shader

This topic is 1844 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 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.

Share this post


Link to post
Share on other sites
Advertisement

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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?

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!