Search Unity

Official Water System for the High Definition Render Pipeline

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

  1. Darkgaze

    Darkgaze

    Joined:
    Apr 3, 2017
    Posts:
    397
    You can do that with my asset called WaveMaker (you can find the link in my signature, or in the asset store). It also includes optional buoyancy and other effects if you're interested, but that basic effect is available since the first version and you can use your own shaders in whatever pipeline you like. Mesh is updated realtime and very fast.
    Some simulation data is available to gather and use it, and planning to export more and more.
     
    RR7 and soleron like this.
  2. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    595

    Nice asset Lidia.

    I noticed your profile links to your version 1.0 and not your 2.0 version, just an fyi if you weren't aware.
     
  3. Darkgaze

    Darkgaze

    Joined:
    Apr 3, 2017
    Posts:
    397
    Oops. You're right. It's a bitly link to gather statistics. Thanks for that , I'll fix it. :)
    Sorry for talking about my asset, I just wanted to let people know about this very different approach. It's hard to differenciate between different assets, that's why I added an explanation in the asset description for that.
     
    HIBIKI_entertainment likes this.
  4. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255


    Brace, foam improvements are coming (sorry for the video quality, youtube compresses a lot).
     
    Lahcene, TerraUnity, soleron and 28 others like this.
  5. valarnur

    valarnur

    Joined:
    Apr 7, 2019
    Posts:
    440
    When can we expect Unity 2022.2 alpha?
     
  6. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    766
    Given the time of the year, I would not hope for something sooner than early January.
    Also keep in mind that there's a delay between what improvement is posted here and and what will be included in the first alpha. Only the first iteration of the water will probably be included in the first public 2022.2 alpha, the rest has been done a bit after so will follow late january / early february.. etc
     
    hkalterkait, ftejada and valarnur like this.
  7. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    Here are some in progress videos.
    Cheers,


     
  8. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
    Great stuff, thank you for sharing this!
     
  9. Gokcan

    Gokcan

    Joined:
    Aug 15, 2013
    Posts:
    289
    You always doing great. How we can do lens effect when camera is out of water?
     
  10. WonkyDonky

    WonkyDonky

    Joined:
    Aug 24, 2014
    Posts:
    65
    Can it do big waves (aka Sea of Thieves)?
     
    soleron likes this.
  11. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    Yes absolutely, on the video the waves are 10 meters high. It's just a matter of the scale of your objects
     
  12. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    766
    What do you mean by lens effect exactly?
     
  13. veddycent

    veddycent

    Joined:
    Jul 22, 2013
    Posts:
    109
    Hi all,

    My first time experimenting with pre-release features, how can I get this installed?

    I'm using the latest beta 2022.1.0b4

    Thanks.
     
    Lahcene likes this.
  14. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    It will be in 2022.2, but the alpha for 2022.2 is not out yet so you can't test it from a unity download yet.
    You can download master graphics branch with latest HDRP changes but you'll have to do it manually, otherwise you need to wait for a bit until the alpha is out.
     
  15. Gokcan

    Gokcan

    Joined:
    Aug 15, 2013
    Posts:
    289
    I mean when you go out of water, water drops are going on surface of camera. I couldnt find a video.
     
  16. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    766
    I see, this is out of scope for the water surface system.
    On your side, you will be able to make it using either Full Screen Custom Pass or with the Full Screen Shader Target feature that is coming up.
     
    soleron, hkalterkait and Gokcan like this.
  17. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    "with the Full Screen Shader Target feature that is coming up."
    What's this?


    On the other hand, I have some questions that I would like you to clarify for me:

    1) Will the water system have characteristics of waves breaking on the shore? Something like what this asset has: https://assetstore.unity.com/packages/tools/particles-effects/kws-water-system-hdrp-rendering-205007

    2) Will the system bring scripts for the buoyancy of objects? Or failing that, any Api or something to be able to program?

    3) Will it be possible to manipulate the water to create holes or deform it in some areas with shapes that we want (sphere, rectangle, or any mesh shape)? such as the hole seen in this image:


    4) Will the water react to the contact and movement of objects, creating ripples on its surface?

    5) Will it withstand receiving shadows from objects and terrain?

    6) Will it support all types of lights and more than one at a time (spotLight, directional light, etc)?

    7) How will it work with reflections? Do you have any example, video or something?

    Greetings
     
  18. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    766
    I'll let @auzaiffe answer for the water stuff.

    Regarding the full screen shader target, It's been on the roadmap for a while.
    The idea is to add a full screen mode in Shader Graph that will allow you to create fullscreen shaders compatible with the render pipeline custom post processing, fullscreen custom passes in HDRP and the Graphics.Blit command. (Like water droplets on the camera when it's out of the water... etc)
     
    hkalterkait and ftejada like this.
  19. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    Hi,

    I invite you to read the forum thread (it is quite short, only two pages) as most the questions you are asking have already been answered.

    1) Yes,it will.

    2) We will provide a framework for that.

    3) Yes.

    4) Eventually yes

    5) Already does

    6) Already does.

    7) Already does.
     
    hkalterkait and ftejada like this.
  20. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    1,670
    I do not understand why you said that, i see those assets and looks very cool and useful. I'm not trying to be a bad guy here but, maybe you lack the creativity to achieve the results you want. I mean, yes there are limitations, but i have seen very cool system for water and we can always try some tricks to achieve some goal, no?
     
    solkyoshiro and soleron like this.
  21. LumaPxxx

    LumaPxxx

    Joined:
    Oct 3, 2010
    Posts:
    339
    Yea,if you are targeting specific usage, you will find a perfect one for you.
    but what i mean is there needs a native "one for all" solution and i have already listed the reasons why all other water system cannot be called good for "one for all".
    and you cannot understand what i was talking, trying to blame all those "function lack" to my "creativity lack".
    but i agree i defended what Unity Team doing too much,i apologize for that.
     
    Last edited: Feb 3, 2022
    soleron likes this.
  22. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255


    Some additional progress videos (working on API to access the simulation data on the c# side for gameplay, buoyancy and other fancy things).

    Cheers,
     
    Lahcene, Ziddon, TerraUnity and 19 others like this.
  23. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    595
    You're making fantastic progress with this!
     
    NotaNaN, hkalterkait, ftejada and 3 others like this.
  24. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Is the bouyancy force only apply force to y axis? or it will also apply drag force to x and z direction? ie apply force to object along the water direction?
     
    csma21111 and ftejada like this.
  25. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    That's the same question I was going to ask...
    Apart from this question, I have another.

    Hi @auzaiffe !! Is it possible that you include functions in the API so that the force of the water affects the rotation of the objects to a greater or lesser extent through public parameters that can be in the inspector?
    That is to say that the force of the water can apply rotational forces to floatable objects independently on each axis...

    I do not know if is understandable what I'm trying to say. Greetings
     
    csma21111 likes this.
  26. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,117
    So water interactions are not at the top of the list? Please reconsider...
     
    soleron likes this.
  27. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    They said that injecting perturbations is a feature, so you just have to call a function or something.
     
  28. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    @auzaiffe , I spotted an issue when playing around with the second iteration of water system available on GitHub
    When you place a point light below the water surface you can see that there is a dark region above the light source for some reason, Is this physically accurate?

    I failed to capture a screenshot because I thought it was a bug and tried upgrading the packages, but the latest commits give an error (related to compute shader resource not being allocated) when I add an ocean surface.

    Some other feedback,
    1. Currently, we can't really rotate the water surface except for the y-axis, I guess we could use custom mesh for this purpose, but it would be easier if you could add slope-based water flow by default for your river preset.
    2. There are no controls to directly scale the wave heights, we just have wind strength, effect, etc. Direct control would be really helpful. This could also be used to scale down the wave height for stylized reasons.
    3. Could you add gradient support for depth-based fog instead of just two colors, it would allow for a lot more freedom. I use Gaia's water system for quick prototypes and here's how their system looks: upload_2022-2-9_20-42-49.png
    4. In this system they generate a gradient texture based on the gradient we provide; you could make this system public btw because this kind of hack is used in a lot of places by a lot of developers in their assets. This could be added to the shader graph too.
    5. Is there a reason you guys fixed the caustic line to be at a certain height for oceans instead of making it move along with ocean waves as it's supposed to? It just looks weird right now.
    6. Also, can you add the "Fade Start " and Fade End (I'm not sure if the parameter you provide is equivalent to fade end) parameters?
    7. Also, would it be possible to just use the material on some mesh (not using the component) for basic water effects?
     
    soleron, Lahcene and chap-unity like this.
  29. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    Hi,

    Thanks for the feedback.

    First I don't know and never opened Gaia or any other water asset on the store, so I have no idea what they do. I'll be guessing for the answers.

    1 - Yes, we are aware of that limitation. We'll eventually support water planes with different rotation.
    2- I am not sure to understand, The per band wave amplitudes do that, can you explain where those fail?
    3 - Feedback received i'll think about it.
    4- Not sure to understand this one.
    5- There were some issues with the caustics that have been fixed in the meantime, not sure if it covers this.
    6- I don't understand the physical phenomenon or the expected user behavior that "Fade" controls in a water medium. The underwater has a view distance multiplier that combines with the max absorption distance, Not sure if that is what you want?
    7-No and it will not be possible. This it is completely tied to the water system. The system is quite complex and you don't need this whole complexity to render a puddle, so there is no point for that imo.
     
  30. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    I was just explaining what I said in point 3 about how they use the gradient texture for depth.

    What I meant was there is no setting afaik to directly input the height of waves. We can change the contribution of different types of waves right now, but not the overall wave height directly.

    For example, I want calm-looking waves but I want wave heights to be 10m or something non-physically based then what should I do? another example would be I want Stormy waters but with wave height/amplitudes of just 0.5m due to some stylistic reasons, is there a way to directly scale the waves (just as if it was mesh/gameObject if you understand what I'm saying)?
     
  31. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    @auzaiffe I was wondering if any of this can be used in URP? Totally not asking you to port haha, just is it a waste having it restricted to one pipeline? That sort of question, I guess :)
     
    evyatron, Lahcene, impheris and 6 others like this.
  32. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    766
    Great point. For now, you can't be that precise without having to fiddle and guess the settings for a specific wave height.. etc.
    Once all the features are done and robust, there will be another pass that will focus on usability and user experience to do that sort of stuff. It's already planned, it just doesn't really make sense to do it right now since all the water settings are still evolving as we speak.
     
    mariandev, NotaNaN, ftejada and 2 others like this.
  33. Giuseppe

    Giuseppe

    Joined:
    Dec 4, 2011
    Posts:
    26
    sucks that this has been around since november. you're already on the next version and the first still hasn't been made available :(

    I spent the afternoon trying to use this but couldn't get it.messing around with git and manifests and this and that, i just want to make a waterfront level. like 4 months ago. was quite frustrating. when is that version of unity that includes the version of hdrp that has this due to be released?
     
    Last edited: Feb 10, 2022
    hippocoder likes this.
  34. Giuseppe

    Giuseppe

    Joined:
    Dec 4, 2011
    Posts:
    26
    "ah well a transparent plane is enough" was my end result. and i bet that's why pretty much every single unity game looks rubbish in some way. no dev uses it's stuff, or uses it properly, and i know why. it's because if you try to, you spend all your time on which unity version does this work with and what hoops do i have to jump through to get it to import without endless red errors, and which bloody ninjutsu arthritis hand-spasm combination will summon a unity god that will look kindly upon you and so on.

    a transparent plane will do as im not waiting another 6 months or diverting into full time shader dev so that i can do what has been a common level design scenario since far bloody cry. sometimes i look upon that new icon with hatred and wonder how it's still not got bread and butter stuff sorted like 6 years after everything was started anew. its hardly unity 5 era any more is it guys? or is it exactly the same with more money? living brand? more like a soggy harris.
     
  35. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    789

    I've used the version in the master branch for a few months now without any issue. From what you are saying I think I know exactly what frustrating you as it did for me as well but I quickly figured out what's wrong (It wasn't too obvious)

    Basically, you didn't enable the water rendering in the volume profile. Yes, you can enable it everywhere else but if you don't have it enabled there it doesn't show.

    If that wasn't your issue then make sure it's enabled everywhere else. Similar to how you enable other features for HDRP.

    HD Render Pipeline Asset - Active one (and any others you use in Quality Settings)
    HDRP Global Settings - Enabled under Rendering for Camera

    upload_2022-2-10_19-44-57.png

    upload_2022-2-10_19-45-38.png
     
  36. jiraphatK

    jiraphatK

    Joined:
    Sep 29, 2018
    Posts:
    300
    Transparent plane is obviously not enough. if you use that for water then you're one of the devs reponsible for those rubbish looking game. There are load of tutorials on how to use Shader Graph to create a good enough water or ocean shader. You don't need to be graphic programmer to do it.
     
    soleron likes this.
  37. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    @auzaiffe
    What I wanted was some control over where the fog starts and where it ends.

    (With transparent distance)
    upload_2022-2-11_20-53-53.png
    This kind of look is hard to get using physically-based controls, I think.
    Although I'm not an artist so I'm not sure if this is better :p

    If you add support for gradients then maybe I could use the alpha channel to get the same effect
     

    Attached Files:

  38. Giuseppe

    Giuseppe

    Joined:
    Dec 4, 2011
    Posts:
    26
    thanks for the help but it does not seem to have resolved it. i've enabled water for all quality settings profiles (low, mid, high, default) in the HDRP project preferences, and enabled it for the volume profile, edited the default volume profile, edited the camera component for custom frame settings to enable it there too. viewing wires does not reveal any surface mesh. when creating a water surface i get the gameobject, it's little gizmo, it's components with all its options, i have no errors but it does not render and does not seem to be there. 2022.1.0b7.2715.

    maybe your version of the water is older than mine, as i got this from latest graphics repository on git. so maybe mine is WIP.
     
    Last edited: Feb 12, 2022
  39. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    789

    I use the latest as well. I've actually been keeping up with the master branch since the water feature has been added and it's been working from then till now.

    One other thing I can think of is for you to make sure you have the correct HDRP config package in your project. Other than that it's hard to help without seeing or having a project that you have the issues in. Since with enabling the water system, there are so many places to make sure it's enabled that one of them can be easily overlooked.
     
  40. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    584
    You guys are doing a great job so far. Very much needed.

    Such features as Buoyancy will be definitely needed out of the box for the AEC industry. A standard feature accessible for designers and artists. Not just a framework or API access. (Which most designers/artists won't be able to use.)

    Also please do not skip the underwater volume effect.
    This is a must for various non games uses, such as archviz, VFX(with depth pass) animation, advertising etc. but also games in some cases.

    Can this feature be tested in older versions of Unity if manually installed? (i.e. 2020.3 or 2021.2?)
     
  41. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    How do you download the water feature and install it in Unity 2021.2?
     
  42. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Honestly best to wait a month or two and let it hit main branch IMHO. It's a bit of a hassle and much is changing right now with github source. I would definitely expect structural / folder changes.
     
    hkalterkait and User340 like this.
  43. gentmo

    gentmo

    Joined:
    Aug 13, 2018
    Posts:
    5
    Hi @auzaiffe, great jobs! I tried make water shader myself last year. One thing I wanna ask is transparent object and water render thing. I got transparent object rendered more or less, not perfect but can work correctly with plane type of transparent object. Here is what I got for a cube
    Transparent.png

    My solution is a little bit hacky and costive I think because I need to resolve depth buffer couples of time throughout 2 different render pass stage, with 3 custom pass. One in "Before pre-refraction" and Two in "Before Transparent". And I need to set other transparent object material to "Before Refraction", to get partial correct result. So it works for SSR and Refraction.

    So in your implementation, will transparent objects works in water?
     
    Last edited: Mar 4, 2022
    Lahcene and Ruchir like this.
  44. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    i forgot to ask this @auzaiffe is the water depth/fog volumetric aka it's receive volumetric shadows like volumetric fog?
     
  45. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    For now no, but the plan is to make it volumetric yes
     
  46. CaseyHofland

    CaseyHofland

    Joined:
    Mar 18, 2016
    Posts:
    613
    These 2 questions were completely skipped over, but I was quite interested in their answers actually. The buoyancy on the cubes looks great y-axis wise, but of course it kinda flops if that's all it does.

    Once buoyancy is fully implemented I would also be interested to see how a larger surface (e.g. 10x10) interacts with the water, or how some weird concave shape caries itself.

    Lastly, as a visual test it would be great to see a comparison between a real life buoy and a simulated one (complete with accurate mass and center of gravity).
     
    ftejada likes this.
  47. PaulMDev

    PaulMDev

    Joined:
    Feb 19, 2019
    Posts:
    72
    How will the water physics work ?
    Will it be only simple player-water interaction or will it have full water simulation. If yes is it only baked or would a run time option be possible ?

    In any case this looks amazing, keep it up !
     
  48. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    766
    As you can see in the merged PR here, for now the system only offers functions to search for the height (and only the height) of the water surface at a given point in editor or at runtime.
    This allows users to make their own buoyancy systems by implementing one of thoses functions in a C# script and slap it on gameobjects.
     
    Last edited: Mar 1, 2022
  49. XaneFeather

    XaneFeather

    Joined:
    Sep 4, 2013
    Posts:
    98
    That is pretty much all that's needed - thanks! That was definitely an API feature I was most looking forward to.
     
  50. CaseyHofland

    CaseyHofland

    Joined:
    Mar 18, 2016
    Posts:
    613
    Well, to be buoyant is to be able to float, but floating is more than a shift in height. It has a direction as well (else things would never wash ashore).

    If I may be so bold to ask directly: will Unity provide a broader API to allow for more accurate simulation of floating and if so with what focus?
     
    ftejada likes this.