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. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Official Water System for the High Definition Render Pipeline

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

  1. SUUNE

    SUUNE

    Joined:
    Mar 10, 2019
    Posts:
    64
    Yes. CPU simulation have to be enable to get height... adding short summary comment to the FindWaterSurfaceHeight() would be nice :)
     
    chap-unity likes this.
  2. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    253
    Alright, i'll do a pass on it
     
    m0nsky likes this.
  3. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    253
    Already part of the next iteration, things just take time to get to you:
     
  4. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    253
    Double fogging: yes aware, require major graphics pipeline changes, so for now a workaround is required with local volumes.

    Motion vectors: Flipbooks are not the way, that is a real problem, I am not sure a real solution is possible, but I have couple things in mind.


    Additional color pyramid: To see things under water and we decided to not add yet an other color pyramid for various reasons.

    Tesselation: It has been significantly improved in the second water iteration, you'll just need to play with the parameters in the "Water Rendering" Volume component.

    UI still needs some love yes
     
    Last edited: Jun 28, 2022
    EagleG likes this.
  5. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    253
    You can create a water surface that can be 500kms with the second iteration of the water system that should be enough. It adapts the tesselation based on height
     
    Last edited: Jun 28, 2022
    ftejada and EagleG like this.
  6. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    253
    Next iteration, includes an additional mechanic that allows for customizable deformations (shore waves, Bow wave, vortex, bump, hole etc)

    Examples

     
    Last edited: Jun 28, 2022
  7. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    253
    I'll add it when I have a moment, thanks for the feedback
     
  8. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    <3

    Quick query:

    Is it possible to use own mesh, for example have a mode where the overhead of tess is removed and people can supply perhaps a mesh of their choice, and the various textures you generate are mapped in world space for regular non tess displacement? Do you think it's a terrible idea or useful? I am just concerned about tess in general having high overhead. May be unfounded worry.
     
  9. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    253
    In following version: you can provide your own mesh (or set of meshes) and you can reduce the tesselation to 0 if you don't want it
     
  10. SUUNE

    SUUNE

    Joined:
    Mar 10, 2019
    Posts:
    64
    hmm... not 100% sure but looks like wind direction in WaterSurface produces wind in oposite direction to global volume Visual Environment wind... Not a big problem but I guess thats a bug.
    Being able to use global volume wind on water surface directly in volume would be nice too :)
     
  11. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    750
    I want to understand something. Why we need motion vectors on a water system?
    i'm a graphic designer so, i think a have a different concept of that xD
     
    soleron likes this.
  12. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,646
    double fogging: i successfully addressed it in our custom water shader (forward) by tweaking the ShaderPassForward include: we write refraction to emission, save it to a custom float3, zero it out, let all the lighting code run and finally add it back using a custom refractive to reflective param.

    motion vectors: we handle motion vectors on foam according to naughty dog's code which looks nice. way better than without motion vectors for the foam: in this case foam would just look like a blurry S***.

    additional color pyramid: just to clarify: the ARE ADDITIONAL passes.
     
    Ruchir and PutridEx like this.
  13. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    496
    Hey, this one is not a bug.
    It's just that the Water System properties for an object are stored in a MonoBehaviour script (The water system script) thus it does not rely on the Volume system itself.
    Sadly, the wind set in the water system and the wind set in the visual environement are completely independant. I do agree it would be very useful to set only one, for now we can't without breaking everything. Hopefully, it will be unified in the future.

    Motion Vectors are just a way to know where the current pixels were at the previous frame. Some effects in HDRP, like Temporal Anti-Aliasing or Motion Blur needs that information.
    For example, TAA uses this to discard the history if the pixel moved too much to prevent ghosting... And this is exactly what happens with the water system currently.
    If you enable TAA, since we don't have motion vectors, we can't discard any history, and we have ghosting on the water AKA a blurry mess :)
     
    valarus likes this.
  14. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    3,128
    Awesome and all, can't wait. But a Surf Tunnel is the real challenge :D

    Also, it would be nice if Unity would provide some VFX for splashes
     
    ftejada, soleron and chap-unity like this.
  15. SUUNE

    SUUNE

    Joined:
    Mar 10, 2019
    Posts:
    64
    Full integration with volume system (like new clouds) yeah - that might be a struggle.
    But clouds and waves goes in oposite directions when I set wind orientation in global volume and in water system... I think (correct me if I'm wrong) its an easy thing to tweak to get similar results on both :)
     
    soleron likes this.
  16. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    496
    Yes sorry for the misunderstanding, this one is already fixed on our side, will be shiped with the next iterations :)
     
    soleron likes this.
  17. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    750
    ooh yeah that makes sense, i understand now, thanks :)
     
  18. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    490
    Any idea when would that be?
     
  19. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Bug or problem:

    I can't use the water at the moment because Unity's clouds are drawn behind the water. This affects clouds with the local parameter (so they exist in 3D space).

    Is there a resolution for this transparent order problem?
     
  20. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    253
    Hey,

    I guess the precise case you are describing is when:
    - Clouds are in local mode
    - Camera is inside or above the clouds
    - Looking down at the water

    If yes, then right now no there is no workaround. It is something that requires quite some renderpipeline changes, but we are aware of it and we will find a solution!
     
    DrSeltsam, sqallpl and hippocoder like this.
  21. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Awesome! I wasn't sure if it was a cloud problem or a water problem or both (I think it's kind of both).

    My old method for transparent stuff was to either use opaque + screen door, or render the transparent object twice, one for above and below the water line.

    But that's all hacky nonsense and I'm glad you have it in hand!
     
  22. SUUNE

    SUUNE

    Joined:
    Mar 10, 2019
    Posts:
    64
    Hello again.
    I did a small stress test of getting water surface height.
    Water system in Boat Attack sample using jobs to get water surface height at specific position which seems to be very efficient. With 576 floating objects performance is very good
    Screenshot_2.png

    New HDRP water system seems to don't have this possibility so I had to update all floaters height individually by FindWaterSurfaceHeight(). I tried to keep things simple as possible, created WaterSearchParameters and WaterSearchResults at start and update only positions but performance for the same number of floaters is much worse
    Screenshot_3.png

    That would be very nice if water system have option to put many positions into one job and return surface heights for them.
     
    Ruchir and PutridEx like this.
  23. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    253
    You can use jobs with the new water system
    upload_2022-7-6_18-0-16.png
     
    ftejada, Rowlan, m0nsky and 4 others like this.
  24. DrSeltsam

    DrSeltsam

    Joined:
    Jul 24, 2019
    Posts:
    95
    I ran into the same issue... it seems to be rather a clouds-thing, because other transparent elements are also visible through clouds. But I'm glad to hear that this is on your radar, do you have a rough idea when this might get fixed (is it safe to assume this may get fixed in a few weeks or months)?
     
  25. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    253
    weeks, no. Months hopefully, but it won't get backported to 2022.2 because it will be a major pipeline change. :(
     
    Last edited: Jul 13, 2022
  26. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    966
    I recently experimented with the latest alpha, it was great, but one issue stood out to me:
    when 'under water' is enabled, go under the water, and increase the visiblity paramater (forgot what it's called), nothing crazy, just enough to see a bit, finally look directly at the top and fly upwards until you leave the water.

    When leaving, you can see the sky very clearly, and it does a really weird transition, the camera view almost becomes cube centered while exiting the water. Only tested it with scene camera, unfortunately I forgot to record it.

    I imagine this would be an issue for games where the player goes underwater
     
  27. MarcopoloR

    MarcopoloR

    Joined:
    Feb 4, 2015
    Posts:
    109
    The water looks like it is coming along nicely. There are a couple things that would be nice to have that to my knowledge no Unity water asset has. The first one is underwater sunshafts, Cryengine water had beautiful underwater sunshafts even back around 2015, and so far no Unity water system on the asset store looks as beautiful as Cryengine water did back then. Here are a couple examples of what I am talking about underwater sunshafts-
    water-underwater-sea-aqua-wallpaper-preview.jpg

    sea-water-underwater-whale-humpback-whale-hd-wallpaper-preview.jpg



    and here are some videos I took several years ago goofing around in Cryengine with their water system-



    and



    The other thing that would be a nice feature is for the light to be absorbed as depth increases. When you go underwater the highest wavelengths of light disappear first, greens and reds, so the deeper you go the bluer everything gets, until even blue light is absorbed and it becomes totally dark. As far as I know no Unity asset store solution does this either but it would be a great feature to have in a deep sea diving game such as a Subnautica type game. Anyway that is my 2 cents for water suggestions that would be nice to have, if not in the first release to be worked at for a later version.
     

    Attached Files:

    Last edited: Jul 16, 2022
  28. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    396
    My KWS water have this feature.


    light1.gif light2.gif

    fsdfsdf.jpg

    I have a attenuation at depth.

    gif3.gif
     
    Last edited: Jul 17, 2022
    TerraUnity, ftejada, EagleG and 7 others like this.
  29. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
  30. RR7

    RR7

    Joined:
    Jan 9, 2017
    Posts:
    236
    thought i'd stop by here as my water use case always seems to be against the norm, and i figured i'd try this out with thus far very poor results.

    i view my water from top down, so far the best results i've had are with Crest, usnig this type of profile:

    upload_2022-7-19_13-8-18.png

    then the end result at runtime is this:

    upload_2022-7-19_13-8-54.png

    which animates nicely, looks like waves hitting the shore once i darken the texture on the sand.

    i tried to make HDRP water look similar at the angle... upload_2022-7-19_13-19-42.png

    and top down its just looks like a static puddle even when animating

    upload_2022-7-19_13-23-4.png


    is this something you feel should look better? or is it just outside of the scope of the HDRP water system?
     
  31. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,683
    I'm kinda confused on this, do you mean the foam and shore effect?
     
  32. RR7

    RR7

    Joined:
    Jan 9, 2017
    Posts:
    236
    yeah, the fact you can see waves and foam on crest. it looks like the sea. i suspect HDRP water assumes first person camera, almost everything else does.

    but that's why i've raised it, if there is some way for my use case to be considered, better now while its in early development?
     
  33. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,683
    upload_2022-7-19_21-57-58.png
    Adjust the foam settings especially the WindSpeedDimmer
    upload_2022-7-19_21-59-5.png
    I'm still not sure about the shore foam effect though

    I do hoping HDRP water will have shore system similar as URP water not sure why they are not using a shared system ¯\_(ツ)_/¯
     
    Last edited: Jul 19, 2022
    EagleG likes this.
  34. EagleG

    EagleG

    Joined:
    Mar 17, 2018
    Posts:
    435
    Did the team port the water system from HDRP or is it from that Viking village demo from asset store?
     
  35. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,683
    It's Boat Attack Water, they keep developing the water system for URP i guess
     
    EagleG likes this.
  36. RR7

    RR7

    Joined:
    Jan 9, 2017
    Posts:
    236
    yeah it looks better, not as good as your picture though, and the shoreline is still rather ignored.

    upload_2022-7-19_16-34-29.png
     
  37. PaulMDev

    PaulMDev

    Joined:
    Feb 19, 2019
    Posts:
    50
    They said shorelines is something that they're working on.
    So it's not available yet.
     
    chap-unity likes this.
  38. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    496
    What you have to keep in mind as well is the "fade" values of the bands.
    By default, if you go top view at some relative elevation, some bands might disappear due to this (otherwise you will get aliasing) and it will give you that flat render.
    Also, by default, it's setup for a specific repetition size. If that change, you also have to change the fade value accordingly for it to make sense.
     
  39. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,683
    Out of curiosity is depth blend/fading are considered to be added to water system? to get a smooth transition of other surface with water?
     
  40. RR7

    RR7

    Joined:
    Jan 9, 2017
    Posts:
    236
    i don't really understand what any of that means, so none if it will makes sense. its just random sliders and numbers to change.

    there are two fade sliders for smoothness, if i drop those it looks a bit better as the water is less clear.

    the caustics don't seem to work at all which isn't helping as the transparency just looks unrealistic at the moment.
     
  41. Wiggan

    Wiggan

    Joined:
    Sep 27, 2012
    Posts:
    9
    Hi! I just installed latest beta and tried out this water.
    It feels very promising, so glad to not have to do this stuff on my own.
    A thing that looks weird to me is the caustics:
    upload_2022-7-19_20-28-1.png
    It appears that it's a screen space effect or something? It should not appear on the bottom half of the submarine, right?
    These are my settings:
    upload_2022-7-19_20-30-32.png

    Great job with the water system, keep it up!
     
    chap-unity likes this.
  42. MarcopoloR

    MarcopoloR

    Joined:
    Feb 4, 2015
    Posts:
    109
  43. Wiggan

    Wiggan

    Joined:
    Sep 27, 2012
    Posts:
    9
    Will this work underwater? I want to make underwater buildings with air inside, and I currently don't have a clue how to achieve it. Maybe invisible deformer volumes could do the trick, or maybe not. Any hints would be much appreciated!
     
  44. Wiggan

    Wiggan

    Joined:
    Sep 27, 2012
    Posts:
    9
    When working with an ocean and a terrain it soon becomes pretty hard to see anything at all underwater. There should perhaps be a layer to toggle here:
    upload_2022-7-23_11-13-1.png
    Or is there some other way to disable it in the editor view?
     
    PaulMDev and Ruchir like this.
  45. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,345
    Looks like a really solid base good to see this.

    Reflections stand out to me as needing more work. Have you guys looked at micro facet reflections? It really helps a lot especially at a distance with aliasing like patterns. Waveworks2 has this and it makes a huge difference. Also when you disable it in their demo it's roughly comparable to this water, so it's a good way to see the improvement that could be had.

    Full integration is what makes this immediately more interesting then solutions like Crest or custom. I have a full waveworks2 implementation with custom lighting in HDRP, along with having tried to make Crest work. And it's just impossible to fully integrate scene lighting/fog well without doing that low level in the SRP.

    The challenge I see with water in SRP is that it's such a specific thing. Generic lighting/reflection models for instance simply cannot work well. So I hope you don't compromise there. There has been a pattern in other high level features like this of we have to make it fit a grand design. And it hurt the end product.
     
  46. neiltharrison

    neiltharrison

    Joined:
    Jul 21, 2022
    Posts:
    1
    Not sure if this is the right place to report a bug, but I know some of the Unity people are reading this.
    I've found that loading the water system in a scene at runtime from an asset bundle results in the water component being in the gameobject but no water shows on the screen. I've reported a bug the proper way too but I'm just interested if other people are getting the same results.
     
  47. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    253
    Fixed in the following version
     
    shikhrr, PutridEx, PaulMDev and 2 others like this.
  48. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    253
    That is a good point, I guess removing that could be an option yes
     
    hkalterkait and PaulMDev like this.
  49. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    253
    Generally in games, you would disable the water when you're inside your building. This only works on the water surface it self.
     
    hkalterkait and PaulMDev like this.
  50. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    253
    Volumetric lighting is on the list, it's just no the highest priority, but it is planned.