I am trying to make a coastline.
It is all nice so far, but now I am attempting to make foam at the edges, where the water hits the ground or a mesh.
That should work with the distanceToNearestSurface-Node. I generated a material to see, how it works. Look screenshot.
I assume, that the distance fields provide values between 0 and 1.
It worked almost, only two problems (see screenshot).
- the distance fields around meshes are very sharp, whilst the edges of the landscape is smooth and nice.
- When the camera moves, there are strange fields appearing and hiding on the ‘water’
In the mesh-settings, I tried different settings for the ‘distance field resolution scale’, without any effect.
Does anyone have any idea, how to achieve a map, which indicates distance to the nearest surface?