Rain Material


I was hoping this experiment would be a small project but it took a bit of time as I kept wanting to add extra functionality to it.

The masking concept from tri-planar mapping/ WorldAlignmentTexture node gave me an idea. I decided to make dynamic rain material, whereby rain ripples appear at the top, raindrops slide down the sides and there is no rain at the bottom. Here is the material in action:
Final Rain Material
The ripples at the top is a flipbook, made by following Josh Trevisiol's Raindrop flipbook tutorial: https://www.youtube.com/watch?v=2dpFtqlWt1o  As for the rain texture, I painted 3 different variations of raindrop texture into a graypack. The first two are panning slowly and being distorted to give it the realistic motion effect of rain sliding. The 3rd texture is very subtly panned as well but is being masked by noise to make it fade in and out. Adding further variation, I then baked the normal map information in Knald using those 3 painted heightmaps.
3 different variations of rain in RGB Channels (Greypacked)


I then used the masking methods used from the World Aligned Texture node to filter which type of rain is made to appear based on the directions of face.

Masking method used in world aligned texture to prevent overlap of the textures


I thought that having rain material on multiple assets might be really useful for an outside environment, but this would require a lot of copying and pasting. Therefore, I thought about changing the material into a material function because material functions are easily plugged in to any material.

Old, basic Material setup with less customisability

Material Function

I then thought about how it can be used in a game with a dynamic weather system. So I added a Lerp to blend between rain and a dry material. This can then be exposed to a blueprint which can be integrated into a weather system.
Lerp to blend between dry texture and rain.


I also added another normal map texture for heavy rain whereby the water is gushing down rather than in droplets. I got the normal map texture from the starter content folder provided with the project.
Heavy Rain


Final Material Setup:
Final Material Setup with a lot of extra functionality added


Comments

Popular posts from this blog

Environment Showcase Concepts

Distance Field water foam

World alignment (Tri-planar mapping)