Search Unity

[RELEASE] Calm Water

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

  1. tcourbet

    tcourbet

    Joined:
    Oct 5, 2017
    Posts:
    46
    Alright, thanks for the answer!
     
  2. Mandelboxed

    Mandelboxed

    Joined:
    Apr 17, 2015
    Posts:
    50
    Hey. I see in the changelogs that the asset supports single pass, however when I actually try it the entire scene renders in only one eye. The culprit seems to be grabpass in the shader, however when I remove this the water doesn't anywhere near as good. Would love to know if there's any solution as single pass is a requirement in our project.
     
  3. RickF

    RickF

    Joined:
    Sep 12, 2012
    Posts:
    33
    I'm getting this error when using decalicious in conjunction with objects using 'calm water' shaders and the 'mirror reflection' script added to the objects.
    ------
    MissingComponentException: There is no 'Camera' attached to the "m_waterDisc1200_ReflectionSceneCamera" game object, but a script is trying to access it.
    You probably need to add a Camera to the game object "m_waterDisc1200_ReflectionSceneCamera". Or your script needs to check if the component is attached before using it.
    ThreeEyedGames.DecaliciousRenderer.OnPreRender () (at Assets/DecaliciousUpload/Scripts/DecaliciousRenderer.cs:102)
    UnityEngine.Camera:Render()
    CalmWater.MirrorReflection:RenderReflectionFor(Camera, Camera) (at Assets/Calm Water/Scripts/MirrorReflection.cs:252)
    CalmWater.MirrorReflection:RenderHelpCameras(Camera) (at Assets/Calm Water/Scripts/MirrorReflection.cs:138)
    CalmWater.MirrorReflection:WaterTileBeingRendered(Transform, Camera) (at Assets/Calm Water/Scripts/MirrorReflection.cs:155)
    CalmWater.MirrorReflection:OnWillRenderObject() (at Assets/Calm Water/Scripts/MirrorReflection.cs:166)
    ------

    So this object "m_waterDisc1200_ReflectionSceneCamera" doesn't actually exist in the hierarchy. I believe its created at runtime(?) by the 'mirror reflection' script and used for reflections on the water surface.

    Now i don't really care if the water actually reflects the decals, but this conflict is critical and not allowing the game to run. Is there anyway to kill this flag? or workaround the issue using layers?
     
  4. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    314
    Are you talking about single pass instantiated? This one has a bug from unity with grabPass indeed. I submitted a bug report, waiting for them to fix it.
    The normal single pass works for me though, except for the realtime reflection.
     
  5. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    314
    Hi,
    I don't think this is a problem with layers, but probably a problem with cameras. I can't know without seeing the code of decalicious, but I feel like they are doing something with the cameras in the scene OnPreRender maybe? Looks like the camera created by the reflection script gets deleted or something.
     
  6. RickF

    RickF

    Joined:
    Sep 12, 2012
    Posts:
    33
    Thanks. I was thinking a workaround might help if i have the assets on different layers, but i have not been able to resolve it. I have this same post in the decalicious forums. Hoping that between the two I can help track down the issue. I am more artist less developer.
     
  7. Mandelboxed

    Mandelboxed

    Joined:
    Apr 17, 2015
    Posts:
    50
    There is only one single pass option for Android. I believe it is instanced. They claim to have fixed the bug but have not.

    https://issuetracker.unity3d.com/is...nly-one-eye-with-single-pass-rendering-method
     
    ROBYER1 and Phantom_X like this.
  8. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    Was there any update on this? We are looking to use it for Oculus Go/Quest/GearVR with Single-pass forward rendering in VR. Reflections aren't that important but refraction would be nice.
     
  9. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    314
    Hey,
    Single pass works for refraction on devices like the rift, however there is a bug on the unity side for single pass instanced. Devices like Oculus Go/Quest/GearVR seem to be using that mode so we are going to have to wait for the fix on the unity's side for it.
     
  10. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    Is there an existing bug report for this to Unity? I couldn't find one for the built-in renderer but there is one here for LWRP/URP which is supposedly active - https://issuetracker.unity3d.com/is...enedepth-doesnt-work-in-single-pass-rendering

    I would be happy to submit a bug report to Unity if I fully understood what the bug is?
     
  11. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    314
    I'm not sure if there is. I have a basic bug repro that I was planning to send them, but didn't for some reason... I will make sure to send it today.
     
  12. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    Thankyou so much, could you please share the Case ID of the Fogbugz link they give you here so I can also contact their QA team to escalate the issue? I'm meeting with their development team later this month for a bug reporting round-table so I need to raise it then also if it isn't fixed by then.
     
  13. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    314
    Here's the case Id: 1183978
     
    ROBYER1 likes this.
  14. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    314
    Planing to add shader based caustics to replace the projector approach. This will be faster and easier to setup!
     
    Lars-Steenhoff likes this.
  15. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    You are an absolute wizard with this stuff, faster is always better!

    Did you have a fogbugz link in your Unity bug report? If so could you message me it please? I will chase their QA team on it. We really need some water materials for our Mobile VR app and nothing works
     
  16. OutlawJapple

    OutlawJapple

    Joined:
    Jan 9, 2017
    Posts:
    2
    Does this asset work with Unity 2019.2 and LWRP?
     
  17. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    314
    No this is only for SRP.
     
  18. OutlawJapple

    OutlawJapple

    Joined:
    Jan 9, 2017
    Posts:
    2
    Thanks for the quick response. Is SRP the default renderer?
     
  19. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    314
    yes that's right.
     
  20. Alex1337rus

    Alex1337rus

    Joined:
    Mar 30, 2016
    Posts:
    37
    Does it support flowmap? I didn't see flow parameter in your last video. Can you show example?
     
    ROBYER1 likes this.
  21. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    314
    Hi,
    yes it supports flow maps. There is an included demo scene with the asset. I don't have any video of it at the moment, but I can post one here later!
     
    Alex1337rus and StevenPicard like this.
  22. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    314
    Quick capture from the demo scene here:
     
    Alex1337rus likes this.
  23. Koogi-Krain

    Koogi-Krain

    Joined:
    Jun 17, 2014
    Posts:
    7
    Does this work for VR?
     
  24. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    314
    ROBYER1 likes this.
  25. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
  26. Garret2727

    Garret2727

    Joined:
    May 5, 2014
    Posts:
    23
    Does this shader work with maps that have all baked lighting? The water disappears once i turn off the directional lights
     
  27. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    314
    It need a dynamic light to work properly. So you have to either have a directional light that affects only the water layer or set your directional light mode to mixed and have the water planes dynamic, do not check static or lighting static on the water planes.
     
  28. philc_uk

    philc_uk

    Joined:
    Jun 17, 2015
    Posts:
    90
    Hi
    The flow maps seem to not work when in Linear color space, but work fine in Gamma.
    Do you know of a fix for this? When in Linear mode, they just kind of all flow in one direction, with the flowmap not changing the direction much..
     
  29. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    314
    Hi,
    In linear mode, you need to uncheck the sRGB (color texture) in the texture import settings. You should do that for everything that is not color including the flow maps otherwise the values will be wrong.

    let me know if it solves the problem!
     
  30. philc_uk

    philc_uk

    Joined:
    Jun 17, 2015
    Posts:
    90
    ok - checking now! Thanks
    Seems to work! Maybe put a note in the custom editor for the flowmap to say this is a requirement for Linear.
     
  31. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    314
    Maybe, but you should know that it's not related to the asset. That's how linear works for any texture that is not color, your occlusion map, metallic, roughness etc.
     
  32. Alex1337rus

    Alex1337rus

    Joined:
    Mar 30, 2016
    Posts:
    37
  33. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    314
    Hi,
    this would be nice I agree, however it's not a simple task as the system you mentioned works only on opaque object. If the water is opaque you can no longer have refraction. Technically I can think of one way of doing it, but will involve quite a lot of work. So I would say not planned for now, but I'm not closed to the idea!
     
  34. tijanikun

    tijanikun

    Joined:
    Aug 10, 2017
    Posts:
    129
    Hello, im using your water for my game and i got a problem: when an explosion or a special effect like kamehameha appear, the water is changing, like all light reflection are turned off, and it go back to normal right after, any idea please ?
    ProblemReflectWater.png
     
  35. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    314
    Hi, a bit hard to say with only a screenshot, but I think there might be something wrong with the nornal map import settings, verify that if is imported as normal mal.

    Also maybe you have a light in your effect and your quality settings is set for only one light?


     
  36. tijanikun

    tijanikun

    Joined:
    Aug 10, 2017
    Posts:
    129
    I changed the directional light Render mode to Important and now it works, thx
     
    Last edited: Feb 28, 2020
  37. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    314
    Yes, that means you don't have enough real time pixel light in your quality settings. Increase the number there.
     
  38. lauralexis

    lauralexis

    Joined:
    Apr 16, 2013
    Posts:
    4
    Hello! I've been looking at your asset (haven't purchased it yet) and I was wondering if it could scale up to be an ocean plane? Would it look nice when viewed from very high above, or would the normal maps vanish or tile very clearly? By the way the screenshots on the Asset Store page look amazing!

    Thanks in advance,

    Alex
     
  39. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    314
    Hey Alex,
    It was designed to do smaller water planes, however I suppose you could do oceans using tiles and worldspace coordinate option. There is no included system to manage tiles however.

    As for the normal maps, there is no option to fade them by distance, but there is an option to fade them. So adding the "by distance" part would totally be possible for a future release. An other way of doing this would be to make custom mips for your normal map textures and have the intensity of the normal reduced with each mips.

    Cheers!
     
  40. lauralexis

    lauralexis

    Joined:
    Apr 16, 2013
    Posts:
    4
    Thanks for your reply! Really looking forward to trying it out!
     
  41. ZhangAllEgg

    ZhangAllEgg

    Joined:
    Aug 23, 2018
    Posts:
    3
    Hello! Does this asset support HDRP?:)o_O
     
  42. Regulus343

    Regulus343

    Joined:
    Jul 4, 2013
    Posts:
    11
    I've been using Calm Water in my VR project for a long time and it has worked great, but I recently updated to the new Unity XR Plug-in Management system from the old VR setup and "Single Pass" is no longer available, but just "Single Pass Instanced", and the shader doesn't appear to be working this way. It shows up all pink in the left eye and not at all in the right and I end up with this error:

    Code (csharp):
    1. Shader error in 'CalmWater/Calm Water [DX11] [Double Sided]': undeclared identifier 'sampler_Depth' at Assets/Calm Water/Shaders/CalmWater_Helper.cginc(147) (on d3d11)
    Is there any easy change I can make to get the Double Sided shader to work under the new Unity XR Management with single pass instanced rendering?
     
  43. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    314
    No, standard pipeline only
     
  44. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    314
    Hi,
    There is currently a bug in Unity that breaks the shader with single pass instanced and there is nothing I can do until Unity fix it. The problem is that this bug is active for a while not and still not fixed.

    see bug here: https://issuetracker.unity3d.com/is...plash-screen-when-running-in-single-pass-mode
    ( OCULUS GO and OCULUS QUEST only use single pass instanced )

    I don't think it should produce an error though, I will have to look at this one to be sure, but no matter what the shader will not render correctly in single pass instanced that's for sure.
     
  45. Regulus343

    Regulus343

    Joined:
    Jul 4, 2013
    Posts:
    11
    Thank you for the quick reply. That is unfortunate, I guess I'll have to consider downgrading to the legacy VR system for now and hope things get better for the new system soon.
     
  46. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    163
    Hi,
    Does this water react fully to ambient / skylight ? So, when changing the ambient color, will the water adapt to it ? (Example: Make the water quite dark in a cave).

    Thanks !
     
  47. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    314
    Hi,
    yes ambient does affect the water, the color is done by capturing the objects that are behind the water. So if the object behind the water gets tinted by the ambient, the water will do as well.

    There are other things too, like foam gets tinted by the ambient, but cubemap reflections and specular color not. So if you use that mode for reflection you will need to have a cubemap that represent the ambiance you are looking for.

    Cheers!
     
    secondsight_ likes this.
  48. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    978
    Hello, is it compatible with Dynamic Water Physics 2?

    Does it support a circular shaped mesh instead of plane? (to fit inside a circular pool for example)
     
  49. Phantom_X

    Phantom_X

    Joined:
    Jul 11, 2013
    Posts:
    314
    Hi,
    I have not tried Dynamic water physics, but from what I understand it moves the position of the vertex and rebuilds the normals, so in that case I expect it's going to work just fine with calm water.

    As for the mesh question, you can use any kind of mesh that you want as long as they have good scale (1,1,1) and normals.
     
    FeastSC2 likes this.
  50. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    Does this asset works on mobile?

    Regards,
    Carlos