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. We have updated the language to the Editor Terms based on feedback from our employees and community. 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. NetherOfficial

    NetherOfficial

    Joined:
    Jan 12, 2021
    Posts:
    6
    How to use it?
    I must upgrade Unity? (i have 2021.3.16f1)
     
  2. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    720
    • Enable SSR on Transparent (to get SSR on water surface)
    • Have a large Reflection Probe Blend Distance
     
    OBiwer likes this.
  3. NilsLeijdekker

    NilsLeijdekker

    Joined:
    Dec 19, 2018
    Posts:
    9
    Hi, is there any specific changelogs for the water system so we can seen when certain features get added, thanks!
     
  4. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    720
    There's no "water specific changelog" but you can look in the release notes of alpha and search for "HDRP", usually all the new / fixed / changed are logged there.
     
    NilsLeijdekker likes this.
  5. SkandYxyz

    SkandYxyz

    Joined:
    Mar 13, 2015
    Posts:
    83
    Is there a way to disable rendering reflection probes on water?

    I found a way to disable reflection probes rendering on water. I created a very small box volume around the camera and set screen space reflections ray miss and last bounce to sky. I guess water is rendered to a quad direct in front of the camera?

    Edit: Ah, that just disabled ssr rendering reflection probes everywhere :p
    upload_2023-1-22_22-17-9.png

    Kind Regards
     

    Attached Files:

    Last edited: Jan 25, 2023
  6. XJDHDR

    XJDHDR

    Joined:
    Mar 31, 2020
    Posts:
    22
    I have a question about this water system. I am building an open world game which has exterior locations divided into grids which are switched between near and LOD versions, depending on where the player is. One feature will be that each grid will have it's own water plane, and each plane can be at a different height compared to neighbouring grids.
    My concern is when two or more adjacent grids have their water planes at the same height. To account for this, each water plane would need to be synchronised in some way such that waves would smoothly transition between planes without creating seams on the edge of each grid. Is this something that this water system supports or will support?
     
  7. OBiwer

    OBiwer

    Joined:
    Aug 2, 2022
    Posts:
    61
    • SSR on/off for Transparent looks exactly the same on the water
    • Even with a high blend distance (20 along Z) you can clearly see the transition

    upload_2023-1-26_12-20-57.png
     
  8. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    720
    You are probably missing the SSR on transparent Default Frame settings (it's off by default), this might explain why it's not showing anything.

    I'll investigate if something can be done on this to improve but I'm not sure.
     
    OBiwer likes this.
  9. OBiwer

    OBiwer

    Joined:
    Aug 2, 2022
    Posts:
    61
    Yes this was actually the case! I now have screen space reflections on the water, but still, the water is way brighter where it is affected by the light probes.
     
    chap-unity likes this.
  10. meanmonkey

    meanmonkey

    Joined:
    Nov 13, 2014
    Posts:
    148
    Love your water system. Any chance we can get the option to set a uv offset, script based at runtime ? I would need that for my open world / origin reset based game. Thank you!
     
    chap-unity likes this.
  11. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    720
    Can you expand a bit on what you mean by UV offset exactly and what is the end goal of that to be sure I understand correctly.
    Is the goal to be able to have a deterministic water and to be able to "sync it" by setting an offset?
     
    Last edited: Jan 31, 2023
  12. meanmonkey

    meanmonkey

    Joined:
    Nov 13, 2014
    Posts:
    148
    Heya, thank you for responding!

    My procedural world is quite large, and to avoid exeeding floating point limits when I move around in the world I have to reset every single object back towards 0 within a certain threshold.

    The environment shaders (like terrain, water, etc) naturally react to this origin reset as casual world movement and render based on the new world position, which is, in this case, undesired.

    The solution for this problem is to set the negative origin reset value (e.g. +/- 1000 units) as position offset in each affected shader. (e.g. in my terrain shader via UV for all the heightmaps and textures). Maybe there is a better way to solve this, but it works quite well for me for now.
     
  13. stojic

    stojic

    Joined:
    Feb 11, 2016
    Posts:
    3
    do you plan to add support for planar reflections or any type of reflections
     
  14. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,126
    @chap-unity Water feature seems to be broken in 2022.2.4, or some setting is causing this.
    keeps giving this error:
    "Compute shader (WaterLighting): Property (_CameraDepthTexture) at kernel index (1) is not set
    UnityEngine.GUIUtility processEvent (int,intptr,bool&) "

    Bug report with more info, video & project: IN-30670
     
    Last edited: Feb 1, 2023
    chap-unity likes this.
  15. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,785
  16. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,126
    Yes, I just realized why this might be happening, I have reflection lighting multiplier set to 0 in indirect lighting controller.
    I know this can mess up ocean visuals, but is it expected to not render at all, not sure, so I'll leave it for them to decide :D

    edit: Oh.. I know what you mean now :-
    fixed
     
    Last edited: Feb 1, 2023
  17. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,126
    There seems to be an issue with SSR algorithm PBR Accumulation & water system:
     
  18. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    720
    Thanks for the report, we'll have a look.

    For this one, it's expected that they look the same on water surface. It's because PBR Accumulation algorithm fallbacks to regular Approximation on transparent objects. (see documentation on PBR Accumulation)
     
  19. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    720
    Okay, I had a quick look and it has something to do with the "Dynamic Render Pass Culling" in the Miscellaneous section (bottom) of the HDRP Global Settings. If you have checked this and do not have Decal checked in the HDRP asset you get the errors, so while this is getting fixed, either check Decals in your HDRP asset or Uncheck Dynamic Render Pass Culling !

    Thanks for the report.
     
    hkalterkait, m0nsky and PutridEx like this.
  20. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,126
    Quite the sneaky bug
    I remember enabling render pass culling, I always do, and disabling decals for faster builds.
    Reactions can happen where you never expect them :eek:
     
    chap-unity likes this.
  21. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    720
    I also investigated why the discrepancy on this one and it comes from the limitation that SSR on Transparent objects won't reflect sky, so if you have sky on a reflection probe, it's going to be impossible to blend correctly. Given that water is a very special transparent, we'll see if we can do something about it.
    Thanks for the feedback, wasn't on our radar !
     

    Attached Files:

    Last edited: Feb 2, 2023
    shikhrr and OBiwer like this.
  22. Onat-H

    Onat-H

    Joined:
    Mar 11, 2015
    Posts:
    195
    Well the thing is that ssr completely disappears on the water surface if set to accumulation (so no fallback is visible/falls back to reflection probes)
     
  23. AndrewDavidJ

    AndrewDavidJ

    Joined:
    Mar 25, 2015
    Posts:
    5
    So, I noticed the feature highlight post for Unity 2023.1 beta mentions a Water Line – and the change log also mentions "improved water line detection" in a couple places, but I can not for the life of me figure out how to enable it or get it to work.

    Am I missing something? I'm on Unity 2023.1.0b1 and I see all the other water-related features mentioned in that post (Water Deformer, Water Excluder, Foam Generator, etc) and they all work great, but I just do not see the water line.

    Am I misunderstanding?
     
  24. ScoutMaster

    ScoutMaster

    Joined:
    Jan 18, 2017
    Posts:
    6
    Is there any way to set the time of the water? Im making a multiplayer game so syncing the waves is important. Thanks for any answers
     
  25. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    720
    Hey, I think it's the wording that's not clear. It's not a component like Water deformer, excluder, foam generator, it's just something that is activated with Underwater rendering. So to be able to see the water line (when the camera cross the water surface), you just need to enable Underwater in the Water surface component and that's it. (Just remember to add a collider if it's a non infinite surface for it to work correctly).
     
    YuriyPopov likes this.
  26. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    720
    Right now, it's not really possible you are right but it's track on our roadmap as a "bug". So you can follow the fixing process of it here !
    Hopefully, this won't take long :)
     
    Wattosan likes this.
  27. AndrewDavidJ

    AndrewDavidJ

    Joined:
    Mar 25, 2015
    Posts:
    5
    I thought of that, but I did set it up with underwater enabled and moved the camera up and down just to see, and all I saw was a harsh, sharp line that kind of just looks like the surface of the water clipping. Is that what the water line is supposed to be? I assumed it would look like a smooth, blurry line or something so the transition between above water and under water would be less harsh.
     
  28. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    720
    Yes, we have to draw the line somewhere, That will be up to users to do the rest depending on the artistic direction of their game.
    Basically, we provide the tools to be able to retrieve this water line mask in the Shader Graph so that, by using a full screen custom pass for exemple, anyone is able to do what they want with it.
    Here's an exemple:

    Waterline_postprocess.png

    And, as a bonus, this will most probably end up in a sample so that anyone can have a starting point to see how to achieve easily this kind of thing.

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

    AndrewDavidJ

    Joined:
    Mar 25, 2015
    Posts:
    5
    OH, I SEE!
    Perfect, thank you so much for clarifying! :)
     
    chap-unity likes this.
  30. ScoutMaster

    ScoutMaster

    Joined:
    Jan 18, 2017
    Posts:
    6
    Thanks for the reply :)

    Don't mean to rush, but is there any date on this? I'd love to use this for my school project due in April but if waves can't be synced anytime soon, we'll have to go back to our old shader. Again thanks!

    Or, is there any way I can do it myself?
     
    Last edited: Feb 7, 2023
  31. sphair

    sphair

    Joined:
    Jan 22, 2014
    Posts:
    4
    "retrieve this water line mask in the Shader Graph"
    Which node provides this data? I see there are multiple under Utility/HDRP/Water but hard to tell without documentation :)
     
  32. UltMate-Potato

    UltMate-Potato

    Joined:
    Apr 11, 2021
    Posts:
    4
    Hi! will we be getting water splashes for objects falling in water or bullets shooting into water by any chance? or maybe a vfx graph integration so the we could use vfx graph's as water splashes?
     

    Attached Files:

  33. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,785
    @chap-unity is the Deformer only a static deformer? any plan to add simulation/ accumulation to the deformer just like how foam generator work especially for the bow deformer?
    Refraction seems to have limited distance, any way to remove the distance limit?
    upload_2023-2-9_0-53-51.png

    Also any news about exposing underwater ior refraction
     
    impheris likes this.
  34. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    720
    Hey, sadly we can't commit to a date. Water do now supports timeline (meaning it's deterministic if you scrub the timeline) but I'm not sure it will help with with your multiplayer issue. Best you can do is follow the advancement of the bug report.
     
  35. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    720
    It's not shipped yet, there's still a few things that needs improvement about the texture resolution output (you can see banding in the screenshot above if you look closely). Technically, it should be inside the HD Sample Buffer node in shader graph, a new option will be added in the enum. (for 2023.1 and 23.2)
     
    sphair likes this.
  36. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    720
    Nothing out of the box is planned yet. The coming improvement about transparency sorting will help with VFX that's for sure but for the rest, you can already alter normals with decals (that affects transparent) and also, if you want to make a rain effect or interactions with water, you can create a new material in the water surface inspector and and edit this shader graph.

    As for the VFX inetgration yet, (like for creating breaking waves particle.. etc), it's also under consideration but still vague as to how this is going to be taken care of !
     
  37. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    720
    For the distance, I would bet it's a setup issue, I had a quick look on a clean project can't really manage to repro so If you have a proper repro to send, I will have a second look.

    For the second part, it was never about exposing underwater IOR but just to be able to disable it and fallback on other method in addition to the color buffer, it's still on track and close to be ready, we're trying to get performance right.
     
  38. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    720
    Had a deeper look on this one as well, and I think it all boils down to the projection of the reflection probe. By default reflection probe volume is a box and the checkbox "use influence volume as proxy volume" is checked so that means by default we are using box projection.

    If you uncheck that box, you will get the infinite projection and (I'll let you be the judge of that) but my bet is that it will fix the blending issue between the sky coming from SSR, sky coming from probe and Sky coming from the sky map ! Let me know if it helps.
     
    OBiwer likes this.
  39. OBiwer

    OBiwer

    Joined:
    Aug 2, 2022
    Posts:
    61
    Uhm ... The checkbox for useInfluenceVolumeAsProxyVolume is already unchecked in my setup.
    While indeed the blending is better with having it disabled, the area affected by the Reflection Probe is clearly brighter. Currently I placed the probes in a way, that it looks like "shallow water" near the coast... but yeah....
     
  40. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,785
    i get that distance limit when setting the distant wind speed to 0
    upload_2023-2-10_18-9-9.png
    This is on new clean project
    upload_2023-2-10_18-30-32.png
     
    Last edited: Feb 10, 2023
    chap-unity likes this.
  41. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    720
    Okay, thanks for the precision, got it.
    Indeed, I really don't believe it's expected and we don't have any good reason why it's behaving like that.

    The workaround is that, it's doesn't seem to happen with River and Pool water surface type.

    I logged a bug, you'll be able to follow it here.
     
    Reanimate_L likes this.
  42. DEEnvironment

    DEEnvironment

    Joined:
    Dec 30, 2018
    Posts:
    437
     
    Last edited: Feb 10, 2023
  43. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,785
    True, for pool and river seems fine. Only happened on Ocean, Lake Surface Type
     
  44. ScoutMaster

    ScoutMaster

    Joined:
    Jan 18, 2017
    Posts:
    6
    Can I get some pointers on the "Water Mask"? I'm confused on how to setup a texture properly that suppresses the waves at shoreline. Can I get some more detail on this?

    Thank you!
     
  45. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,785
    upload_2023-2-11_17-28-54.png
    is water refraction depth doesn't get distorted by the water normal? there's a harsh line on the refraction.
    upload_2023-2-11_17-52-52.png
    Also what is this instanced quad? do we need to manually supply the instanced quad mesh?
     
  46. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    193
    You can use the red, green and blue channels to attenuate each of the three bands of the simulation.
    To setup the texture, you have to apply it on your surface and then set the debug mode to Water Mask in the Miscellaneous section.
    That way you can have a visual feedback to adjust the scaling and offset of your mask

    upload_2023-2-14_14-5-47.png
     
    chap-unity likes this.
  47. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    193
    I am not sure of your setup, is the sphere completely underwater here ? But in general refraction depth is estimated from the screenspace information and is impossible to get right when there are depth discontinuities like that. You can adjust the maximum distance parameter in the Appearance > Refraction section of your surface to limit the problem

    For Geometry Type:
    • Quad will always draw a 256x256 mesh. If you have a very large surface, this might result in poor vertex density
    • Instanced Quads will adaptively draw a varying amount of quads depending on your distance to the surface to maintain a balance between vertex density and performance
    • For ocean, Infinite is the same as instanced quads except that it covers and infinite surface
    You can switch the shading mode to wireframe in the scene view to check the difference
    upload_2023-2-14_14-13-21.png
     
    chap-unity likes this.
  48. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,785
    it's fully underwater, Maximum distance are maxed.
    upload_2023-2-14_21-32-6.png
     
  49. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    193
    So in this case you should reduce the maximum distance to hint the system that the refraction happens on a small distance
     
  50. Kadae

    Kadae

    Joined:
    Dec 7, 2013
    Posts:
    52
    Looks like targetPosition now targetPositionWS and startPosition now startPositionWS.
    What about FindWaterSurfaceHeight? Is it unsupported and removed?

    UPD: Ok, I found ProjectPointOnWaterSurface. :)
     
    Last edited: Feb 16, 2023
    chap-unity likes this.