Search Unity

Official Water System for the High Definition Render Pipeline

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

  1. fra3point

    fra3point

    Joined:
    Aug 20, 2012
    Posts:
    269
    Thanks for your reply! I actually already have those options turned on and i get no reflections on water... I can confirm that SSR work fine on all the other surfaces except for water.

    Here are my HDRP Quality settings for SSR, with Transparent option enabled
    upload_2022-5-21_12-12-13.png

    And here's my Global Volume, with Raytraced SSR and Transparent option active:
    upload_2022-5-21_12-13-21.png

    Do you have any idea why this is not working?

    Thanks,
    F.
     
  2. CaseyHofland

    CaseyHofland

    Joined:
    Mar 18, 2016
    Posts:
    613
    Camera settings maybe…?
     
    fra3point likes this.
  3. fra3point

    fra3point

    Joined:
    Aug 20, 2012
    Posts:
    269
    Oh Yes!
    I had to use Custom Frame Settings and enable Transparent SSR there. Alternatively, I could enable transparent SSR in the Default Frame Settings.

    upload_2022-5-21_14-3-56.png


    Thanks a lot!
     
    CaseyHofland likes this.
  4. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    582
    It is a very common mistake that does not make any sense.

    This should be part of the initial market research to see what is in the market, what users need, what is a priority according to users, read the reviews of the water projects in the asset store to understand what problems they are facing. etc etc.
     
  5. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    582
    Is there a basic/experimental version of the water that would work in 2021 LTS?
     
  6. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    upload_2022-5-29_18-52-30.png

    Playing around with rivers and CPU cost is a bit crazy, will it be improved or maybe there are settings I can enable to reduce the cost?
    (This is the CPU cost when you enable CPU simulation)

    note: My CPU is bad to be honest, single thread performance isn't great, but it still feels a bit too high :D
    And this is in editor, I imagine it'll be faster in a build

    GPU performance is great

    ---
    so far it's good, easy to get started (except the many things you need to enable, good old HDRP :p), with the upcoming fluid features it'll be great. Especially for rivers, will make a huge difference. Easy to get going with it, I look forward to it :D

    no, unlikely to happen as well
     
  7. CaseyHofland

    CaseyHofland

    Joined:
    Mar 18, 2016
    Posts:
    613
    You know, HDRP improved upon runtime Material editing with stuff like
    HDMaterial.ValidateMaterial(Material)
    .

    If you want to enable raytracing, there is that whole error window that will validate all the things that need to be enabled for raytracing.

    There seems to be a trend in HDRP to validate a bunch of settings to enable certain features. Would it be an idea for the team to expand the raytracing-error-window-thingy to include a bunch of common features people often get wrong, such as reflections, VR, and (of course) the water system?
     
  8. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    582

    I see.
    Understandable. Lesser things do not have backwards support so... kind of expected :D

    Then this is only working on the latest 2022.2 alpha builds?
     
  9. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    582
    Oh fun! :D

    The Ocean went all over the place. My entire scene is underwater.
    upload_2022-5-29_23-54-32.png

    Thing is the underwater option is off.
     
    Last edited: May 29, 2022
    hippocoder and valarnur like this.
  10. CaseyHofland

    CaseyHofland

    Joined:
    Mar 18, 2016
    Posts:
    613
    You have to add Water-stuff to your volume settings, otherwise it will look like that
     
    chap-unity and soleron like this.
  11. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    582
    Thank you.
    And how can I make the water look lighter in the shallows instead of darker?

    upload_2022-5-30_4-6-47.png
     
  12. CaseyHofland

    CaseyHofland

    Joined:
    Mar 18, 2016
    Posts:
    613
    I don’t know, but I think your picture there looks alright, you’re seeing the terrain through the water making it look darker. If you ‘can’ make it look lighter it would probably look weird elsewhere. Foam is probably your best option here, that or just heightening your terrain until the Unity team gets to contact foam
     
  13. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    582

    As an islander, who has spent half his life in the sea, that image is automatically rejected by my brain.

    It is absolutely not alright.
    The water is always the same, and appears lighter because of the shallow depth and the light reaching and refracting directly the sea floor. Darker where the light does not reach the bottom as easily, i.e. in deeper areas.

    It is not related to foam.
    This light effect appears even in absolutely calm seas where there is no foam at all.

    Here as it appears in nature:





    Here as it appears in another Unity asset.
    As you will notice, foam is a completely different element.

     
  14. jiraphatK

    jiraphatK

    Joined:
    Sep 29, 2018
    Posts:
    300
    Maybe you could try this setting?
     
    soleron, valarnur and Deleted User like this.
  15. LumaPxxx

    LumaPxxx

    Joined:
    Oct 3, 2010
    Posts:
    339
    No,you can't do it for now.
    because the water shader does not react to ambient light.
    all the lighting you can see in the shadow are reflections.
    the water system is still under development.
    Unity developer auzaifee said it was fixed in the newest vesion, but i haven't see it in unity2022.2.a13.
    the best thing we could do is waiting for the next alpha version to be released.
     
  16. Deleted User

    Deleted User

    Guest

    If I remember correctly, the pool or the river systems do have this effect
     
    soleron likes this.
  17. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    We know how to make software, thank you.

    We've evaluated our target features and what we want to cover as a usecase, what is offered is in the asset store is not necessarly our target.
     
    fuzzy3d and olavrv like this.
  18. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    Indeed, you can follow the steps described by LumaPxxx
     
    fra3point likes this.
  19. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    You can reduce the resolution of the simulation on each water surface (for the CPU) and define which bands will be included or not in the simulation.

    That said if you decided to go with a 256x256 simulation, you will have a high CPU cost no matter what.
     
    Last edited: May 30, 2022
    valarnur and PutridEx like this.
  20. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    You can achieve all the results in the images you shared with the current system, but I conceide it is hard to explore for now. We'll be providing samples to help you explore the parameters

    Your transparency color, scattering color and absorption distance are not properly set up to achieve what you are looking for.
     
    soleron likes this.
  21. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    No, it's a 2022.1 plus feature
     
  22. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    We are trying to get the next iteration of the water system into 2022.2 for now, it includes a bunch of visual and control improvements.
     
  23. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Thread is moderated, deleted a bunch of posts. Only use it for direct feedback to Unity about HD water system. If you want argue among yourselves go to discord. Thanks, and don't reply to this mod note.

    Allowed posts would be something like reporting a bug, feature request or query / feedback about the system. Nothing more.
     
    m0nsky, teutonicus and Deleted User like this.
  24. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
  25. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    I'm using 2022.1 plus, but I do not see the water available. Am I missing something?
     
  26. Deleted User

    Deleted User

    Guest

    It's 2022.2 only
     
  27. auzaiffe

    auzaiffe

    Unity Technologies

    Joined:
    Sep 4, 2018
    Posts:
    255
    Hey,

    Our underwater effect remains a strong over-simplification of the what is actually happening (for various technical reasons).

    I am not sure to understand which physical phenomenon you are trying to describe. Can you elaborate? Is it when you are above or under water? Can you show me on a real world reference (image or video) for the effect you are describing?

    Thank you
     
    ftejada and hippocoder like this.
  28. Deleted User

    Deleted User

    Guest

  29. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    When object are submerged, it should have different color, somekind of color shift and additional fresnel.
    ie in my screenshot you can see the submerged/underwater parts of the objects have a blueish color shift based on the distance and blue/greenish fresnel.
    So not just a depth fog
    upload_2022-6-8_1-27-12.png
    upload_2022-6-8_1-32-0.png

    Edit

    @auzaiffe on second thought
    The refraction color are correct though, minus the underwater fresnel. The color shift looks good.
    upload_2022-6-8_19-48-44.png
    but when going underwater it just depth fog, and in fact it looks totally different.
    upload_2022-6-8_18-45-39.png
    There might be a technical reason for it, is the underwater color not using the same buffer that used by the refraction?
    also the other issue is the fog density are different when looking over water and underwater
     
    Last edited: Jun 8, 2022
    ftejada, hippocoder and Ruchir like this.
  30. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Started messing about with the water. It's fun and usable for a lot of things! I'm enjoying the atmosphere it brings while experimenting. Thanks for the hard work @auzaiffe

    Stylised toxic swamps and all sorts are possible. I haven't yet tried slapping a flowmap on anything but I'm guessing you've enabled a workflow to make that possible.

    I notice with point lights under the water surface near the surface, creates a black patch. I'm torn if that's really what I want for a game or it's the shadow due to density. I seem to recall it happening to me when I did water too, a few years ago unintentionally.

    Some kind of bug - anyone recognise it?

    Code (CSharp):
    1. type is not a supported float value
    2. UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
    Just spams this for a while when using inspector with ocean. Sometimes it gets really excited and only ever renders under water regardless. Sometimes not. So perhaps it's known.

    Another problem is underwater rendering seems to blow out exposure, not sure how to fix that and wonder what the plan is with it eventually?

    Using latest Unity alpha 16

    Also... I want to do bulges or swells in the water. This is called "surface tension".

    Imagine as a large marine animal or submarine comes to the surface? the water bulges there before breaking, and that effect is much-needed for us! I suspect there must be a way, perhaps with custom mask or material? In own water I simply did a little math or in Crest it's just a local mask.

    Noticed there is a water type shadergraph. Perhaps there...

    upload_2022-6-12_13-27-58.jpeg
    upload_2022-6-12_13-30-2.jpeg upload_2022-6-12_13-31-6.jpeg
     
    ftejada, soleron and Deleted User like this.
  31. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    i only had a quick look into the new water using alpha 16 and have been enjoying it. thanks @auzaiffe.
    nevertheless i came across some issues which haven't been mentioned here so far.

    double fogging
    looks like the water suffers from double fogging noticeable at the shore line or any intersection between scene geo and the water surface. the refracted parts already contain fog /which gets applied in the "OpaqueAlmosphericScattering" pass). but "void WaterDeferredLighting()" simply adds fog for the water surface on top: finalColor = finalColor * (1 - volOpacity) + volColor;

    doubleFogging.PNG

    motion vectors
    at least foam would greatly benefit from motion vectors as it may end just in a blurry mess.
    might be a good point to add some advanced motion vector support to HDRP like motion vectors from texture animations (scrolling and flip books) :)

    foamMotionVectors.PNG

    additional color pyramid passes
    not sure about this one but i wonder why HDRP calculates an additional color pyramid right before the water. water does not use/support blurred refractions as far as i can say - so do we need these extra passes?

    tessellation
    tessellation looks like it could need some more love. triangle size in the distance just looks insane. and on the closer parts the generated triangles are not evenly distributed - as if the tessellator used an even tess factor?

    tess.PNG

    water rendering volume component ui bug

    ah, tricky: although "additional properties" -> "all visible" is active "max tessellation factor" does not show up. i have to manually enable "show additional properties" in the component to get access to "max tessellation factor" - which is set to 10 by default :(
    if i set it to 9 i get rid of these thin triangles stripes shown above. and i can also adjust tess fading to some more reasonable/performant values.

    oddtess.PNG
     
    Last edited: Jun 12, 2022
    ftejada, NotaNaN, soleron and 8 others like this.
  32. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    "max displacement" here is a tricky param in shader graph as how should an unexperienced user should know about it?
    after all i would prefer a unified approach for all water surfaces like "Continuous LOD Morphing Geo-MipMap" as proposed by arm, used by naughty dog, unreal or crest.
    i am not sure how one would otherwise create a lake that goes into a river that goes into the ocean.
     
    ftejada, Ruchir and hippocoder like this.
  33. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    does not look as if there is any underwater rendering at all...
     
    hippocoder likes this.
  34. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    That would really help a lot with particle system/VFX systems as well :)
    Currently, I have to use this asset for this feature: TFlow | Particles/Effects | Unity Asset Store
     
    ftejada, Deleted User and PutridEx like this.
  35. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I am having really big problems getting underwater to be useful in any case at all, so I am assuming that it is WIP. Also the tess as you pointed out, is a bit microtriangle hell.
     
    ftejada, Rowlan and Ruchir like this.
  36. Deleted User

    Deleted User

    Guest

     
    ftejada, bdb400, elias_t and 2 others like this.
  37. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    might be a misunderstanding :) from what i can see TFlow calculates motion vectors to better blend between the frames of the flip book. although these kind of motion vectors mots likely would be needed as input they are only 50% of the final solution: i was talking about 2nd 50% - the screen space motion vectors HDRP renders to drive motion blur, taa and dlss. these currently are rendered for camera motion, animations and vertex displacement - but not for texture animations. so white water using a simple scrolling texture will look blurry.

    in case of the water motion vectors from the vertex displacement might be just fine. however this would need the water system to ping pong the simulation between 2 sets of render textures so when it comes to render out the motion vectors you have access to both: the current simulation and the simulation of the previous frame to calculate the delta.
     
    ftejada and PutridEx like this.
  38. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    might be a dumb question, but how do you actually create an infinite ocean?
    using a camera with near clipping: 0.015 and far clipping: 12000 i have to raise "Grid Size" in the "Water Rendering" volume component to at least 1000 to get some kind of infinite ocean - at least if the camera is about the ocean height. from higher altitudes there still will be a gap between horizon and ocean and grid size would have to be even higher.
    rising the grid size however reduces the vertex density of the ocean surface which may result in poor visuals.
    am i missing something here?
     
    ftejada and hippocoder like this.
  39. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    Yeah, you are right, they actually bake the motion blur directly into the flipbook to get around the limitations you mentioned.
     
  40. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,290
    I'm aware it's a tough thing to ask, but could the water guys please work together with the terrain tool / shader guys? There's no information about what the upcoming terrain shader graph changes are supposed to do.

    Example: All that water is nice, but the terrain needs wetness as well. I painted the texture with smoothness changes here to show what I mean:

    water.jpg
    Especially required below the water and at the shorelines.

    I have Microsplat for that which is awesome and does everything I need in that regard, but a Unity solution would be nice as well.

    Another just for emphasis of the importance of the effect:

    eff.jpg
     
    Last edited: Jun 16, 2022
    larsbertram1, soleron, Ruchir and 4 others like this.
  41. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,290
    Had to make a video, I really like the result :)

     
    ftejada, fra3point, bdb400 and 12 others like this.
  42. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    582
    It probably is not so difficult. I remember ages back, there was a custom shader pack for mentalRay called Lume Tools. There was such a shader there.

    If this could be done more than 10 years ago offline, I think it is possible to create a smart shader like that, OR at least create some nice blend Shader based on height, to offer this option without having to paint the edge with a different material.

    https://help.autodesk.com/cloudhelp/2016/ENU/mental-ray-docs/mr_docs/tutorials/lume/Wet.html

    https://download.autodesk.com/globa...iles/mentalray_Wet.htm,topicNumber=d30e726565
     
    ftejada likes this.
  43. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    well i remember they did said that the waterline rendering are removed temporarily due some alignment issue with the surface, i guess they also removed previous underwater rendering. . .
     
  44. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    You need a volume with water rendering for it to show up, and to also tick underwater on the ocean itself. Sometimes the water will show anyway, sometimes not. It's early in dev I guess.
     
  45. SUUNE

    SUUNE

    Joined:
    Mar 10, 2019
    Posts:
    65
    hmm... I'm on Unity 2022.2.0a17.2573. This code not working. searchResult.height is always 0.0 and targetSurface.FindWaterSurfaceHeight() returns false every time.
     
  46. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    766
    By any chance did you enable the CPU simulation on the HDRP asset and on your water surface script ?

    upload_2022-6-27_11-8-6.png

    upload_2022-6-27_11-8-26.png
     
  47. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    is this a built in tools or custom tools?
    wait, hol up is that even the same water system
     
  48. PaulMDev

    PaulMDev

    Joined:
    Feb 19, 2019
    Posts:
    72
    I think it's a preview of what's next for this tool.
    I might be wrong though...
     
  49. jiraphatK

    jiraphatK

    Joined:
    Sep 29, 2018
    Posts:
    300
    The owner of the video is auzaiffe So I assume it's this water system.
     
  50. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    oh that's his channel, i see. Alright then that was the missing information that i'm looking for. Thanks