I've been trying to add foam lines to my water so it doesn't look like its just clipping through the rock, I found another post about how they did it, but as I am a beginner with blender I can't seem to find out how they did it. Any suggestions help. They did mention that ambient occlusion was detecting the borders.
1 Answers
In answer to the linked question the Ambient Occlusion node is used to create the area for the foam - which is actually the calculated shadow.
The Ambient Occlusion (AO) node works better in Cycles. Switch the render engine to Cycles, then the viewport shading mode to Rendered (shortcut: Z). In the Shader Editor add the AO node and a Color Ramp node. Check the Inside option for the AO node.
Adjust the slider of the Color Ramp so that the shadow looks the way you want it to. The output of the Color Ramp can be used as a mask. Use it as Fac value for a MixRGB node or for another Color Ramp.
This way you can use it to control the color, bumpiness, or transparency.
Important note: the AO does not work very well with transparency (creates black areas), and not well in Eevee, and it's slow in Cycles. In this case, you can bake it into an image with bake type Emit. Then Image Texture node with the baked AO image replaces the Ambient Occlusion node.
The water is a flat plane and the land is a displaced plane.
- 13,925
- 4
- 13
- 36



