Rain on Glass Roof animated shader?

I want to create the effect of rain falling on and running down a glass roof.

I understand I can use the glass refractive shader that’s in the Pro Standard Assets and create an animated tiling texture that shows rain drops and water trickling downwards.

I don’t know how to add an animated tiling texture to a shader though. Does anyone have any ideas?

Thanks very much.

Rain running down glass is a complicated effect, so it’s probably best to get your animation from somewhere as a loopable and tileable video, and then use it as a MovieTexture in the normal map of one of the Pro glass shaders. Unfortunately, I’m not familiar enough with 3D modelling packages to know how you’d generate such a video. Also, I don’t believe you can import videos as normal maps automatically in Unity, so you’d have to make it a normal map ahead of time.

OK, that’s a start. You can just add a movie file to the normal map in the shader? I had no idea. Do you know of any documentation anywhere about this? I haven’t found anything in the manual or the Wiki yet.

Can you add other things? A tiled texture sheet?

Thanks.

MovieTexture.

You can’t use texture sheets without special shaders if you want to do tiling.

This might be helpful:

Again, this approach doesn’t support tiling the animation on an object. Unless you’re Ok with having each frame stretched across the entire roof, you should use a MovieTexture or some other approach.

Thank you.

I’ve used both these methods but I don’t think either are suitable to this particular application because of the scale of it.

My understanding is that you can animate a shader texture. I’ve been looking into it this evening and I think that’s how they do the water shaders but I don’t know exactly how it works and I can’t find any documents.

How about doing:

renderer.material.mainTextureOffset -= Vector2.up * Time.deltaTime;

and then UV mapping the skylight so sliding the texture down the UV also slides it down in worldspace.

Hi Cannon.

Thank you, I think that’s exactly the sort of thing I was looking for. I’m just looking at the Sewer Demo and that has a scrolling script for the waterfall texture that I think works the same way as what you are suggesting. I’m going to try and apply it to my scene and then adapt it.

Hopefully.

It also has a refraction shader that’s not in my set of Pro Standard Assets which I’m going to try too.

Fingers crossed!

Would love to see it working if you had any success.

If you go to the web address at the bottom here and wait about half an hour for it to load you’ll see it in action.

I’ve some optimization to do yet.

That is one weirs psychodelic scene!

In the basement how did you go about implementing the rain and the splashing when they hit a collider? Would you be willing to share the code for this?

Happy to. Not my code though it’s from Bruindigo here: http://forum.unity3d.com/viewtopic.php?t=10613&highlight=rain

I have made a half arsed attempt to add rings but it doesn’t work very well if you look closely as I haven’t figured a way yet to get splashes and rings attached to the same collision but this is because I have no scripting background, I’m from the Art side.

I’m currently taking a Java Script course but have discovered even doing my own accounts for the first time was easier than my homework (how do you get a hexadecimal number to doc.write as a colour and is this advanced for week three of a two hour a week course?) so it may be some time before my rings and my splashes line up.

Good luck.

Well done , rain effect on roof look soooo realistic , unfortanely i dont know how to make that effect :((( , can you give me tutorial :)?

What about this?

http://forum.unity3d.com/threads/78751-Rainscapes-Coming-Soon!?highlight=rain

Also this: http://forum.unity3d.com/threads/77818-UniSky-v1.2-Procedural-Weather-Update