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.

Official Water System for the High Definition Render Pipeline

Discussion in 'High Definition Render Pipeline' started by auzaiffe, Nov 26, 2021.

  1. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    The tech for HDRP water hasn't anything to do with boat attack or URP.
    Proper integration with the terrain system will comme and with it shores and other similar things
     
    Last edited: Jul 26, 2022
  2. Wiggan

    Wiggan

    Joined:
    Sep 27, 2012
    Posts:
    9
    I still want the underwater effect to be active outside the window when camera is inside. Is the underwater effect just a fog, that can somehow be accessed from script? It would be nice to know what the plans are for the underwater feature, if you are allowed to share that information.
     
  3. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,785
    Since currently the underwater are just linear fog you can calculate that on the window shader and disable the underwater rendering from the ocean when entering the building to avoid double fog, not sure about the underwater water surface though may @auzaiffe have a tips for that part.
     
  4. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    The underwater effect is being worked on so that it looks better.

    We'll make sure to have the underwater behavior available in a function you can include so that you can call it from a custom pass for instance. The behavior you are asking for in incompatible with how the underwater effect is working as you don't have any effect from the camera to the window of the building.
     
    Last edited: Jul 26, 2022
    Deleted User and Reanimate_L like this.
  5. jalbastefan828

    jalbastefan828

    Joined:
    May 8, 2019
    Posts:
    17
    What do you mean by "terrain system v2.0"? Is Unity planning to work on a new terrain system?
     
  6. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    415
    It has been already stated few years ago that they are working on it.
     
  7. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    Sorry typo, i mean the proper integration will the terrain system will come in the v2.0 (of the water) and with it shores and similar stuff
     
  8. jalbastefan828

    jalbastefan828

    Joined:
    May 8, 2019
    Posts:
    17
    Oh, okay. Thank you for all the support and hard work, I can't wait to use this new feature ^ ^
     
    hkalterkait likes this.
  9. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,785
    @auzaiffe since you guys are working on the underwater renderpass, any chance we can get somekind of "inject/render objects inside underwater only" basically to render meshes/objects to only exist inside underwater pass/buffer, this could be usefull to render effect which only occured underwater easiest example might be bubbles/ or underwater foam particles?
     
    Wiggan and bdb400 like this.
  10. Nathans_Codes

    Nathans_Codes

    Joined:
    Feb 1, 2022
    Posts:
    1
    This seems really interesting and looks really cool!

    I'm exited for what's to come with this project!

    Also I wonder how you implemented the caustics as I've heard they are really hard to render.


    Good luck with this project!
     
    hkalterkait likes this.
  11. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,785
    I notice there's a couple water related nodes in shadergraph, can they be used on normal HDRP shadergraph? could be usefull to fetch water height or velocity inside shaders to drive wetness property or White water splash with VFXgraph
     
    ftejada and hkalterkait like this.
  12. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    721
    This might be a good idea to be able to disable it here.
    In the meantime, you can disable it in the HDRP Global Settings under Frame Settings for camera (rendering tab) to not render it in the scene view.

    upload_2022-8-2_17-59-50.png

    If you do so, you must re-enable it in the Camera Custom Frame Settings to be able to see water in the game view cameras.
     
    hkalterkait likes this.
  13. Jack_Martison

    Jack_Martison

    Joined:
    Jun 24, 2018
    Posts:
    118
    @auzaiffe What can we expect from shoreline effects? Is that going to be just plain part of water close to terrain with foam effect, or something more advanced?
    Also would be great to know what performance hit we can also expect, many water solutions in asset store are quite heavy
     
    Gasimo, soleron, ftejada and 2 others like this.
  14. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    3,897
    The water is ideal for a pool. But how can I add caustics to the gameobject, ie the raccoon? And any info about when the water deformation will be coming for us?

    r.jpg
     
  15. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    3,897
    Add-on to above, here's a vid. It's better for explanation. water scene starts at 01:28:



    What this lacks is volume and depth. I mean, the raccoon should be distinguished from the water. Maybe with foam or maybe with caustics. When the camera goes below the surface, then the area above the water is already filled with water. Not a good design, I hope that changes. The water line should be bold. Ripples and water interaction are needed. And please give us Water VFX (bubbles, splashes, etc including sound) :)
     
  16. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    524

    I do not think you should be seeing caustics on the racoon (or any object) when it is at the surface,

    Watch after one minute


    Watch after 30 seconds
     
    chap-unity and Rowlan like this.
  17. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,785
    Holy crap that raccoon looks so good, is that using the new Hair rendering?
    Sorry for bit out of topic.

    Edit : oh it's using custom hair system, super cool.
     
    newguy123 and Rowlan like this.
  18. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    3,897
    What an awesome reference, thank you! Yeah, I guess the problem will resolve itself once there's ripples in.
     
  19. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,558
    W
    We need water physics!!!

    Looove racoon pool time!
     
    Rowlan likes this.
  20. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    721
    Good feedback, depending on the sun intensity and orientation, this is a very valid usecase, wether that be a raccon or the underside of a bridge.. etc
    For now, it's not possible since the caustics texture is not accesible outside the Water Shader Graph.
    However, this limitation is known and the plan is to be able to query this texture from any water surface.
    This texture could then be fed to any kind of material like the material of a Decal Projector.. etc.

    Some parts of the deformer work is currently being tested so it might end up "soon" on the latest 2023.1 public alphas
     
    ftejada and Rowlan like this.
  21. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,785
    can we also get access to water displacement vector, heightmap, and normal map textures outside of water shader graph?
     
  22. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    575
    I know this is for much in the future and perfectly reasonable if you cannot yet see or discuss that far ahead.

    Still, for the River Component is there any specific idea or scope of use for handling either fed data like DEM/cloud points or vector information, to aid with flow direction and even placement?
     

    Attached Files:

  23. Onat-H

    Onat-H

    Joined:
    Mar 11, 2015
    Posts:
    195
    Are there any examples for custom water materials? I assume we need to create a water shadergraph, but it would be helpful to see an example graph. (btw. since 2022.2, the packages content isn't shown in the project view, that was always very helpful as a reference, any way to get that back again?)
     
  24. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    721
    No examples for now, this should be documented more thoroughly when the feature is out of beta (for 2023.1).

    Hum, I think you just need to toggle the little crossed eye on the top right of the project window to make them appear again. (cf gif)

    Indeed, we're not that far ahead.
    For now, we have some sort of flow map format to make rivers flow in the direction we want. But there's no "simple" tool integrated to be able to feed data to fit this sort of flow map format.
    For now, that's up to users to create their own pipeline depending on their needs.
    This can be re-evaluted later when we have more visibilty on the features and more user feedbacks of course.
     

    Attached Files:

  25. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    575

    Thanks Chap, appreciate the input!
     
    hkalterkait likes this.
  26. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    Is it planned for the underwater effect to get darker the deeper you go (set value of course) to simulate actual oceans in how light is non-existent the deeper you go. If there's a way to do this I hadn't found a way to do that yet.

    EDIT - One other question, is it possible to have boat rotate based on the waves? Not seeing an option for that inside WaterSearchResult or Parameters. Wasn't sure if there was something else that exists to do this.
     
    Last edited: Aug 19, 2022
  27. mjt728

    mjt728

    Joined:
    Aug 14, 2022
    Posts:
    2
    Last edited: Aug 19, 2022
  28. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,127
    You need to upgrade your unity version, it's available in 2022.2 beta, and will be there after release
     
  29. mjt728

    mjt728

    Joined:
    Aug 14, 2022
    Posts:
    2
    Oh...
    Is there any other way but to upgrade?
     
  30. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    575
    I expect system changes could be complex. But you can sometimes patch features into previous versions, it can be a nightmare to manage though, and I definitely wouldn't recommend it for production unless you absolutely need it and know what you're doing.
     
  31. camerondus

    camerondus

    Joined:
    Dec 15, 2018
    Posts:
    29
    Hi, just wanted to submit a bug. when using a fullscreen custom pass, water stops rendering. My injection point is correct (i think) since all other transparents are still rendered.
     
  32. NewMagic-Studio

    NewMagic-Studio

    Joined:
    Feb 25, 2015
    Posts:
    443
    I use 2022.2 beta, activated water in HDRP settings, added a plane with Surface water where i added a material with shader graph/Water shader in the Surface water component but when press play there is no water
    If i open with shader graph the Water shader appears as pink
     
    nyancathulu likes this.
  33. NewMagic-Studio

    NewMagic-Studio

    Joined:
    Feb 25, 2015
    Posts:
    443
    Water shader seems broken?
    upload_2022-8-24_11-33-31.png
     
    nyancathulu likes this.
  34. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    524
  35. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    The clouds water interaction has been improved, it will (when the PR lands) behave properly now.


    Cheers,
     
  36. iDerp69

    iDerp69

    Joined:
    Oct 27, 2018
    Posts:
    42
    Is there be a way to seed the ocean? I'm using Photon Fusion, which uses client-predicted/rollback multiplayer. The ocean needs to be able to be "rolled back" and resimulated deterministically. If I could seed it with a tick integer it would be _perfect_ for my game.
     
    User340 likes this.
  37. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    721
    The latest improvements (that'll land in 2023.1 alpha) has support for timeline for this exact reason.

    This would enable users to basically scrub the timeline and be sure that the water surface looks exactly the same at a specific frame.
     
    Last edited: Sep 27, 2022
    iDerp69, Matjio, TerraUnity and 3 others like this.
  38. veddycent

    veddycent

    Joined:
    Jul 22, 2013
    Posts:
    107
    Is it possible to remove/reduce the visible repetition when the camera is high above but also have good looking waves at sea level?

    EDIT: Looks like the version in 2022.2.0b8 has changed and greatly improved with the infinite geometry type.

    Great work guys!
     
    Last edited: Sep 28, 2022
    chap-unity likes this.
  39. OutDoorsScene

    OutDoorsScene

    Joined:
    Sep 9, 2022
    Posts:
    167
    Will there be a feature in the future to blend multiple waters? from a calm pond to a rapid river.

    Also, would it be possible in the future to create a waterfall with this system? Screenshot (13).png
     
    unity_8p6oRXXqiWbRTQ likes this.
  40. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    524
    Do we have any new features or major improvements for the water feature?
    It feels like progress is slowing down and the team is working on details.
    Which gives the impression of "wrapping up".

    This is the progress of ONE guy working on his water feature.

    Apart from the shader, which offers rich over and underwater features, he has added separate underwater plant physics (I suppose a variation of wind) for seaweed, Kelp etc.
    upload_2022-10-6_18-2-55.png
    https://twitter.com/i/status/1577943153159639042

    at the same time he is making an underwater VR controller which allows the user to push or grab objects underwater providing thrust to move around in a realistic manner.
    upload_2022-10-6_18-10-30.png
    https://twitter.com/i/status/1576034096555646976
     
    bdb400 likes this.
  41. YuriyPopov

    YuriyPopov

    Joined:
    Sep 5, 2017
    Posts:
    236
    Apart from the good looking water line I dont see how the rest is connected the scope of a water system. I mean if you want to make SubnauticaVR you will have to write some systems yourself.
     
  42. unity_8p6oRXXqiWbRTQ

    unity_8p6oRXXqiWbRTQ

    Joined:
    Dec 20, 2018
    Posts:
    19
    Hi, will there come an integration with the spline tool now that its finished? Similar to RAM or other river solutions? I think the workflow to create lakes or rivers would benefit greatly from that.

    Also just tested it in unity 2023 , looks great so far!
     
  43. ReniTheGhost

    ReniTheGhost

    Joined:
    Dec 8, 2014
    Posts:
    16
    I'm really looking forward to that fix. May I know when it will land?
     
  44. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    721
    We can't say yet when and how that will be taken care of.

    You can try but it's not really the usecase of this feature. Would probably be easier to use something different.

    Just want to assure you that it's not wrapping up at all.
    Tons of improvement are going to land soon in 2023.1 alphas including but not limited to:
    • Deformers (to create shore waves and maelstorms for example)
    • Excluders (to remove water from boats)
    • Current Map to make streams follow a specific flow directions.
    • Non horizontal water surface (for rivers to flow down a mountain)
    • ...etc
    And there's still lots of things that are being developped to continue improving.

    That would be great to have some tooling to make it easier for artists to author things for water surfaces, but we can't say when for now.

    It has been validated and is in the process of being merged into the mainline so it will reach 2023.1 alphas very soon.
     
  45. TJHeuvel-net

    TJHeuvel-net

    Joined:
    Jul 31, 2012
    Posts:
    819
    We're just starting to play around with the water system, and i had a question about the artist UX. Currently it seems like we can add a custom material, but a lot of properties that affect visuals are tweaked in the component itself, and not in the Material.

    This is not like how the rest of Unity works, e.g. the color of an object is described in the Material, not in the Renderer. Is there any way to extract these visual parameters to a Material?
     
  46. TJHeuvel-net

    TJHeuvel-net

    Joined:
    Jul 31, 2012
    Posts:
    819
    Cant really seem to find much documentation on the water system, i tried searching in the HDRP package docs but nothing comes up.
     
  47. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,127
    Are there any plans for foam on geometry intersecting with the water? It looks very off without any.
    Something like this:
    upload_2022-11-5_18-28-38.png
     

    Attached Files:

    Deleted User likes this.
  48. Deleted User

    Deleted User

    Guest

    Hi all,
    How can I create a script that handles buoyancy with the water system? Is there any way to access the height information of the water surface?

    Any explanation would be highly appreciated.
     
  49. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,785
    Deleted User likes this.
  50. Deleted User

    Deleted User

    Guest

    Thank you so much for the reply, @Reanimate_L

    It looks like some methods and properties have been renamed from the WaterSurface class. I made the errors go away, but unfortunately, now the script doesn't work as expected :). my cube (has no rigidbody) does not fall down or stick to the water surface. Any consideration plz. <3

    here is my new code:
    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.Rendering.HighDefinition;
    3.  
    4. public class WaterInteractor : MonoBehaviour
    5. {
    6.     public WaterSurface targetSurface = null;
    7.     public int numIterations = 8;
    8.     public float error = 0.01f;
    9.  
    10.     // Internal search params
    11.     WaterSearchParameters searchParameters = new WaterSearchParameters();
    12.     WaterSearchResult searchResult = new WaterSearchResult();
    13.  
    14.     void Update()
    15.     {
    16.  
    17.         if (targetSurface != null)
    18.         {
    19.             // Build the search parameters
    20.             searchParameters.startPositionWS = searchResult.candidateLocationWS;
    21.             searchParameters.targetPositionWS = gameObject.transform.position;
    22.             searchParameters.error = error;
    23.             searchParameters.maxIterations = numIterations;
    24.  
    25.             // Do the search
    26.             if (targetSurface.ProjectPointOnWaterSurface(searchParameters, out searchResult))
    27.             {
    28.                 gameObject.transform.position = new Vector3(gameObject.transform.position.x, searchResult.candidateLocationWS.y, gameObject.transform.position.z);
    29.             }
    30.         }
    31.     }
    32. }
     
    chap-unity likes this.