Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feedback Stylized Water Shader (FREE!)

Discussion in 'Assets and Asset Store' started by alexanderameye, Mar 13, 2020.

  1. ADNCG

    ADNCG

    Joined:
    Jun 9, 2014
    Posts:
    992
    Running into an issue and I'm unable to identify the source. Left attachment is in the editor, looking like it should. Right attachment is an iOS build. It's like there's an added layer of the horizon color extending to a distance from camera. If you look at the mountain, where the reflection is, you'll see what I mean.

    Editor.png iOS.png

    Any chance you could point me in the right direction?
     
  2. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
    In the next update, the water surface will be able to receive shadows. Some users requested this.

     
  3. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
    Looks weird indeed. Are you using fog?

    And if you can, could you join the discord? https://discord.gg/6QQ5JCc

    That's a bit easier for support, we can go back and forth much quicker.
     
  4. ADNCG

    ADNCG

    Joined:
    Jun 9, 2014
    Posts:
    992
    No, I'm not using fog.

    Sure I'll hop on the discord.
     
  5. shawnblais

    shawnblais

    Joined:
    Oct 11, 2012
    Posts:
    324
    For some reason, I get this when enabling Caustics in the Renderer in 2020.1.6:
     
  6. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
    Hey, I somehow didn't get a notification for this message and missed it. Are you still having this issue? The strength of the caustics looks like it's turned up way too high. If you want, you can join the discord chat and we can figure this out :)

    https://discord.gg/6QQ5JCc
     
  7. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
    Next update will be ready soon!



    Will included several lighting improvements, improved refraction, shadows, UI/UX improvements and performance improvements :)

    And after that, another content update is coming. I'm splitting up the updates into smaller chunks because that way I won't get burned out working on this.
     
  8. tahir_ali

    tahir_ali

    Joined:
    Jan 6, 2018
    Posts:
    119
    I wonder if you will add Polygonal style in your package like Low Poly Water GPU. That will be great.
     
    alexanderameye likes this.
  9. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
    I will! Working on it :)
     
    Tropobor likes this.
  10. ununion

    ununion

    Joined:
    Dec 2, 2018
    Posts:
    275
    hi alex! refraction show nothing effect in orthographic mode
    and i remember it works fine in old version long time ago..
     
  11. maxaud

    maxaud

    Joined:
    Feb 12, 2016
    Posts:
    177
    Does it work in VR?
     
  12. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
    Hey, I only saw this now, I'll look into it :) Thanks for bringing it up
     
  13. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
  14. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
    tahir_ali likes this.
  15. tahir_ali

    tahir_ali

    Joined:
    Jan 6, 2018
    Posts:
    119
    Water trail would be a great addition.
     
  16. saroulman

    saroulman

    Joined:
    Jul 24, 2020
    Posts:
    5
    +1! trail behind player + water splashes would make this really complete
     
    DrOcto and tahir_ali like this.
  17. Swapan01

    Swapan01

    Joined:
    May 23, 2017
    Posts:
    8
    Planner reflection layer not working. when I unselect a layer it is being selected automatically. Can you please help me with that?
    Unity 2019.4.11, URP, Webgl.
     
  18. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
    The water layer is unselected automatically. Do the other objects on other layers not reflect?

    Could you join the Discord, then we can fix this more easily.

    https://discord.gg/6QQ5JCc
     
  19. Swapan01

    Swapan01

    Joined:
    May 23, 2017
    Posts:
    8
    No. Everything is working fine with Planner reflection. But the layer musk not working properly. Every layer is selected except 'Water'. I want to unselect some other layers because they do not need to be reflected. But after unselecting them if I build the project they are being automatically select in the project and they are reflected in the build.

    Note that: In the editor, if I run the project it works. The desired layers kept unselected and do not reflect.
     
  20. tahir_ali

    tahir_ali

    Joined:
    Jan 6, 2018
    Posts:
    119
    Wondering what coming in next update and when!
     
  21. alganunlu1896

    alganunlu1896

    Joined:
    Aug 15, 2019
    Posts:
    2
    I love this asset but can you add flat shading
     
  22. lilacsky824

    lilacsky824

    Joined:
    May 19, 2018
    Posts:
    171
    I found when I turn directional lights off or reduce brightness(light color or intensity), the water still very bright.
    I want to use it in night scene.
    How can I make water lit by lights, not only specular?

    By the way, since 2020.2f I got compile error.
    It is from #if directive.
    Need to change this.
    Code (CSharp):
    1. #if SHADERGRAPH_PREVIEW
    To this.
    Code (CSharp):
    1. #if defined(SHADERGRAPH_PREVIEW)
    Thank you.:)
    screenshot.jpg
     
  23. ununion

    ununion

    Joined:
    Dec 2, 2018
    Posts:
    275
    chang m
    change master from unlit to lit pbr
     
  24. ununion

    ununion

    Joined:
    Dec 2, 2018
    Posts:
    275
    Hey Alex, a problem here, if I have mulitiple water in a scene, how do i solve the reflection for each of them? i can only drag one gameobject to Planner Reflections component,and once i do that the other water will show wrong reflection.
     
  25. ununion

    ununion

    Joined:
    Dec 2, 2018
    Posts:
    275
    for thoes who have error like this:
    Screen position out of view frustum
    this is a bug from unity editor, when the view camera is of equal rank with reflection transform it will show.

    solution:
    Open "PlanarReflection.cs"
    and add this code to begin of method DoPlanarReflections

    Code (CSharp):
    1. #if UNITY_EDITOR
    2.             if (!Application.isPlaying)
    3.                 return;
    4. #endif
     
  26. BigGameCompany

    BigGameCompany

    Joined:
    Sep 29, 2016
    Posts:
    109
    This is working well for us when using an orthographic camera but it all turns white when we blend to a perspective camera.

    This is the blend code

    Code (CSharp):
    1. private IEnumerator LerpFromTo(Matrix4x4 src, Matrix4x4 dest, float duration, float ease, bool reverse) {
    2.         float startTime = Time.time;
    3.         while (Time.time - startTime < duration) {
    4.             float step;
    5.             if (reverse)step = 1-Mathf.Pow(1-(Time.time - startTime) / duration, ease);
    6.             else step = Mathf.Pow((Time.time - startTime) / duration, ease);
    7.             cam.projectionMatrix = MatrixLerp(src, dest, step);
    8.             yield return 1;
    9.         }
    10.         cam.projectionMatrix = dest;
    11.     }
    12.  
    13. public static Matrix4x4 MatrixLerp(Matrix4x4 from, Matrix4x4 to, float time)
    14. {
    15.    Matrix4x4 ret = new Matrix4x4();
    16.    for (int i = 0; i < 16; i++)
    17.       ret[i] = Mathf.Lerp(from[i], to[i], time);
    18.    return ret;
    19. }
    20.  
    21.  
    This is a video of the effect here: https://www.dropbox.com/s/r6ttkuqf8bpxdu9/water-zoom.mov?dl=0

    Any suggestions?

    Thanks
     
  27. niuage

    niuage

    Joined:
    Nov 17, 2019
    Posts:
    122
    Anyone used this shader with 2021 alpha? I don't get any colors, my water is grey, whatever I do.
     
  28. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
    I had the same issue on alpha 2021. Kind of disturbing and not sure if I'll be able to fix it anytime soon. I see you sent me an email as well, will respond to that as well :)
     
  29. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    603
    Code (csharp):
    1.  
    2. [Error] The type or namespace name 'ParentNode' could not be found (are you missing a using directive or an assembly reference?)
    3. [Error] The type or namespace name 'NodeAttributesAttribute' could not be found (are you missing a using directive or an assembly reference?)
    4. [Error] The type or namespace name 'NodeAttributes' could not be found (are you missing a using directive or an assembly reference?)
    5. [Error] The type or namespace name 'MasterNodeDataCollector' could not be found (are you missing a using directive or an assembly reference?)
    6. [Error] 'SWS_ASEDepthNode.CommonInit(int)':
    7. no suitable method found to override
    8. [Error] The type or namespace name 'ParentNode' could not be found (are you missing a using directive or an assembly reference?)
    9. [Error] The type or namespace name 'NodeAttributesAttribute' could not be found (are you missing a using directive or an assembly reference?)
    10. [Error] The type or namespace name 'NodeAttributes' could not be found (are you missing a using directive or an assembly reference?)
    11. [Error] The type or namespace name 'MasterNodeDataCollector' could not be found (are you missing a using directive or an assembly reference?)
    12. [Error] 'SWS_ASEDepthNode.CommonInit(int)':
    13. no suitable method found to override
    14.  
    I'm unable to use this on 2021.1.11. It gives lots of errors.
     
  30. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
    Are you sure you are using my shader? The errors mention 'ASE' which stands for Amplify Shader Editor which I do not use.
     
  31. dock

    dock

    Joined:
    Jan 2, 2008
    Posts:
    603
    My apologies, it was the similarly named Stylized Water by Staggart.
     
  32. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
  33. Nupixo

    Nupixo

    Joined:
    Jan 21, 2016
    Posts:
    8
    Hi there,
    My understanding is that the reflections are based on a runtime "Reflection camera"...

    In my case, I have some effects (ie. masks) which only seem to be visible in the reflection when I check the box for "Depth Texture" or "Opaque Texture" (or even "Post-Processing"). What can I do to make the "Reflection Camera" have these options turned on when created?

    Thanks!
     
  34. WizardingStudios

    WizardingStudios

    Joined:
    Mar 4, 2017
    Posts:
    13
    Hi Alexander, first of all many thanks for your great asset. Clap clap!

    I just interested in Buoyancy too.
    I personally think your buoyancy script is fantastic and I would like to use it.
    Meanwhile I'm also searching for this shader:

    I created the shader (vertex displacement it's so simple:https://pasteboard.co/JVuiVRu.png) but really don't know how to implement with your buoyancy script. Any help would be really appreciated.
    Please don't doubt this is a great asset, hope you should update it and also raise money again...
     
    Last edited: Aug 11, 2021
  35. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,906
    RaoulWB and Gamingbir like this.
  36. ShockWave2048

    ShockWave2048

    Joined:
    Mar 15, 2015
    Posts:
    32
    Hi Alexander!
    Why water can turn to black on other PC? On work computer all fine (1080gtx/Ryzen 9). But copy on any other PC (1650gtx, i3 6006, MS Surface) and run, show this picture. Unity 2021.1.20f1, URP 11.0.0
    BlackWater.jpg
     
  37. Gamingbir

    Gamingbir

    Joined:
    Apr 1, 2014
    Posts:
    194
  38. kevinmustafa1993

    kevinmustafa1993

    Joined:
    Jan 3, 2022
    Posts:
    1
    Hi Sir Alex, my name is Kevin from Indonesia, I found this asset package of yours is very amazing, anyway, I want to ask something, is it possible to convert the prefab of this asset package into PNG sequences?
     
  39. yakandco

    yakandco

    Joined:
    Dec 3, 2014
    Posts:
    90
    Hey there, really cool plugin =) nice work.

    I just have a bit of a request and feedback on the use of Resources.Load<> for your editor UI. Adding any files added to a resource folder means they will be compiled into an app when they're only needed by editor scripts, and this has some pretty big implications for builds for some platforms. All assets that are added to resource folders end up getting compiled into a giant data file and can lead to incredibly slow app initialisation on PS4 for example, can be a huge problem for mobile games that are short on space and it also leads to issues with patching Nintendo Switch games where the use of Resource folders is not recommended. I can't tell you how many asset store assets I've had this issue with over the years.

    Thankfully there's a relatively simple fix, move your icon textures up a folder, remove the Resources folder, use this to load the icon textures instead: AssetDatabase.LoadAssetAtPath<Texture2D>("pathtotexure"). This way the textures won't be unncessarily compiled into developers apps when the textures aren't used at runtime.
     
    Last edited: Jan 27, 2022
    alexanderameye likes this.
  40. Shivam9seven

    Shivam9seven

    Joined:
    Mar 12, 2021
    Posts:
    2
    trail behind player + water splashes would be plus
     
  41. germaele

    germaele

    Joined:
    Apr 8, 2022
    Posts:
    6
    'morning!
    I'm trying to use your water for my school project. It is perfectly visible in editor but when i press play, it become white. Reading around and in your support area it says that is a problem about the renderer and the opaque/depth texture. I've done everything you suggested, even in the prev posts.
    For this project we are using Unity version 2020.3.20f

    upload_2022-6-17_12-26-51.png

    upload_2022-6-17_12-32-28.png

    upload_2022-6-17_12-33-57.png
     
  42. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
    Added a bug-fix/patch updated 1.2.0!

    Changelog
    - fixed shader to work with 2021 LTS
    - various fixes and changes to the support window
    - removed legacy caustics
    - removed Resources.Load calls
    - fixed transparency bug for waves

    @niuage
    @yakandco
    @germaele

    your issues should be fixed.

    If you have any further issues, let me know and I'll see what I can do, however I am not able to allocate a lot of time on this.

    If you enjoy this free asset, please consider supporting me by looking at my caustics shader. I would greatly appreciate it!

    Water Caustics for URP | VFX Shaders | Unity Asset Store
     
  43. germaele

    germaele

    Joined:
    Apr 8, 2022
    Posts:
    6
    first of all, thx very much to even bother XD
    So i updated the version but, unfortunatly, is not working. This is what i see

    upload_2022-6-24_8-57-37.png

    In the shader it says that there's an undeclared identifier 'MainLightining_float'
     
  44. germaele

    germaele

    Joined:
    Apr 8, 2022
    Posts:
    6
    Sorry for the double post but i've found an other thing
    In the scene Position Sub Graph Asset, there's this.
    upload_2022-6-24_9-8-43.png
     

    Attached Files:

  45. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
    I am not able to fix this immediately. Are you able to updated to Unity 2021LTS?
     
  46. germaele

    germaele

    Joined:
    Apr 8, 2022
    Posts:
    6
    Unfortunatly i can't. My school asked for this version because we are tryting to build also for PlayStation.
     
  47. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
    I see, I just uploaded an update so now there are 2 packages, one for 2019LTS and one for 2021LTS. I'll see if i can also create one for 2020LTS.
     
  48. germaele

    germaele

    Joined:
    Apr 8, 2022
    Posts:
    6
    Ok! Thx again! We are trying to understand what is not working properly by ourselves (And fail miserably XD). For the 2019 version, the problem looks like to come up when the shader interact with an other surface. On editor i can see it properly, as soon as press play, everything become white.
     
  49. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
    Does the issue detection tool show you any errors?
     
  50. germaele

    germaele

    Joined:
    Apr 8, 2022
    Posts:
    6
    I'm using the 1.2.1 version and this is what detection tool shows
    upload_2022-6-27_14-55-31.png