Search Unity

Need help with Unity Water

Discussion in 'Shaders' started by EmadGh, Jul 15, 2010.

  1. EmadGh

    EmadGh

    Joined:
    Jun 10, 2009
    Posts:
    147
    Hello Everybody,
    My problem is how should i use the water shader on custom another mesh.UV is good but I dont why is it bad.
    look how is the bump.
     
  2. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    It can be difficult to get the UVs evenly spread over the surface with an irregularly shaped object. Another approach to this is to use a simple object like a plane for the water and then use the depth mask shader (from the Unify wiki) to hide the unwanted parts.
     
  3. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    Getting UVs uniformly distributed on a flat surface is trivial in all modelling programs I've seen. Just project them from above.
     
  4. tomvds

    tomvds

    Joined:
    Oct 10, 2008
    Posts:
    1,028
    Doesn't the water shader require the nurbs surface that comes with it?
     
  5. ToreTank

    ToreTank

    Joined:
    Jun 23, 2008
    Posts:
    165
    If I'm not horribly mistaken, the water shader needs the mesh's local up axis to be Y (check out the Pro Water mesh, I might be mixing it up). If the up axis is X or Z, I think you would get similar results to what your screenshot shows.
     
  6. EmadGh

    EmadGh

    Joined:
    Jun 10, 2009
    Posts:
    147
    Thanks for all replays, I'll check it at home.
     
  7. Battle Angel Alita

    Battle Angel Alita

    Joined:
    Mar 29, 2010
    Posts:
    44
    Just tesselate your's water surfase mesh.
     
  8. gfxguru

    gfxguru

    Joined:
    Jun 5, 2010
    Posts:
    107
    can i know on what 3d authoring program you created it?

    [/quote]
     
  9. PatHightree

    PatHightree

    Joined:
    Aug 18, 2009
    Posts:
    297
    I had the same problem, ToreTank's solution fixed it for me.
    Too bad this isn't Unity Answers, then I could upvote your solution :)
     
  10. geneziz

    geneziz

    Joined:
    May 19, 2010
    Posts:
    27
    I have the same problem. But could it not be possible to change the shader?

    Shader "FX/Water (simple)"

    I guess it must have to be in one of these lines:

    temp.xyzw = v.vertex.xzxz * _WaveScale / unity_Scale.w + _WaveOffset;
    o.bumpuv[0] = temp.xy * float2(.4, .45);
    o.bumpuv[1] = temp.wz;

    Thx for any help!

    Geneziz
     
  11. geneziz

    geneziz

    Joined:
    May 19, 2010
    Posts:
    27
    *bump

    My second solution is to rotate the model, but I see it as an ugly solution. Because the water Model isnt the only Object in my Blender File.

    Thx for any help!