Search Unity

Water foam

Discussion in 'General Graphics' started by Dev-Undead, Apr 26, 2016.

  1. Dev-Undead

    Dev-Undead

    Joined:
    Oct 8, 2014
    Posts:
    66
    I've asked this question at least three time and I haven't even gotten a reply, I'm assuming the effect is either hard or just no body knows. I'm looking for a sea foam effect or beach line foam; however, I'm not trying to go all out. A simple flat effect will be perfect, how would I make this or does anyone have this?

    Something almost exactly what I'm looking for
     

    Attached Files:

  2. Dev-Undead

    Dev-Undead

    Joined:
    Oct 8, 2014
    Posts:
    66
  3. smd863

    smd863

    Joined:
    Jan 26, 2014
    Posts:
    292
    The most efficient way would be to manually bake it into the texture mapping. Just use a texture with foam on the edge, and do some vertex/UV animation.

    A more automatic way is to check the depth buffer, and see do a comparison with the depth buffer and the geometry you're rendering. If you do a Google search for "fun with shaders and the depth buffers" you should find an example of an intersection shader, and the same general principle could be applied to water foam.
     
  4. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,913
    The Unity environment effects include water that has foam. The shaders are included. Assets > Import > Environment.
     
  5. DanielZeller

    DanielZeller

    Joined:
    Nov 18, 2014
    Posts:
    18
  6. Dev-Undead

    Dev-Undead

    Joined:
    Oct 8, 2014
    Posts:
    66
    Thanks that asset was great help and I was able to modify it to fit my needs!