Search Unity

[RELEASE] Calm Water

Discussion in 'Assets and Asset Store' started by Phantom_X, Jan 22, 2016.

  1. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    238
    Hi,
    unfortunately no it does not.
     
  2. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,484
    Is this based on forward rendering mode only? Thus making the multiple light support performance hit?
     
  3. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    238
    Yes this is forward based at the moment, I would like to make it in deferred too to support SSR, but not quite working well atm.
     
  4. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,484
    I see. I was also wondering then, if it is possible to make the water divided into a lot of patches of water object that works as a whole (tiles across) to avoid rendering the whole big water multiple times for multiple light sources?

    So if we have many smaller sized water that can tile across each other then there is better chance for the light to affect only the necessary patches instead of one big water multiple times saving performance.

    I was also wondering what lights source does it react to? Directional + points? Also does it receive shadow?
    How does it do the reflection? Does it rerender the objects in question from different angle like Unity water?
     
  5. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    238
    Hey,
    so to be able to divide water into patches just require a little change from me, I have to put the UV in world space, I was thinking about this before, but wasn't sure if I should put it because it's not good when you want to make rivers or water flow in a specific direction. I think I could put that as an option in the next version.

    It works with all kind of lights and it does not receive shadows. The reflection is the same technique as unity water yes, but also supports cubemap and mixed mode. So you could have cubemap reflection for your static environment and use realtime reflection to render only objects that moves to save on drawcalls.

    Cheers!
     
  6. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,484
    Ok, I am sold! I have bought it and will fiddle around with it. I hope the patched water version comes soon. :D

    cheers.
     
  7. snoozinsquatch

    snoozinsquatch

    Joined:
    Apr 10, 2016
    Posts:
    4
    I'm trying to use the water on geometry in my scene, but I can only see the water when the camera is literally right in front. When I zoom out a bit it goes invisible. Any idea whats going on here?
     
  8. MangeyD

    MangeyD

    Joined:
    Mar 11, 2014
    Posts:
    73
    Hi,

    So far I am loving calm water... it works better than other water assets I have tried.

    I have an issue though that I need to ask about.

    I cannot see the underwater fog.

    I have got the caustics working in my project but not the fog.

    The fog is not turning on when my camera goes underwater and if I disable the script to turn the fog on/off and then turn the fog on manually I still don't see it... just the caustics.

    I am using the Invector 3rd person controller and its camera but I wouldn't have thought that would be an issue.

    Any thoughts would be gratefully appreciated
     
  9. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    238
    It's not working for you in the demo scenes either?
    Can you give me information about your setup?
    Unity version, Target platform?

    Thanks!
     
  10. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    238
    I'm not sure, can you send me an example scene ? also what version of unity are you using and what is the target platform?

    Thanks!
     
  11. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,484
    Ok, After some testing, I definitely rate this water to be one of the best in the store. It's good, because, well, it is a lot simple than the others and it does what it does good.

    If I add a bit more about my world uv patched version idea, if you can make it to follow player or camera in some cleaver setting, you can probably make them highly optimised infinite water plane. Since the water patches will follow the camera, the water will always be visible and yet you can only limit it to draw polygons that you need to cover the view. You would not need huge big mesh to achieve the same thing.

    Also with enough patched objects, you can get best performance improvement for multiple lights because only the affected water patch needs to be drawing multiple light effects. Only draw back is the few increased drawcalls but I think the gain is much higher.

    Only thing I am not sure of is the dx11 tessellation option for patched water. I am not sure if the edges will line up well. However, We can always just supply already tessellated meshes as input mesh so we can work around this issue if it does become an issue.

    Overall, my rate is 4.5 out of 5. I will give 5 stars if patched water version is updated.

    Very cool.
     
  12. snoozinsquatch

    snoozinsquatch

    Joined:
    Apr 10, 2016
    Posts:
    4
    Right now it's on Unity 5.6.3 and Android target. I've tested with all of the shaders and get same effect. Are there specific platforms or settings unsupported? I had read this was working on your Galaxy device.
     
  13. nikix22

    nikix22

    Joined:
    Jan 16, 2015
    Posts:
    20
    Hi :) I have problem with enabling fog on the water. It simply not react on any fog type? Is it possible to enable fog?
     
  14. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,484
    Hi.

    I have been trying to use this on PS4 and it has this kind of issue :

    Water_Error.jpg

    It looks like tessellation got wonky or something else totally...

    any idea what can cause something like this?

    DX 11 Tessellation shader version with Unity 5.6.3p2 Works fine on Editor, PC
     
  15. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,484
    This is what I get when I use non tessellation version : Water_Error2.jpg
     
  16. deraggi

    deraggi

    Joined:
    Apr 29, 2016
    Posts:
    87
    Hi,

    are there any news regarding Single Pass support for VR?

    Thanks!
     
  17. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    238
    Contact me by email, I will send you some debug shader to identify what is the problem.
    Thanks!
     
  18. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    238
    Hi,
    I tested it on oculus single pass, the only thing that doesn't work is the realtime reflection.
     
  19. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    238
    You mean the fog from the lighting window? It's supposed to be working.

     
  20. MangeyD

    MangeyD

    Joined:
    Mar 11, 2014
    Posts:
    73
    [RELEASE] Calm Water

    It is working in the demo scene with and without the Invector controller/camera so it must be a setting for the fog in my project. I will keep trying to resolve it on my own.

    thanks

    I got it working!!
    played with the height and colour settings and eventually have it doing what it should.
     
    Last edited: Sep 5, 2017
    Phantom_X likes this.
  21. nikix22

    nikix22

    Joined:
    Jan 16, 2015
    Posts:
    20
    Hi :) It is not working with scattering effect from Time of Day system. Water from standard assets works fine with the same effect.
     
  22. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    238
    Hey,
    I think ToD system requires you to manually add support to your custom shaders as mentioned in their documentation:
    http://modmonkeys.net/dat/doc/timeofday/#shaders
     
  23. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,484
    Hello @YanVerde

    Any progress, update on tiled version of the water? (world space uv)
     
  24. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    238
    Hey!
    I have the worldspace UV working just fine, however the distortion is not looking good when you have 2 planes one next to an other. You can clearly see the seam of the 2 planes because of it and I'm not sure how I could fix this without using a render texture and making the whole thing way more complex to set up...
     
    Last edited: Oct 19, 2017
  25. ranaUK

    ranaUK

    Joined:
    Mar 1, 2017
    Posts:
    158
    Hi @YanVerde , need some advice with caustic: it leaks on to the terrain regardless the size I set. Any idea?

    you can see the leakage at top-right part in scene view
     

    Attached Files:

  26. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    238
    Hey!
    Indeed, I think it should clip according to the size, I will look to add this feature soon.

    thanks!
     
  27. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,484
    strange. Since the caustics uses unity projector it should already work only within the boundary. And indeed it does work for me..
     
  28. ranaUK

    ranaUK

    Joined:
    Mar 1, 2017
    Posts:
    158
    That is what my understand was as well; until I ran into this. I'm guessing it's the shader?
     
  29. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,484
    Humm.. on second thought. It could look like that if terrain is one large mesh.. i would suggest to create mesh that only covers under water and then only project caustics on it. Or better.. if you are using deferred rendering consider using deferred decal screen projection. Which is what i am worjing on now.
     
  30. ranaUK

    ranaUK

    Joined:
    Mar 1, 2017
    Posts:
    158
    Or another option might be to actually solve it: just saying.
     
  31. mrPRAZ

    mrPRAZ

    Joined:
    Oct 10, 2013
    Posts:
    14
    Has anyone gotten buoyancy / rigidbody (physics) actors to work with this? Trying to determine the wave height for things like Player-Swimming and floating objects. Any help is appreciated.

    Loving the asset so far :)
     
  32. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,484
    With up coming update of world uv options, you can probably calculate this using the same maths as it is used in the shader, or you can write a custom shader that uses the same displacement as the water shader and simulate the floating object. I have done this (shader way) and it works well.
     
  33. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    238
    As castor76 said, if you want just objects floating you could just write a shader with the same vertex animation in Y position has the water. If you need something more physics based like buoyancy it's all about doing some mesh deformation in C#

    I suggest looking at tutorials like this one:
    http://catlikecoding.com/unity/tutorials/mesh-deformation/
     
  34. Siccity

    Siccity

    Joined:
    Dec 7, 2013
    Posts:
    144
    I plan on using this for an ocean. Will that work? How is performance on extremely large bodies of water? And is texture position in object or world space?
     
  35. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    238
    Hi,
    at the moment it's not super great, but I have an update ready to adresse this problem. Basically I added support for worldspace UV that way you could create a tile system with multiple water patches. Also the DX11 tesselation version is edge length based that means it will dynamically add resolution to the mesh near the camera.

    So the update is ready I just need to do some cleanup, update the Docs and submit the new version for approval.
     
  36. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,484
    You can just attach the water to camera with fixed y position to simulate endless ocean water. This works well especially with DX11 version.
     
    Phantom_X likes this.
  37. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    443
    Does this work in unity 2017.2 in single pass rendering and forward renderer in VR.
     
  38. Siccity

    Siccity

    Joined:
    Dec 7, 2013
    Posts:
    144
    Alright so i recently bought the asset. So far it's great! :)
    One minor issue i'm having though:
    I need the depth fog to completely out. It seems that with the Depth set to a positive number, the depth geometry will never fade completely out. The only way to fade out completely is by setting Depth to 0 and adjusting Edge Fade. But this results in wrong shallow colors. Any ideas? I want a shallow color near the edge of the water but i want depth to fade out 100% at a distance.


    "Standard" depth settings. Shallow color looks good but rock is visible far below the ocean plane



    0 Depth. Depth fades completely out but shallow color tint is gone
     
  39. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    238
    So far there is a Bug in unity 2017.2 that prevents it to work with single pass stereo, but I submitted a bug report and the will fix it in a future release.
     
  40. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    238
    Hey,
    So if I understand correctly what you mean, you would basically need a depth start and depth end value so you can control better the range of the depth right? If so, it's not possible in the current version, but I could probably add this in a future release.
     
  41. Siccity

    Siccity

    Joined:
    Dec 7, 2013
    Posts:
    144
    Yes. That sounds exactly like what I need :)
     
  42. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    443
    calmwaterscreenshot.jpg I can confirm on the rift for unity 5.6.4p2 it works in single pass rendering. I've tried 3 other waters Aquas, DCG and Tarsharen and Calm Water is the only one that works in single pass rendering if anyone needs to know or use in single pass. You have to use the cubemap feature for reflections which lets you drag in your baked reflection probe asset and can look pretty convincing. Here's a shot of it working with the OVR player controller for rift.

    I have a question YanVerde. Where in the Calm Water code can I soften up the normal map. Right now if you go to high on the tiling for normals in the distance the normals get really jittery. If you blur the normal map in Photoshop and dont add to much tiling it helps lose this effect. Just wanted to know where I can lessen the normal map so I can tile more and not get that without having to blur the normal map.
     
  43. zmaxz

    zmaxz

    Joined:
    Sep 26, 2012
    Posts:
    143
    When i update to 1.65 ,
    My water get some strange shape lines ,
    Use "Calm Water[DX11][Double Sided]
    How to fix it?
    CW.jpg Cw2.jpg
     
  44. rajj13

    rajj13

    Joined:
    Nov 5, 2017
    Posts:
    1
    Hi,

    Can I get the underwater effect in AR (with Vuforia)?
     
  45. ranaUK

    ranaUK

    Joined:
    Mar 1, 2017
    Posts:
    158
    Damn... do you know if it works on 2017.3;
     
  46. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    238
    Hi,
    depends what is the way you are using it, if you plan to have the underwater effect over the real world then no, if it's over 3D object I would say probably, but never tried.
     
  47. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    238
    Is enabling mip maps on your normal map helps?
     
  48. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    238
    Hi,
    I think your water plane might be flipped as I noticed there is a bug with the backface.

    In the CalmWater - DX11 - Double sided shader,
    try adding ZWrite On on line 91.
     
  49. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    238
    Don't know about this one, but I doubt
     
  50. ranaUK

    ranaUK

    Joined:
    Mar 1, 2017
    Posts:
    158
    well, 2017.2p3 didn't solve this issue;

    Yan, I need to release a new build -- is there anything I can do to get around this issue? I don't care for reflection at this point.