Home Technical Talk

How to low poly Sea Wave Foam Animation

polycounter lvl 8
Offline / Send Message
badmouse polycounter lvl 8
Hi Poly Friends,

Im working in a smarthphone game and one of my task is make a Sea Wave Foam Animation.

Im trying make in with UV scroll animation + mesh transform animation.

Any recommendations? or info to help me on this?

cheers

Replies

  • Luka
    Options
    Offline / Send Message
    Luka polycounter lvl 5
    this is for udk but it might give you an idea of the concepts to apply in your engine of choice

    [ame="http://www.youtube.com/watch?v=B2sl4nxSeqI"]UDK Ocean Shader Tutorial - Part 1: Setup and Foundation - YouTube[/ame]
  • badmouse
    Options
    Offline / Send Message
    badmouse polycounter lvl 8
    Thanks Luka,

    My first explanation was a little hard to understand.

    What im looking is a animation for waves reach the edge of the beach. (foam)
  • doggett
    Options
    Offline / Send Message
    Typically you could use the DepthBiasAlpha node in UDK to Lerp in the scrolling sea foam texture... but that's not great for shader performance.

    Are you using UDK mobile?
    From what I remember briefly using it - it's materials are fixed function (ie. no shader networks).

    Depending on how detailed the coastline is, you could model in planes for the areas where the foam is needed.

    Having a flick through this page:
    http://udn.epicgames.com/Three/MobileMaterialReference.html
    I see you can pan texture, and do vertex animation... use this with vertex colour alpha (if it allows).
  • badmouse
    Options
    Offline / Send Message
    badmouse polycounter lvl 8
    Thanks for the info doggett,

    But im using Unity3D :/

    So I trying to make it into maya, with UV scroll animation and mesh transform. without vertex animation (it a bit heavy for smartphone)
  • doggett
    Options
    Offline / Send Message
    I see.

    So do you have a shader in Unity that pans the texture for ya?

    Would a few particles being animated for foam be a better solution?
    Then you'd need to place them in the world, and decide how they lod (if there's a lot of them).

    And if you went the mesh route, does unity support non-uniform scaling?
    You could emulate subtle wakes, by squashing the mesh.
  • badmouse
    Options
    Offline / Send Message
    badmouse polycounter lvl 8
    doggett, I can't use particles :/
    The animation is for a landscape, is not so close to the camera and is for Iphone, so not needed big details on it.

    I must do it at optimize i can. :/

    So super lowpoly, 2 textures (1 with alpha and other without alpha).

    Is pure classic old school job i guess :)
  • doggett
    Options
    Offline / Send Message
    Depending on the complexity of your existing sea mesh, you could use vertex colour along with a noisy texture to alpha out the edge, and whiten it in the process.

    Would be a simple shader if you could code it.

    diffuse += 1 - vertexColour.a; //perhaps weaken this.
    step(vertexColour.a, noiseTexture.g); //alpha (terms might need reversing)
  • doggett
    Options
    Offline / Send Message
    one last thing...
    If you are making a custom mesh along the borders, you could just use the UV's v position instead of vertex colour in the alpha calculation.

    mesh + one panning texture + simple shader.

    (btw that shader code I posted could be optimised to not use the 1-)

    diffuse += uv.y; // or add the noise texture.
    alpha = step(uv.y, noiseTexture.g); //(terms might need reversing)

    and to go even further with optimising, you could channel pack textures say from the sea. (so one texture in r channel, one in g).

    Their might be one or 2 hiccups with this step approach.
    (As I've only been thinking about the beach edge, not the sea edge).
Sign In or Register to comment.