For my second post I wanted to explore an effect that a lot of games have but often look uninteresting, how does the surface of a character dry after being wet.
The result that I got looks better when it goes from wet to dry, but I might experiment with ways of making the surface wet using a different method, maybe a rain effect or something.
The first step was to try to understand what I needed to do, to keep it simple I'm just using fabric.
I identified 4 different stages that I would like the fabric to go through from dry to wet (although the effect is supposed to be from wet to dry, It's easier to start from dry).
- Dry
Material is not changed at all.
Damp
Base color is slightly darkened.Wet
Roughness is lowered and the material gets glossier.Dripping (there is no dripping effect at this point, but this was the best way to describe the fabric being 100% full of water)
All normal maps are slightly blurred.
Apart from 1. which is neutral, all other stages have individual parameters, which might come in handy if I want to use this same Master material for other types of materials, like leather.
For the "Damp" effect I grabbed the base color blending that I did with the Fuzz and DetailCloth (see past post) and used a Lerp with the "Base Color Darkening" parameter as an Alpha so I can control how dark the Damp effect can be.
For the roughness it's pretty much the same thing, just a simple old Lerp making sure to use the previous roughness setup I did before, so I don't lose control over the base Fabric.
The final stage is an effect that is subtle and I'm still debating if it's worth it or not, but it's a cool idea that I will keep in mind so I can use it in the future. Basically, the technique is to force the engine to use a lower mipmap so it smooths out the details, this is to create a feeling that the fabric can't hold any more water, so the water is filling in the gaps of the fabric making it look smoother. (I got this idea from the youtuber "Visual Tech Art").
I created an Input inside my Detail Material Function so I could access it inside the master material and have more control.
Inside the master material, I've multiplied the "Wetness Blur" parameter with the "Wetness" main parameter so It can smooth in as the wetness parameter gets higher.
This effect would just affect the fine details like the tilers, it looks super noticeable on this example, but its mainly because the tile is super big and the model is super close, but I assume the effect is a lot less noticeable from far because the maps are already at a higher mipmap. But it's a cool and cheap effect.
To Give a cooler effect instead of just going from 0 to 1 in the wetness parameter, I've used a gradient with some noise, its tiled only on the U axis of the UV. I used a Lerp node to make sure the transition gets to 100% white, and I also have the Wetness parameter hooked up on a multiply to make sure the gradient is at Black when the Wetness is at 0.
The Ramp control in the middle is to have the effects kick-in in at different stages from one another, before I made this as soon as I started having the material darken it also started to get shinier and smoother, so having those functions gave a more realistic feel to the transition.
Combined with the fabric material I made on the last post, this is how the whole material looks.
In terms of learning I feel like this was super successful, I'm starting to get more comfortable with all the base nodes, and I can feel all the possibilities opening up in front of me.
Same disclaimer as last time, this is my journey into learning, so use what you learn here with caution as this is a process and next post I might discover a lot of better ways of doing the same effects. Also, It's going to take me a while until I really start to care about trying to do pretty stuff, as my main goal is to improve on the technical aspects of Unreal.
This is how the final effect is, in the future I might try to get a better effect of "getting wet" maybe with rain, as of right now this would work pretty well as a "drying" effect, so I would probably have to invert the Wetness parameter so 0 would be wet and 1 dry... but that's not super important right now.
References:
Visual Tech Art
Unreal Engine Documentation - Materials