Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Broken Water (Basic) Standard Assets

Discussion in 'Editor & General Support' started by Cheddar, Jul 30, 2014.

  1. Cheddar

    Cheddar

    Joined:
    Sep 5, 2013
    Posts:
    5
    I'm not quite sure when it started, but my basic water (both daylight and nighttime) seems to be broken. Previously, whenever I dropped one of the water prefabs into my scene, it would look just fine. However, recently, whenever I've imported the water package into my Unity projects, it looks really weird. Here is a screenshot of my editor running with water in the scene: http://i.imgur.com/pvjT1Va.png

    The texture moves on the plane, though, as you can see, it doesn't look anything like waves. I don't believe this started with a particular update to Unity. I feel like it started around the time I was playing with the imported assets' settings in a previous project, but, from my understanding, that shouldn't have affected the new imports in other projects.

    I thought it would solve the problem to uninstall Unity and do a fresh install of the latest version, but the problem persists.

    I'm running the latest update of Windows 8.1. Not sure if it helps, but my graphics card is an AMD Radeon HD 7700 Series.

    I have no idea where to look for a solution to this problem, so I would very much appreciate some help.

    Thanks!
     
    Last edited: Jul 30, 2014
    HG_Kim likes this.
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,935
    Same here (4.3.0 works, 4.5.0 is broken)

    Looks like there are couple changes in the shader, reverting line 45 to old one seems to fix it (or just import the whole basic water from old 4.3..)
    Code (CSharp):
    1. // unity 4.3.0
    2. // line 45
    3.   temp.xyzw = v.vertex.xzxz * _WaveScale / unity_Scale.w + _WaveOffset;
    4. // line 50
    5.   o.viewDir.xzy = normalize( ObjSpaceViewDir(v.vertex) );
    6. // unity 4.5.0
    7. // line 45
    8.   temp.xyzw = v.vertex.xzxz * unity_Scale.xzxz * _WaveScale + _WaveOffset;
    9. // line 50
    10.   o.viewDir.xzy = normalize( WorldSpaceViewDir(v.vertex) );
     
    buggaboo, Sungold, HG_Kim and 2 others like this.
  3. Cheddar

    Cheddar

    Joined:
    Sep 5, 2013
    Posts:
    5
    That fixed it! I couldn't find this solution anywhere! Thanks a ton!
     
  4. Aurore

    Aurore

    Director of Real-Time Learning Unity Technologies

    Joined:
    Aug 1, 2012
    Posts:
    3,106
    Yeah this is definitely a bug, could you report it?
     
  5. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    8,935
    reported yesterday, 623372.. not sure if original poster had also.
     
  6. Aurore

    Aurore

    Director of Real-Time Learning Unity Technologies

    Joined:
    Aug 1, 2012
    Posts:
    3,106
    Cool thanks for that
     
  7. ddankhazi

    ddankhazi

    Joined:
    Aug 6, 2014
    Posts:
    1
    It works. Thanks.
     
  8. Crono141

    Crono141

    Joined:
    Jun 30, 2014
    Posts:
    3
    One thing to note, after making the change, you have to close unity and restart it to get it to work. It doesn't seem unity recompiles shaders automatically like it does for scripts.

    Any way to add alpha/transparency to standard water?
     
  9. ericscotx

    ericscotx

    Joined:
    Sep 5, 2014
    Posts:
    1
    If you're a newb like me I'll save you HOURS of hunting around for the shader in question.
    Click on your water in the Hierarchy then in the inspector window look for the dark blue green circle with the words Daylight Simple Water (or whatever water you're working on). Under that is the shader script. Click edit and wait for the Monodevelop window to show up and then copy the edited lines from the post above to the Monodevelop window and click save. When I went back to Unity after saving in the Moon window the water worked. THANK YOU Mgear for the fix!
     
    Last edited: Sep 12, 2014
  10. HG_Kim

    HG_Kim

    Joined:
    Dec 4, 2013
    Posts:
    2
  11. Sungold

    Sungold

    Joined:
    Jan 13, 2013
    Posts:
    9
    mgear thanks a bunch!! You saved me sooooo much time! And yeah, Crono141 is right, it does appear that you have to restart Unity for changes in a shader to take effect.
     
  12. buggaboo

    buggaboo

    Joined:
    Dec 29, 2014
    Posts:
    1
    Nothing new to report. Just dropping by to thank mgear for the solution. Got it done in a jiffy.
     
  13. DPGaming

    DPGaming

    Joined:
    Jun 27, 2016
    Posts:
    1
    Looks like its broken again, in the FXWaterPro.shader at the top a comment says "// Upgrade NOTE: replaced '_Object2World' with 'unity_ObjectToWorld'" Going through the file and reverting back to _Object2World fixed it for me.
     
    uxvr likes this.
  14. uxvr

    uxvr

    Joined:
    Jul 24, 2016
    Posts:
    1
    I had the same issues, thanks DPGaming, reverting completely fixed it!