For this project we were required to make a water material using the single water layer shading model with ripples, foam, and some kind of "dirt". I wanted to make my first iridescent material with this project, so I made an oil spill.
Controls for the Single Layer Water Material. The default values are very strong, so I multiply by 0.001 first. It's largely just fiddling with values with something in the scene until it looks right-
These pillars go down below the screen, and I've set my scatter strength to 130 so they quickly fade.
Absorption Color is red because water absorbs red light the quickest.
Distance field to nearest surface, time, and sine are used to mask the foam/ripples in the water near objects. The outer mask is for the incoming ripples, and edge mask to make sure water next to an object is always surrounded by foam. This is multiplied by some noise and the foam texture mask itself.
The XY values of Absolute World Position are used for texture coordinates across this material so the water mesh's size and UVs do not affect it.
Two normal textures for water pan at different speeds and directions. This is blended with foam normals and WPO waves.
The dot product of surface direction (PixelNormalWS) and light direction (Atmosphere Sun Light Vector) give -1 to 1 values usable for an iridescence gradient. I remapped it to 0-1 and added parameters to use a texture (Oil Mask) for extra variance, distortion from the water movement, and texture size and location parameters.
The brighter areas of the Oil mask are used for dark oil, while the darker outer areas are for iridescence.
The gradient texture also has an alpha channel, which I use for roughness and metal.
Gradient for oil iridescence
Roughness
Water WPO Tutorial: https://www.youtube.com/watch?v=dXlzMScf584&list=PL78XDi0TS4lHBWhZJNOrslnkFWHwE67ak
Iridescence Tutorial: https://www.youtube.com/watch?v=bN84YxaBEGw&list=PL78XDi0TS4lGqHdLQGR2GHne85i9PebbN&index=19
Water Normal Tutorial+ Texture: https://www.youtube.com/watch?v=9GCfFKxg9c0&list=PL78XDi0TS4lHBWhZJNOrslnkFWHwE67ak&index=2
Foam Texture Base: https://everytexture.com/
Misc Masks: https://nielsdewitte.be/VFExtra/
Rock - Unreal Starter Content
Boat - Fab