Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Official Water System for the High Definition Render Pipeline

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

  1. Jack_Martison

    Jack_Martison

    Joined:
    Jun 24, 2018
    Posts:
    152
    upload_2023-2-20_21-20-4.png

    Any ideas why my ocean is not visible? 2023.1b4
    checks in project setting are set
     
  2. TrueLemon-t301

    TrueLemon-t301

    Joined:
    Apr 1, 2022
    Posts:
    2
    Hi, I'm working with the new water system, and found some (at least for me) strange behaviors, that without any documentation are pretty hard to understand.

    1) Clouds rendering: Immagine 2023-02-22 111706.png In this screen clouds are rendered with water surface disabled. Immagine 2023-02-22 111724.png In this one water surface is enabled and clouds are rendered as dark blocks when looking through surface from underwater. Is there any setting to change or is this a bug?

    2) Caustics customization:
    Immagine 2023-02-22 112428.png Immagine 2023-02-22 112255.png Immagine 2023-02-22 112519.png
    In the shader graph i noticed caustics doesn't change at all if I disconnect relative node from fragment. Is this intended? Furthermore it seams it 's not possible to change caustics rendering color. I'd like to add some chromatics fx, is this possible in any way?

    Is there any plan to release documentation for the water system?
    Thanks in advance!
     
  3. Jack_Martison

    Jack_Martison

    Joined:
    Jun 24, 2018
    Posts:
    152
    Can we get a little more explanation about this? I believe this mask applies on the whole ocean? How can I mask only part around my island, so waves weren't so aggressive around beach
     
  4. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    779
    Yes mask applies to the whole ocean but you can set an extent of whatever you like (like 400 x 400m) and offset it to mask something that's not in the pivot of your ocean. If you want you mask to not to repeat, it's important that you set your texture to clamp in the texture importer as well, to mask only your island and not that it repeats every 400 x 400m.

    Here is an example
    upload_2023-2-23_11-33-17.png
     
  5. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    779
    Yes, documentation is currently being written as fast as we can, I know it's a pain but we are currently doing the best we can with what we have :).

    For caustics, currently with the water graph, since it's only a float, you are not able to make chromatic abberation sadly.
    However, I can suggest a workaround with custom passes.
    First, you need to have caustics enabled. Once it's enable you can retrieve the caustics texture by using the function "GetCausticsBuffer()" that will return a R8. This texture can be then used in a custom pass as a post process or with a shader graph decal, in there you'll be able to sample it as many time as you want and output a color for it.

    At the begining of water developpement, we had this "water caustics dispersion" option but it was dropped because of the cost. If enough users thinks it would be usefull, this can also be re-evaluated in the future.
     
  6. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    779
    For this one, I wasn't able to repro it on my side. So few questions:
    • What unity version are you using?
    • What type of clouds you are talking about exactly? (Volumetric Clouds or Cloud Layer)
    • It looks like you don't have actual refraction when underwater, you should have more something like a warped smaller rectangle (since we can't disable refraction underwater yet)
    upload_2023-2-23_11-48-33.png

    Best way to go forward with this would be to either make a full bug report and drop the case number here, or send a small repro so we can have a look !

    Cheers !
     
  7. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    I wonder if there's any plans for some shadergraph samples focused on the new water, similar to full screen shadergraph samples but for the HDRP water system.
     
  8. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    779
    Yes, at least an underwater one is planned, now that the SG Node to get the underwater mask has landed.
    I think it's really important to show this workflow.

    EDIT: the node (HD Sample Buffer node) will be available starting from
    2023.1.0b7+ and 2023.2.0a4+
     
    Last edited: Mar 1, 2023
  9. mbach

    mbach

    Joined:
    Oct 25, 2018
    Posts:
    7
    First off: The water looks amazing and it is really nice to have something that is built in!

    I am (also) trying to make the water spherical. I am writing a planet tiling system for our simulators and we are using a round earth for that. I have tried to push the vertices using a copy of the water shader graph, but without luck. I know it says "Do not modify in a lot of places," but I tried anyway! Here is what I did:

    upload_2023-3-1_9-32-13.png

    Instead of the water vertices being pushed down, the tiles that make up the water start to disappear.

    Can this be done somehow or is it planned for the future?
     
    Ziddon, shikhrr and chap-unity like this.
  10. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    779
    Thanks for the positive feedback. :)

    Right now, we can't provide help on things we don't support (like modifying the node that says "do not modify", so you are on your own here sorry :(.

    Technically, you are already able to make curved water surface by using a custom mesh as an input. However, it starts to stretch down the closer you are to full vertical surface (cf image).
    upload_2023-3-1_10-39-59.png

    It's already on our roadmap to be able to support spherical body of water for planet rendering for example but, to be honest, it's not a high priority. If enough people needs it, this priority might change but can't promise anything.
     
    Ziddon, Ruchir and ashtorak like this.
  11. TrueLemon-t301

    TrueLemon-t301

    Joined:
    Apr 1, 2022
    Posts:
    2
    Hi,
    • I'm using Unity 2022.2 on windows
    • Using volumetric clouds
    • I was using infinite water plane, could this be the cause of the smaller rectangle not being visible?
     
  12. mbach

    mbach

    Joined:
    Oct 25, 2018
    Posts:
    7
    You're welcome :) I knew it was a long shot :). Thanks for your reply anyway. Is there somewhere I can upwote it? Is the water roadmap public like the HDRP roadmap?

    If I use a custom mesh as input won't I lose the quad-tree tiling mechanism that allows for high detail up close and low detail in the distance?
     
  13. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    779
    Not at all, sorry :)

    If you use a custom mesh, it's up to you to have a proper vertex density since you won't be able to benefit from the "instancedQuads" procedural geometry. However, tesselation based on the camera position (with settings in the Water Rendering overrides) will still help you.
     
  14. ashtorak

    ashtorak

    Joined:
    Feb 19, 2014
    Posts:
    53
    I would be interested in water for planet rendering :)

    Another question: How did you get the clouds in front of the water and how can we get our own transparent objects in front of water?

    Would be great to have an at least somewhat public road map, to see if such things are on the list and what's the current priority.
     
    mbach likes this.
  15. Oniros88

    Oniros88

    Joined:
    Nov 15, 2014
    Posts:
    150
    I have noticed that things like particles or VFX are only visible at the same side of the water: underwater effects wont be visible if you are outside and outside effects arent visible while underwater.

    Is there any way to solve this?
     
    shikhrr likes this.
  16. Jack_Martison

    Jack_Martison

    Joined:
    Jun 24, 2018
    Posts:
    152

    Played around it with large scaled island. In 2022.2 really needs debugging option to see your mask, otherwise it's borderline impossible to fit the mask around the island.

    Overall it works great, but something like depth cache is needed like fresh air, also couldn't find water deformers in 2022 (option only for 2023?)

    Ocean rendering eats a lot of resources with average looking shader (custom water solutions looking somewhere better and eating less resources).
    I get that Unity products should be as cheap as possible in terms of performance, maintaining good look, but in this case it's not as performant as it should be nor looking good in some aspects
    Texture tilling is the biggest issue especially when trying to make cinematic shots from above

    Buoyancy is also very big issue, because it asks to transfer ocean rendering to CPU, which is already no-go solution, also being very basic.
     
  17. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    779
    It has been fixed in 2023.1.0a17 (and above), before that interactions between clouds and water was problematic.
    Keep in mind that 2022.2 water is very basic and still lacks a lot of things.
     
    ashtorak likes this.
  18. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    779
    Right now, not really.
    Since water is considered transparent, it's difficult to make it interact with other transparents.
    However, a rework of transparency will be happenning for 23.2 to solve this problem (among others).
     
    ashtorak and Wattosan like this.
  19. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    779
    All of this in addressed in 2023+ versions and now that we have the main features working, some optimizations are being done as well.
     
    ashtorak and Wattosan like this.
  20. OBiwer

    OBiwer

    Joined:
    Aug 2, 2022
    Posts:
    61
    HDRP Asset > Miscellaneous > "Dynamic Render Pass Culling" seems to disable the water rendering even though it's used (and clearly visible by the camera)
     
  21. amcsearch

    amcsearch

    Joined:
    Feb 18, 2019
    Posts:
    1
    Is it possible to get the water to render within screen space reflections?
     
  22. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    779
    Can you either file a bug with your project or send directly the repro project to me, it shouldn't happen and I can't manage to repro on a simple project. Thanks !
     
  23. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    779
    Sadly no, Water is considered a transparent in the HDRP pipeline thus won't be included in Screen Space Reflection like any other regular transparent.
     
  24. OBiwer

    OBiwer

    Joined:
    Aug 2, 2022
    Posts:
    61
    Tried to reproduce it in an empty project and failed so far. Our project was a 2021.x before and we updated to 2022.2 (maybe it's related to that?).

    I copied the HDRP assets / project settings / post processing volumes over to my test project and even split it into a multi-scene setup (where main camera and ocean are in different scenes), but I can't reproduce it so far (in our project it's easily reproducable, just toggle the render pass culing checkbox), but I can't upload that for size and confidentiality reasons :(
     
    chap-unity likes this.
  25. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    307
    A bunch of issues were fixed recently with dynamic pass culling, so it's high likely it's related to upgrading
     
    chap-unity likes this.
  26. OBiwer

    OBiwer

    Joined:
    Aug 2, 2022
    Posts:
    61
    But my test project (where I try to replicate the bug) and our project are on the same unity version right now. they show a different behavior. if it would be an issue that was fixed, it should be fixed for both projects, shouldn't it?
     
  27. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    307
    Ah ok i see, then i can suggest going to Window > Analysis > Render Graph Viewer, then make sure Culled Passes is enabled in the filters dropdown and than the select camera is the correct one (i don't know if it repros in scene view or gameview only), then click capture
    You can compare on both projects which passes are executed and which one are culled, it might give some insight on what's happening
     
  28. OBiwer

    OBiwer

    Joined:
    Aug 2, 2022
    Posts:
    61
    water is culled in scene and game view.
    Went through the Render Graph Viewer and compared both one by one.
    In the project where the water is culled...
    - ... There are "Render Shadow Maps" (2x culled passes, 1x non culled) which are not present in the other project
    - ... There are more "Render Water Surface GBuffer" passes. (They all have a grey badge below, so I guess they are not culled?)
    - Forward Transparent is not culled (grey badge) while in the project where the water is visible "Forward Transparent" is culled (black badge).

    Besides that there is only one further difference, the project where the water is culled has a custom pass (which renders into a render texture, so it shouldn't be bothering here).


    (btw, exporting the render graph into a textfile so you can compare them with a diffing tool would be nice, just saying)
     
  29. ScoutMaster

    ScoutMaster

    Joined:
    Jan 18, 2017
    Posts:
    6
    Is there a way to get the velocity of the waves?
     
  30. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    779
    Not sure exactly what you mean by "velocity of the waves". To me, velocity is a direction + speed.

    Now let me explain what's possible and what's not and hopefully you get an answer to your questions depending on what you meant.
    • Right now, there's no motion vectors for the Water Surface, (this is why DLSS and TAA are blurry when used on water), meaning you cannot get the velocity of the pixels in Screen Space.
    • If by Waves you mean "Shore waves", there's a speed component in there you can get easily.
    • If by Waves you mean the current (to make object follow the general direction of the current), you can the normalized direction of it when querying the water surface with ProjectPointOnWaterSurface (see scripts above) and current will be in "searchResult.currentDirectionWS".
    • If by Waves you mean the general swell (like making your object moves not only up and down but with swell), there's no direct way to get velocity of them, you can only query the height of a point. However, if you query multiple points around your object you can infer a normal and make your object move in a direction depending on the slope it's on
    However, something we could do is be able to retrieve the normal directly of the water surface at a point when using "ProjectPointOnWaterSurface".
    We'll add that on the roadmap and see what's possible.
     
  31. jbergs

    jbergs

    Joined:
    Feb 13, 2014
    Posts:
    26
    Issue with using the Water System with Recorder. I'm rendering out a movie file of a scene with water for Cinematic purposes in HDRP. Since Recorder is recording my scene at a slower render rate, the Water system is rendering at another speed. So my rendered out video shows the waves moving super fast. Is there a way to set the waves to run in deltaTime.. if I understand that correctly? So that no matter how slow my Recorder renders are, the waves will move at the correct speed?
     
  32. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    779
    Hey this is known and currently being fixed (done on 23.2 alphas) but backports for older versions are in progress !
    You can follow it here
     
  33. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    307
    Sorry i don't understand how that's happening, and without a repro project it's difficult to say, the graph you described seems very normal to me so it looks like there's an error somewhere and the water doesn't render because of that, but it's not culled
     
  34. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,412
    The accessibility of the new water system is still not good enough in 2023.2.0a ...

    I added the water via context menu, then the error shows up that I have to activate it in the hdrp settings. Jumped there via click, now everything seems to be configured properly, but ... where's the water?

    w.png

    There's the info about volume setting missing.
     
    Last edited: Mar 17, 2023
  35. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    779
    In newer version, when creating a new project, water rendering should already be on Default Volume profile

    upload_2023-3-17_15-1-55.png
     
    Rowlan likes this.
  36. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,412
    Nice, will check in the next releases. Are there tutorials about how to deal with eg foam along terrain? Also about the deformers. Or is there an example project? And how to create rivers? But I guess rivers aren't possible yet since that depends on the splines / mesh / uvs. I do like the trail along eg a moving sphere. However that seems to be limited to a patch of the ocean and not be general on the ocean. Alpha and all, it's going into an exciting direction.
     
    chap-unity likes this.
  37. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    779
    Hey, great time to ask questions about sample projects :).

    As a matter of fact, we just landed HDRP Water sample in the in 2023 engine versions
    (starting 2023.1.0b10 and 2023.2.0a8 respectively).

    The sample showcases 4 differents simple and lightweight scenes (Pool, Glacier, Island and Waterline) focusing on different setups covering the full range of HDRP Water System features. Theses scene can be used as a headstart for what you are trying to build, or just to educate yourself on how to set up those kind of scenarios.
    Each scene comes with some explanations (see the description gameobject in the hierarchy).

    Pool
    upload_2023-3-21_17-53-21.png


    Glacier (River to Ocean)
    upload_2023-3-21_17-53-31.png


    Island
    upload_2023-3-21_17-53-44.png


    Waterline (Full Screen Post Process Custom Pass)
    See image above


    They are avaialble through the HDRP Package Manager, in the sample section (Water sample at the bottom).



    In addition, there's a bigger github project (with bigger assets and more content) that should be available in the next couple of weeks (we'll keep you updated here as well). Here's a few images from it as well.

    upload_2023-3-21_17-59-4.png

    Lastly, we'll be at GDC for the end of the week. There's an in-booth overview of the Water System on Wednesday @4.30pm, if any of you are there and want to chat about the system or HDRP in general, we'll gladly do so !
     
    Last edited: Mar 22, 2023
    m0nsky, PolyCrusher, Rowlan and 18 others like this.
  38. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    umm which Gifs?
     
    Gooren likes this.
  39. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    Super awesome! Will look into the samples as soon as I can and will also check out the github project! (which is a great idea by the way!!)
     
    chap-unity likes this.
  40. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    1,714
    well, i have to say that looks decent, nice job
     
    chap-unity likes this.
  41. InfiniteDice

    InfiniteDice

    Joined:
    Jun 30, 2015
    Posts:
    44
    I'm looking to access the HDRP WaterSurface script to change parameters in real time under simulation -- Swell -- 'Distant Wind Speed' or 'Current Speed'. Any ideas here - I can't find examples of anyone doing this.
     
  42. InfiniteDice

    InfiniteDice

    Joined:
    Jun 30, 2015
    Posts:
    44
    In response to my own question... it seems some naming conventions are strange and don't match, instead of using WaterSurface.DistantWindSpeed (as worded in the editor) you need to use WaterSurface.LargeWindSpeed , I've noticed that pretty much every parameter here is labeled something different, this kinda makes it difficult to sort out at first I had to dump all the values in a test to see what was what. I assume this will be updated or at least mentioned in some upcoming scripting documentation? Thanks :)
     
    Last edited: Mar 30, 2023
  43. OBiwer

    OBiwer

    Joined:
    Aug 2, 2022
    Posts:
    61
    set inspector to debug mode, might help in the future.
     
  44. NilsLeijdekker

    NilsLeijdekker

    Joined:
    Dec 19, 2018
    Posts:
    10
    Just right-click inspector and click "Debug". To go back just do the same thing but click "Normal".
     
  45. InfiniteDice

    InfiniteDice

    Joined:
    Jun 30, 2015
    Posts:
    44
    Thanks that does help in a way! :)

    I seem to be having an issue accessing this 'Volume' as displayed under 'Sky and Fog Global Volume'. I've tried about 6 different methods some from chat GPT... lol god that thing can seem amazing but it just can't help here.

    My goal is to set the values for Visual Environment - Wind - Global Orientation and Global Speed.... So my clouds can match my water settings.

    The last version of Unity I had was 2019.2 so this whole volume / volume profile and sharing is all new to me.

    Doesn't seem to be much by the way of examples in the documentation - they have some Fog example which I tried to base a solution off of but it didn't end up working for me.

    Any pointers will be appreciated. :)
     
  46. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    1,714
    Chatgpt is amazing but it can only help you for things up to 2021

    I do not understand exactly what do you need (i'm not 100% today) but remember, there is also a premade global values in: Edit > project settings > HDRP Global Settings
    If you are not using an override, those values are used (most of the time i uncheck those values -.- is kind of annoying)
     
    Last edited: Mar 31, 2023
  47. Jack_Martison

    Jack_Martison

    Joined:
    Jun 24, 2018
    Posts:
    152
    I just wanna say that all of these samples are amazing and may remove 99% of basic questions, everything so visual and intuitive, I genuinely didn't know the power of decals.

    Hats off to you guys
     
    chap-unity, bdb400 and Ruchir like this.
  48. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,412
    Looks very awesome. Please state the license on that when it's released, ie for asset re-use.

    Do you guys plan on making the water deformers / foam generators automatic? If you have a 4k island then the creation of the deformers could become tedious.

    w.jpg
     
  49. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    779
    Can you develop a bit on what you mean by "automatic" ?

    On the HDRP Package sample, there's already some ways shown how we can add foam on the border of object by using the custom foam input to inject foam dynamicly in the Water Shader graph material. Is that what you mean?

    And for deformers, I'm not sure what you mean either :)

    Good point, It will be included when released !
     
  50. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    The Glacier Demo are interesting, by raising the sea water for the river. . . .
    what are the workflow for this kind of scene with the current water system?
    upload_2023-4-13_1-47-31.png