Distance field Water Foam

After completing work on the Gerstner wave. I remembered that there were water foams in the water system mentioned in Simon Trumpler's Blog. The foam uses 2  unique looking textures panning that uses a disk mesh however the Mesh UVs made the foam.









I've also been looking at other water foams other artists have made. I noticed that Alex Vinogradov also produced the same result using a similar technique as Simon's method but with traditional noise textures. It produced a uniform result with the noise texture he used.


You can see the full guide here:  https://www.artstation.com/artwork/20Kzy

I recalled that Vectortoradialvalue is a node in one of my older projects that force distorts the texture Coordinate into a circle. A bit like the Polar Coordinate filter from Photoshop. So I decided to experiment and try using noise texture and distorting it.
Vectortoradialvalue Node - Texture Coordinate
converted into Polar Coordinate like the Photoshop filter

After producing this, I thought I'd figure out what the logic is behind Vectortoradialvalue since it is a material function and the main node that is responsible is the atan2 node. Atan2 node is a custom node that uses HLSL. In recent versions of UE4, the node works exactly the same way as the Arctangent2 Node.
Atan2 Node on the left using HLSL code. The code is shown in the material expression custom panel on the far left.
 Arctangent2 Node on the Right. Both nodes produce similar results.

This is what I was able to make from the material using the Vectortoradialvalue node while combining the techniques used by Alex's and Simon's approach:

Foam applied to a plane mesh using Vectortoradialvalue node. 
Foam similar to Alex Vinogradov's approach but converted to radial coordinates along with radial masks


In Simon's video, he mentioned that there is a newer way to make foam using distance fields but he doesn't go over this himself. I thought I'd make foam for the water system I am making, so I've been doing some research on distance fields and what they do. From what I understand it gives off a gradient based on the distance.




Comments

Popular posts from this blog

Environment Showcase Concepts

Distance Field water foam

World alignment (Tri-planar mapping)