How can I blend out the visible Foam in my Current Material Setup?

Because of performance issues associated with using the high-res ocean modifier and the foam maps that are generated from that modifier, I've instead created an ocean using a displacement node setup. (below)

custom, possibly taboo ocean shader, displacement and foam node setup

The foam is generated by selecting certain parts of the noise texture (selection done through Math Node > Logarithm) and using that output factor as the mix factor between my ocean shader and the foam material shader.

      Edit: There will be a large image of all the unexpanded node groups at the bottom of the post for convenience

However, (as seen in the image) the consequent foam is quite sharp at the edges, and cannot think and have not found a way to 'blend' them out into the ocean as foam in real life does.

Basically: How can I get the foam to appear 'softer' and have less sharp edges if I use this method to generate foam?

Thank you for any suggestions!



The ocean is made by adding the color values of a wave texture and a noise texture (scale-corrected) and using them as the input for displacement on a plane (of course with adaptive subdivision to enable micro-polygon displacement).

enter image description here

  • $\begingroup$ Please always share node setups with material questions (the insides of the groups especially). More clear information is always better, and will improve the chances of a good answer. $\endgroup$ – Timaroberts Mar 17 '18 at 11:39
  • $\begingroup$ @Timaroberts Will get on it right now, thank you! $\endgroup$ – BenliCai Mar 17 '18 at 11:45
  • $\begingroup$ I'm doubtful about the usage of the logarithm here. If its input is randomly between -25 and 25 you have few chances to have a good value to influence the mix shader. $\endgroup$ – lemon Mar 17 '18 at 12:18
  • $\begingroup$ While probably not related to the question itself, Volume scatter and absorbtion are often added to each other, not mixed. As a side note I don't see any reason to upload an image with "thank you" comment $\endgroup$ – Mr Zak Mar 17 '18 at 14:17
  • 1
    $\begingroup$ My suggestion is to first tune the log input manually (with no complex node upstream) to clearly see if the mix of the two shaders give the good effect concerning the sharpness of the foam. When you know the mix is ok in the principle, then add a more complex node upstream. But as you want something between 0 and 1 as output of the log, your noise/random group should be between 1 and e=2.71828. So replace "-05 and *50" by "multiply by 1.71828 and add 1" inside the group. $\endgroup$ – lemon Mar 18 '18 at 6:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.