Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    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:
    134
    upload_2023-9-29_21-30-26.png

    Still waiting for more advanced shore waves approach :)
    EDIT: Seriously, you guys always put smile on my face, absolute legends
     
    Last edited: Sep 29, 2023
    chap-unity likes this.
  2. JaimeShirazi

    JaimeShirazi

    Joined:
    Jan 12, 2019
    Posts:
    5
    Would it be possible to add some sort of dropdown to allow you to choose the type of Time that the simulation uses? I found the following method in the WaterSimulationResources class which seems to be responsible for this:

    Code (CSharp):
    1. // Function that computes the delta time for the frame
    2. public void Update(float timeMultiplier)
    3. {
    4.     float totalTime = Time.realtimeSinceStartup;
    5.     float delta = totalTime - m_Time;
    6.     m_Time = totalTime;
    7.  
    8.     #if UNITY_EDITOR
    9.     if (EditorApplication.isPaused)
    10.         delta = 0.0f;
    11.     #endif
    12.  
    13.     deltaTime = delta * timeMultiplier;
    14.     simulationTime += deltaTime;
    15. }
    and here:

    Code (CSharp):
    1. // Function that allocates the resources and keep track of the resolution and number of bands
    2. public void InitializeSimulationResources(int simulationRes, int nbBands)
    3. {
    4.     // Keep track of the values that constraint the texture allocation.
    5.     simulationResolution = simulationRes;
    6.     maxNumBands = nbBands;
    7.     m_Time = Time.realtimeSinceStartup;
    8. }
    It'd be great if you could choose to use a different Time scale for the water simulation. It might seem useless for games, but when I try to record a scene using the Unity Recorder and the target framerate is higher than the actual framerate, the water begins to clearly skip and speed way up in the resultant file, which makes this water essentially useless for any sort of film application not running at realtime. Seems to be a really simple fix anyways, so it would be great if it could be dealt with at some point.
     
    chap-unity likes this.
  3. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    244
    Hum thanks for reporting, the time for recorder what fixed at some point but apparently it broke again
     
    JaimeShirazi likes this.
  4. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    749
    Indeed, thanks for the report, I managed to repro and logged something. You can follow it here!
    Cheers
     
    JaimeShirazi likes this.
  5. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    513
    Whats the best way to LOD and Cull these water assets in a scene during game play?
     
  6. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    749
    On procedural type (like infinite ocean or instanced quads) there's already multiple LODs happening so you don't really have to worry about it.

    However, if you use custom mesh, if your mesh is really dense and pretty large, for culling, the best way to do it would be to split your mesh into multiple. This is exactly why the custom type takes an array and not a single mesh renderer, so that the engine can properly do the culling in this scenario.
    And, we don't have a LOD system for custom mesh.
     
  7. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    513
    Ok here is the test for Lodding which does not seem to LOD anything ?

    Setup using Pool and Instanced Quad


    Pool game object deactivated = 902 Tris
    upload_2023-10-2_17-0-11.png

    Pool game object activated = 164.7K Tris

    upload_2023-10-2_17-0-59.png

    Camera moved to medium distance away from pool Tris = 164.6K

    upload_2023-10-2_17-2-44.png

    Using
    HDRP 15.0.6 and Unity Editor 2023.1.15f


    Camera moved far distance away from pool Tris = 164.5K

    upload_2023-10-2_17-3-36.png
     

    Attached Files:

    Last edited: Oct 2, 2023
    soleron likes this.
  8. U2

    U2

    Joined:
    Aug 12, 2008
    Posts:
    216
    Hello,

    Wondering if I am doing something wrong.. when editing the water asset for my scene, shoreline, edit mode and add waves it looks great in the development view.. I hit save on that and on the scene but when I go into run the waves disappear. Any thoughts?
     
  9. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    749
    So it does something, it's just that (and I'm guessing here) since water is specific, the tris are not properly counted in the stats window, I'll investigate on that. However, if you switch your scene view to wireframe (shaded wireframe is not supported for water), you can clearly see it LOD-ing :)

    EDIT: yes, Unity does not take into account the proper realtime tri/vert count here, so it's expected :)

    6cbf8644d880f2f60389428bed5a598a.gif
     
    Last edited: Oct 3, 2023
    GXMark likes this.
  10. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    513
    Thanks for looking into it yes i can see its just the stats window not updating.
     
    chap-unity likes this.
  11. m4robb

    m4robb

    Joined:
    Aug 2, 2017
    Posts:
    38
    sorry for the delayed response here, but finally got around to updating the project to 2023.1.16f, and the issue of the water not rendering correctly in Single Pass Instanced is still happening. i.e. the stereo imaging is messed up in that mode. When I switch to multipass, it works great, but then there is the performance hit. Is there some other tweak I'm missing? or did the fix not pass down into 2023.1.16. I thought I saw that it would be available in 2023.1.9 or some such version
     
  12. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,092
    I've created presets for MicroVerse using Unity's Water and other features:


    It's working quite nicely. What I'd recommend though:

    * default shadow distance of 500 is much too low for terrain
    * cloud layer is visually superior to volumetric clouds
    * needs automatic shoreline placement as mentioned earlier
    * distant fog should be active by default
    * light anchor should be moved to built-in as well
    * water should have 1-click setup (hdrp configs etc)
     
    soleron likes this.
  13. zevonbiebelbrott

    zevonbiebelbrott

    Joined:
    Feb 14, 2021
    Posts:
    118
    It seems at the moment its only made for a single island in case of swell attenuation(water mask)? Any chance we could get a better version of this feature?
    I am working on a large open world ocean with dozens of small islands that all need a custom water mask, however only solution I can see at the moment is one extremely huge texture that covers the entire ocean and has all the separate islands in it at the right scale/position on that mask relative to the real ocean surface... I dont think the resolution is high enough though as my ocean is about 100km squared at the moment...
     
    chap-unity likes this.
  14. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    749
    We are aware of this limitation and there's indeed a solution (on paper for now) for this specific kind of setup involving some sort of vertex water decals instead of having to use one large texture.
    We can't promise anything in terms of release date but we also really want to jump on this on our side as it would simplify some workflows. :)
     
    zevonbiebelbrott likes this.
  15. zevonbiebelbrott

    zevonbiebelbrott

    Joined:
    Feb 14, 2021
    Posts:
    118
    Thanks for the quick reply! Looking forward to the updates now ;D
     
    chap-unity likes this.
  16. Jack_Martison

    Jack_Martison

    Joined:
    Jun 24, 2018
    Posts:
    134
    While this is true (2d clouds will always look better than volumetric), but I think devs put slightly different intention into cloud layer.

    After a little photoshop magic you can actually complement to volumetric clouds:
    Screenshot_46.png
    Screenshot_47.png
    Screenshot_48.png
    Screenshot_61.png
     
    sqallpl and zevonbiebelbrott like this.
  17. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,092
    Using Photoshop is not an option. Visually combined with the water system the volumetric clouds look ugly. Quite noticably ugly is your night shot in which the clouds are very visible and the moon (or sun?) is in front of the clouds. The other 3 look awesome.

    Like with everything else Unity seems to focus on new features rather than making the base robust and acceptable. There's still no single button that can activate all that's needed for the water system, ie activate the feature as such.
     
    soleron likes this.
  18. Jack_Martison

    Jack_Martison

    Joined:
    Jun 24, 2018
    Posts:
    134
    I think it's a matter of settings and custom options to get it right, I honestly can't go back to 3rd party cloud solutions after seeing HDRP clouds, something like Expanse can out beat in visuals, but just a reminder that built-in clouds eats about 0.1ms maybe even less.
    Screenshot_4.png
    Screenshot_6.png
    This satisfies more than enough my needs, I guess Pierre created much more mesmerizing clouds with a lot of custom post-process things

    The only thing I care about new water system is huge lackluster, when it comes to shore waves and waves in general, not only it lacks FFT sinewave adjustment (I really would like to make ocean goes up and down to make actual simulation of large-medium waves) but also shore waves that could be accompanied by it. I'm really eager to see something on par with Fluxy asset for Unreal, it's not only plays around particles, but also creates automatic dynamic wetness with the most believable waves (probably ever created)
     
    Last edited: Oct 20, 2023
    milox777 and chap-unity like this.
  19. zevonbiebelbrott

    zevonbiebelbrott

    Joined:
    Feb 14, 2021
    Posts:
    118
    I disagree, if you want a fluid sim it will eat up your whole cpu. I think most developers just want a fast shader based ocean system, although I do agree that medium-large waves is a missing feature at the moment...
    However I am quite pleased with their water current system, I dont think there is another shader based ocean out there that has underwater currents which push/move objects that float on the surface.
     
    chap-unity likes this.
  20. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,092
    @chap-unity Is there a specific reason why you guys don't just activate everything that's needed via the click of a button? Currently there's only an option to open the hdrp settings and scroll to the option. I've checked, it should be doable via code, ie 1 click solution should be possible.
     
  21. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    244
    We prefer to show where the settings are instead of auto enabling everything, as most settings usually come with a performance cost.
    On the other hand i am extending the help box to also detect missing framesettings and volume overrides as right now there is no feedback when those are off
     
    PaulMDev and chap-unity like this.
  22. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,092
    Of course, but that's the "advanced" solution. A simple one(-click) is missing. For everything there is.

    That or Unity should fix the preferences dialog so that things are searchable and give proper results. But that's a general issue, not only water related.
     
    soleron likes this.
  23. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    749
    The second part of the why is also about users learning, we retain more information about where things are and where to enable them if we open the dialog, hightlight it and users have to click it rather than a "fix" button that silently enables everything.

    As for this, I completely agree, this has been "broken" for ages and isn't really helpfull at all, but that's unrelated and out of "our control" in HDRP sadly..
     
    PaulMDev likes this.
  24. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    591
    The ebooks have pretty much been the only way to "keep up" and educate over time i find.
    I see where you're all coming from for sure. Rowlan makes some fantastic quick solutions to things, but onboarding and education on the fine-tuning inner workings of things is really necessary too, especially in HDRP.

    The balance of speeding things up and educating is difficult.
    I do agree though, if there were better methods to educate and integrate system and pipeline settings ( including the ebooks <3) I think I'd have fewer customers and clients knowing less about it or "never heard of it" cause they have so many one-click solutions.

    The Tutorial Framework was great for that, but I guess re-allocations have stopped the focus.

    Back to water though.
    Are deformations being backported officially if not, is there enough there to backport it?

    I know there have been some heavy changes with the newer systems getting better integrated and I genuinely don't want projects stretched over many unity versions but i might be reaching some version locks soon maybe sooner than i would have liked.
     
    Rowlan likes this.
  25. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    749
    They are not, since 2022 LTS is out, the only thing we backport are bugfixes or minor stuff but no new features will be added on 2022 versions.
     
    HIBIKI_entertainment likes this.
  26. You gotta love it to be educated l'art pour l'art, just for the sake of it, so you can perform the same meaningless labor over and over until you get bored and either write a setup tool for yourself or buy one from the Asset Store. And you always know Unity should have written it at the first place, because they should view you as an adult who knows when and how needs to educate yourself about the _usually_ meaningless setup options which 99.99% of the time you set together.

    And after the third time you setup any of the solutions you are already sufficiently educated about the matter and you still need to continue to do the same meaningless labor over and over until the thing happen as above described.
     
    Rowlan likes this.
  27. mbach

    mbach

    Joined:
    Oct 25, 2018
    Posts:
    7
    Is there a way to exclude water from low-lying land areas? We are building a runtime generated planetary scale simulator and there are some land areas that are below sea level and we need to keep the water from appearing there. I have looked at the water excluder, but it is geometry based and what we have is a texture mask. Is there a way to use texture data to exclude the water?
     
  28. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    749
    Just put a deformer with a negative amplitude, that will push the water below the surface to prevent it appearing on the lowlands. You can either stack multiple procedural ones if you want to do it dirty, or use a proper texture if you have it.
     
  29. mbach

    mbach

    Joined:
    Oct 25, 2018
    Posts:
    7
    OK. Thanks. I will try that!
     
    chap-unity likes this.
  30. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    546

    Sorry to say that no, it is not expected. Unity should show correct real time tri-count for optimization debugging purposes. Not a good thing if it doesn't. We get misleading data and many people waste time chasing their tail because of that.
     
    nehvaleem likes this.
  31. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    546

    You are not thinking things properly.

    Most people do NOT want to learn how.
    That is what documentation is about.

    It should look great by default.
    You need something more? Check the help files or a tutorial.

    Imagine if people had to learn about how AI works in order to just type a prompt and get great results but get mediocre results until you do. THAT is why MidJourney is superior to all other similar tools.

    Designers and Artists want to use things effortlessly ang get an acceptable looking scene just by importing stuff in the engine that they can quickly present and get a positive feedback instead of the typical dialogue in every pitch of even the smallest feature.

    - "oh that looks like crap"
    - no worries we will make it look better later, now let's see how that feature works
    - "sure, but how will it look"
    - the meeting is to see how it works
    - "yeah, but how much better will it look?"
    and so on and so on.

    That is what UX is about. And when it comes to it, UX is really the weak point of almost EVERY new Unity feature that has been introduced in the last few years.

    One reason why many artists prefer Unreal is exactly because the default everything is very satisfactory. They do not need to learn anything in order to get a great look instantly.

    And that is something you will read again and again in every comparison between the two engines. At the same time, Unreal has far better and easier to understand terminology etc. when the time comes to head to the particular settings and make meaningful changes, not just to make things look aesthetically pleasing, which should be the default mode.

    Unity always gives a horrible first impression to people who are not familiar with the business. And these are usually the people who decide whether you will receive funding or not or will approve your newly designed feature or not.
     
  32. hugokostic

    hugokostic

    Joined:
    Sep 23, 2017
    Posts:
    72
    Calm down dude, the Water System is following the roadmap that is being builded,expose and discussed on each phase with the community, I guess you feel not proud to be part of this community as I am. If you look at it a little bit at the roadmap (past and actual) you can see that the debugging purpose is focusing on displaying efficiently buffer that are inside the watersystem, as far as I know, the triangle count debugger is not part of the hdrp content itself, so it may involve work with Unity native content. (btw, 0 advanced user won't care about such a detail now).

    I am less convinced than you are, about what you said, especially about Unreal way to deal with content and update exposure, because I know by experience that if you need a cool water system on UE, you will go to buy an ocean/water asset or pay a 75k/year technical artist to do the same stuff on UE that the water system will expose to your team for free on Unity.
    Adding the fact that the overall UX experience for advanced users, let's say, on a whole project that need to be shipped asap, is far more worth in Unreal than in Unity, just my point of view. Unreal is not modular and exposed the way Unity is, you should respect that, and you don't need million of dollars to handle a game production using Unity btw, just some talent.
    Plus I don't think I would let an artist (in an active production) especially if I know that he don't bother the "technical stuff" that concern a technical things such an Ocean system which is not just " a good looking things" : it need to be maniable, it need to be discussed, that the way matured and clever content come out to public.
     
    chap-unity likes this.
  33. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    749
    This is not really the place for this high level discussion about what UX is and isn't.
    We know our system is not perfect of course. (no system is)
    Every decision we make involves weighing the pros and cons of the changes. And it's never a black & white thing where thing is just better or worse, everything is always gray.
    We just try to maximize users happiness in general but that doesn't always mean making everyone happy.
    So thanks for the feedback and I can assure you it's been taken into account for future decisions, this is why we are here.
     
  34. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    546
    is that your attempt to cancel what I said? It is a very basic common technique.
    You claim the other person is unstable thus they do not know what they are talking about.

    Same as the way you continued. projecting your vague "experience".
    Each and every paragraph was basic discrediting technique material out of a book. :p and zero actual argument against what I said. Which in a way is good. Because you had nothing to say other than things to try make me appear saying nonsense.

    Especially this made no sense at all.

    What is it that you don't think you would let an artist?
     
  35. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    546
    Nobody asked what it is.

    I am simply saying almost all the new features introduced to Unity have really bad UX. And then everything comes as a ridiculous extra step afterthought.

    Best example of it?

    This:
    upload_2023-11-2_18-10-14.png

    All these should be checked and fixed automatically by Unity when we switch to HDRP, or enable Raytrace etc. Without the user even seeing it. Unless there was an error.

    The fact that after so many versions we still need to click a button to make sure everything is correct is hilarious and one of the best examples of how UX being an afterthought really looks like.

    And it makes sense why this happens, because obviously most of these new features were put together by engineers, with little understanding about User Centered Design and UX and evidently mostly supervised by inexperienced Product Managers because no experienced PM (or PO) would sign off a feature like that for a final release.
     
  36. hugokostic

    hugokostic

    Joined:
    Sep 23, 2017
    Posts:
    72
    I wouldn't let it* to an artist (implement water, you know, as a mission) sorry I misstyped, if he don't get how water system (or hdrp setup) work, why would I let him do that? they can still change the color in one click on the water anyway when it's done, place foam and deformer is very easy too
    I don't try to cancel what you said, it's said, I just disagree with a lot of what you said, no drama
     
    Last edited: Nov 2, 2023
  37. hugokostic

    hugokostic

    Joined:
    Sep 23, 2017
    Posts:
    72
    I have backported the Rain Droplet feature from hdrp 17 to hdrp 15 (2023.1)
    I am lucky it's working without issue so I can use it, there is a meteo system that trigger rain in my game, and my previous shader to create rain droplet was not as great as this one, great work Water team.
    Droplet.gif

    I have joined the backported Rain shader graph for unity 2023.1, I made few modification to make it a subgraph, It was more easy to use on other elements like rocks, terrain, etc

    RainDropShaderFeature.png

    RainSubGraph.png

    And the result on the terrain using same implementation (custom terrain shader) when it's raining :

    TerrainDroplet.gif

    I like this shader effect, I think it could be part of hdrp base samples too, as there is some puddles decal already, it could make a great combo with that stuff I guess. And the customRT as this is a clever exemple, easy to use on many object, not only for water.
     

    Attached Files:

  38. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,092
    I just took a look at rivers. What's the purpose of this concept:

    concept.jpg
    I'd have expected this to be done procedurally. Is everyone supposed to place those manually?

    Like with the waves?

    waves.jpg
     
  39. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    749
    Hey :)

    Our goal for 2022 LTS was to be able to have a nice water simulation, being able to change its appearance and making sure it was working on all supported platforms at a relatively low cost.

    In 2023, we focused mainly on trying to address more specific use cases (Rivers, Deformations, Currents, Foam, Underwater, More performance, transparency improvements.. etc), basically giving users the tools and possibility to do what they want and being able to customize the system even more.

    Now, I can't promise anything since we are still currently on the 2023 version, but our current objective for the future is to try and improve artistic workflows since it's usually the main feedbacks we get here (like your). One example would be to be able to automatically place waves on a island ( basically what you said), be able to have more procedural deformation / foam / attenuation or even being able to "paint" the current from a river without having to leave the editor, just to name a few.

    So yeah, I can't predict the future but we are well aware that this is what we need to focus on when planning for the next steps :).

    Cheers !
     
    PaulMDev, shikhrr and Wattosan like this.
  40. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,092
    Thank you, but my question was more acout the concept. With the current state I could just spawn eg the waves around a spline easily. However other solutions have a workflow that I pretty much prefer, especially for rivers which can become very long. The placement of the water system wouldn't be something I'd use, not even automated.

    Take eg Kripto's Water System. He uses a flow map. Currently you have to paint it yourself, but I guess the creation will be automated at some point.

    ty.jpg
    It really gives nice results. But that also makes Unity's placement of Decals and Deformers look rather outdated. Especially since it's new and not even in a release state.

    Is there a benefit to that approach?

    Just sharing my use case, at least the one I'd expect.
     
  41. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    749
    In the latest 2023, you are able to use a flow map to create a current and spawn foam generators (from a texture or even procedural using SG) that will follow the flow of the current you just defined with the flow map.

    The use of decals in this project is just to be able to have more flexibility as an artist basically.

    That's the same with waves, you can use the shore wave deformer and place multiple or use a procedural deformation and make your own wave system depending on your needs and skills.

    There's just mutiple ways to do things, you can use use the Shader graph to inject foam procedurally as well for example.
     
    Rowlan likes this.
  42. NollathTheWeary

    NollathTheWeary

    Joined:
    Sep 27, 2023
    Posts:
    20
    Is it possible to set the water surface to render on both sides without turning on underwater?
     
  43. edvart-ros

    edvart-ros

    Joined:
    Aug 15, 2023
    Posts:
    12
    Hey! First time Unity user making a surface vessel simulator for robotics purposes using the new water system. Is there anyway to query the water/wave velocity at a point? Similar to how you can look up the water height at a point? This is important for a realistic vessel response
     
  44. NollathTheWeary

    NollathTheWeary

    Joined:
    Sep 27, 2023
    Posts:
    20
  45. edvart-ros

    edvart-ros

    Joined:
    Aug 15, 2023
    Posts:
    12
  46. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    749
    Indeed you cannot directly find velocity.

    But the API in 2023 versions allows you to query the direction of the current itselt so since water current has a uniform speed, it's just about multiplying this direction by a value.
    Then for actual water movement you can easily sample 3 points and find the actual normal of the surface and then by projecting this normal on a flat plane, you can actually have a sense of how "perturbated" the water plane is and in which direction.
    All of this multiplied by the amplitude of the wave, you should be able to get a sense of the water velocity or at least a sense of where it's going and how fast it's going there.

    This is basically what we use in the pool & glacier scene in the HDRP Package Manager water samples. (in latest 2023)
     
  47. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    749
    Sadly, no :)
     
  48. Jack_Martison

    Jack_Martison

    Joined:
    Jun 24, 2018
    Posts:
    134
    After researching Unreal for quite a bit of time and my humble experience with Unity, I disagree. After Unreal bloatness with tabs under the tabs and menus under the menus, I never appreciated Unity UI design that much.

    Yes, you have to fiddle with tiny things but it's exactly the same in Unreal, and yes Unreal offers more out box, but just a reminder that HDRP is very early engine pipeline (It's only 5 years old), compared to other huge and solid engines.

    Some things are not so intuitive, like checking water system in project settings first, and then checking it in volume, but it's trying to be consistent with other previous features. Like someone said before, if user wouldn't fiddle with various checks and setting, he will never learn where to find stuff. Auto search and sending to project setting is good, one click to fix is not.

    Here's my own example with diffusion profile, I've been fiddling with vegetation for ages and I'm still to this day struggle to find damn diff profiles deep in the project setting, because all this time button "fix" existed.
     
    PaulMDev and chap-unity like this.
  49. NollathTheWeary

    NollathTheWeary

    Joined:
    Sep 27, 2023
    Posts:
    20
    @soleron - I have recently tried Unity vs Unreal in terms of UX as someone who has next to no experience with both engines. They both are almost equally bad for people although I would say Unreal is worse. And this is only because Unity sticks closer to conventional 3D-Software in terms of interaction. For example: dropping a simple 3D file into Unity and doing something with is possible without any help if you understand what a CAD-Software is. In Unreal it wasn't without having to learn some important things about the engine. You gotta let the user understand they are peeling away at an onion with many complex layers. The transition from ShaderGraph to VFX-Graph is a bugger.



    @chap-unity - It is possible without custom scripting ⚗️. The water system is really nice. Hopefully there will be more customization options and maybe even access to the simulation via ShaderGraph for other FX applications.
     
  50. SomerenV

    SomerenV

    Joined:
    Dec 20, 2011
    Posts:
    83
    I've been fiddling with the HDRP Water System and have upgraded to 2023.3.0a14 to try out the new features. What I can't get figured out is how to use the new buoyancy-system with a ship. Right now I'm using 6 floaters (3 on each side of the ship) containing the following code:

    Code (CSharp):
    1.     private void FixedUpdate()
    2.     {
    3.         rb.AddForceAtPosition(Physics.gravity / floaters, transform.position, ForceMode.Acceleration);
    4.  
    5.         Search.startPositionWS = transform.position;
    6.         Search.includeDeformation = includeDeformation;
    7.         Search.excludeSimulation = false;
    8.  
    9.         water.ProjectPointOnWaterSurface(Search, out SearchResult);
    10.  
    11.         if(transform.position.y < SearchResult.projectedPositionWS.y)
    12.         {
    13.             float displacementMulti = Mathf.Clamp01(SearchResult.projectedPositionWS.y - transform.position.y / depthBefSub) * displacementAmt;
    14.             rb.AddForceAtPosition(new Vector3(0f, Mathf.Abs(Physics.gravity.y) * displacementMulti, 0f), transform.position, ForceMode.Acceleration);
    15.             rb.AddForce(displacementMulti * -rb.velocity * waterDrag * Time.fixedDeltaTime, ForceMode.VelocityChange);
    16.             rb.AddTorque(displacementMulti * -rb.angularVelocity * waterAngularDrag * Time.fixedDeltaTime, ForceMode.VelocityChange);
    17.         }
    18.     }
    It works alright but something always feels a bit off. The new buoyancy works a bit more realistic, but no idea how to apply it to a ship. Adding it to the ship makes it flip over. Adding it like I'm doing with the floaters makes it go completely crazy.

    Any pointers to get buoyancy working as it should?