Search Unity

Making a nice shoreline / waves

Discussion in 'Shaders' started by klabauterklaus, Apr 28, 2010.

  1. klabauterklaus

    klabauterklaus

    Joined:
    Feb 9, 2010
    Posts:
    9
    Hey all!

    We would like to make the shoreline of our project more interesting than it is right now - see pictures below, the top one is the current status, the bottom one shows roughly how it should look.

    At the moment the sea is basically a plane intersecting the terrain mesh, thus resulting in a quite boring shoreline. We would like some kind of fadeout starting form where the sea meets the strand and going maybe 2 meters inside in direction of the sea. We also want some kind of foam happening on that area. The sea level should be dynamic (think high tide / low tide).

    The idea right now is to make the sea mesh "follow" the heightmap of the terrain (so it is basically a copy of the terrain, but with different tesselation) - this could be used in the vertex shader, where the height of the vertices is set to the given sea level, and the difference between original vertex height to sea level defines how close the vertex is to the shoreline (if they are equal its right at the shoreline). Hope this description makes sense ;)

    Any ideas / thoughts?

     
  2. Fribble

    Fribble

    Joined:
    Dec 3, 2009
    Posts:
    56
    I'm guessing you're trying to get something like the shoreline in the Island Demo, right?

    Have you tried isolating it and importing it into your own project / modeling program and editing it?
     
  3. mouf

    mouf

    Joined:
    May 3, 2010
    Posts:
    30
    If i had to do something like that I would make a plane with an animated foam shoreline (with transparency) and duplicate it all along the intersection between water and terrain.
    For the sea comings et goings (on the beach for ex), animating the water plane moving slightly up and down could do the job, you'll just have to make the multiple foam shoreline planes to follow it.
    Guess it's also the cheaper way.