#5 - Water Shader
Been a busy week, but in the evenings I've been working on getting a river water shader, and a spline-mesh blueprint created.
This is the result. A lot of the techniques used were learned from PrismaticaDev's excellent tutorials.
The base of the material is Unreal's SingleLayerWater shading model, which does a lot of the heavy lifting in terms of matching the properties of water and handling things like Translucency, Scattering and Absorption.
The flow effect is handled by two panning normal maps, currently using maps that come as default with UE5. The two maps pan in different directions, relative to the UVs of the object they're applied to.
The shader also includes ripples, edge-foam, and world-position offset, driven using Distance Fields. The "DistanceToNearestSurface" node creates a gradient mask on the object, based on how close it is to surfaces, the result of which can be manipulated to create these kinds of effects automatically.
This effect works for where the water meets the landscape, as well as for any rocks or other objects placed in the water.
The river mesh itself is a simple, subdivided plane mesh:
Comments
Post a Comment