Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. 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. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Ah maybe they change the API? i'm not sure though.
    maybe @auzaiffe can splash some clue
     
    Deleted User likes this.
  2. Deleted User

    Deleted User

    Guest

    @Reanimate_L Finally I made it work pretty well! The buoyancy efect takes fancy, even it works for ragdolls, just mind how awesome it would be. Im so grateful, actually you helped me. I can share the code with you all later if you like, im currently on mobile.
     
  3. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Please do if you can, just post it here. it could help everyone else in future.
     
    Deleted User likes this.
  4. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    760
    Yes and no, The "material" exposed in the Water Surface script, is a Shader Graph that can be duplicated from HDRP Package (com.unity.render-pipelines.high-definition\Runtime\RenderPipelineResources\ShaderGraph).

    After that what you can do is modify this graph and expose a bunch of properties that will basically override the one defined in appearance. However, the graph is not really easy to modifiy and is only for advanced users.

    Yep, now the documentation comes with the release so the 2022.2 doc is going to be out soon and for now there's no documentation for the alpha / beta part of 2023.1 now. To be honest, I don't like this either, I would rather have a bad documentation for alpha / beta than no doc at all, but all we can do for now and try to help / support alpha, beta users on the forums with the best of our knowledge ! :)
     
    Last edited: Nov 7, 2022
    shikhrr, fess1024 and TJHeuvel-net like this.
  5. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    760
    Also here's the simple buoyancy examples that will end up in documentation as well (once it's up). There's one per version and one using burst for better perf when having multiple objects to float.
    And indeed the API changed in 2023.1 so this is why the 2022.2 scripts won't compile.
    The change is instead of getting just the height (FindWaterSurfaceHeight) in 2022.2 we now get the full Vector3 (ProjectPointOnWaterSurface) since now we can have water surface that have a rotation (not horizontal).

    And don't forget to enable Script Interactions in HDRP Asset and on your water surface for it to work :p
     

    Attached Files:

  6. TheCelt

    TheCelt

    Joined:
    Feb 27, 2013
    Posts:
    741
    Judging by the simulation being powers of 2, I am assuming this is an FFT implementation.. is this why you feel it won't be fit for URP ? Because this can easily run on mobile - mine does at 512 resolution quite easily.

    I hope we do see this stuff in URP even if the visual aspects are obviously toned down within the limitations of URP but the simulation itself should not be a concern (can always use job system for FFT on mobile where absolutely necessary).

    Not sure why this is strictly HDRP when its only some of the visual effects that really limit it to HDRP but most of it can easily be done in URP too.
     
    ebaender and bdb400 like this.
  7. ManKarate

    ManKarate

    Joined:
    Dec 10, 2018
    Posts:
    1
    Where can I find more information on getting the volumetric clouds and water to work? When I simply try to set up both the water renders over the clouds.
    WaterCutsIntoClouds.PNG
     
    Jesus likes this.
  8. nyancathulu

    nyancathulu

    Joined:
    Aug 22, 2022
    Posts:
    2
    its been 7 years since this comment but I also have this problem, how do i fix this?
     
  9. nyancathulu

    nyancathulu

    Joined:
    Aug 22, 2022
    Posts:
    2
    lmao not 7 years ignore that bit
     
  10. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    760
    It has been properly implemented starting 2023.1.0a17.
    Before that it's just not supported.
     
    ashtorak likes this.
  11. ep1s0de

    ep1s0de

    Joined:
    Dec 24, 2015
    Posts:
    168
    How to control wave generation using seed? In my multiplayer project, floating bodies take a point of water from FindWaterSurfaceHeight, but since the server has its own wave and the clients have their own, then there is a noticeable desynchronization of the object, and with an increase in lags or losses, the objects are very noticeably twitching.

    I would like to be able to synchronize the waves using seed
     
  12. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
    Is there a way to install the water by using "Add package from a GIT URL..." with HDRP LTS (2021.3.15f1)? Or is there another way to install it to test it out? Thanks!
     
    Last edited: Dec 15, 2022
  13. Jack_Martison

    Jack_Martison

    Joined:
    Jun 24, 2018
    Posts:
    142
    I want to say that water deformers are simply amazing, shore wave is something lacks most popular assets.
    My few cents to improve it further:
    Ability to spawn it around terrain surface - placing it manually is gonna be a headache, especially for bigger scenarios
    Ability to edit box in 3d view - selfexplanatory, just like reflection probes
    Ability to bend it, I guess, this is pretty important since not all beaches are created in straight line

    Make area of shore waves affect main frequencies - when wind setting is pretty high it's hard to fit shore wave to tip of the surface, in other words ocean waves should be calmer where shorewave ends
    Last thing i'm not sure, but maybe somehow contact to terrain surface? So foam could be transfered to surface.
     
    chap-unity likes this.
  14. Jack_Martison

    Jack_Martison

    Joined:
    Jun 24, 2018
    Posts:
    142
    upload_2022-12-16_4-16-10.png
    so yeah there's should be smooth transition, at least shorewaves should affect main frequency of ocean
     
    chap-unity likes this.
  15. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    760
    Great point !
    Recently, a fix has been done to make sure the water was deterministic (for cut scenes etc..) but you are right that currently there's no way to make sure the simulationTime is the same when multiple users are connected.
    If we manage to sync this time at the begining, since water is deteministic, it should show the same simulation on every client.

    I logged something and an API is probably going to be added to take care of this for 23.1.
    You can follow the status here (give the link a few hours if down)
     
    hkalterkait and ep1s0de like this.
  16. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    760
    Thanks for the feedbacks! Here's some answers:
    • A solution involving a Signed Distance Function would be best for the terrain scenarios you are mentionning, it's currently evaluted for 23.2. (This will be helpfull for the foam as well in your last point)
    • 3D box edition is already done and should land in a few weeks.
    • For the bending part, I like the idea and I agree that it's lacking. What's possible is just authoring a texture with the shape you need and using texture deformers instead. We'll see if we can provide a more streamlined solution.
    • For the calmer waves near the shore the current solution is to use a WaterMask. I agree this would be better to do it depending on the water depth, but right now, there's no simple cost effective way to know this depth.
    Lastly, some samples are currently being done to show how everything is supposed to be used. We'll keep you posted.
     
  17. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    760
    No, Water surface is only available starting 2022.2
     
  18. NilsLeijdekker

    NilsLeijdekker

    Joined:
    Dec 19, 2018
    Posts:
    10
    Hi, I've been following this forum for a while but haven't seen any mention of when the water physics feature will be out. So do you guys have an idea of when that might be out?
     
  19. ep1s0de

    ep1s0de

    Joined:
    Dec 24, 2015
    Posts:
    168
    I think you'll figure it out

    call BuoyancyUpdate

    Code (CSharp):
    1.  
    2. using System;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5.  
    6. public partial class PhysicsEntity : NetworkEntity
    7. {
    8.    
    9.     #if UNITY_EDITOR
    10.     void OnValidate()
    11.     {
    12.         if (!Application.isPlaying)
    13.         {
    14.             SetupBuoyancy();
    15.         }
    16.     }
    17.     #endif
    18.    
    19.     [Header("Volume m^3")]
    20.     public float Volume = 0;
    21.  
    22.     public enum DensityTable : ushort
    23.     {
    24.         Rubber_1000 = 1000,
    25.         Wood_750 = 750,
    26.         Concrete_2050 = 2050,
    27.         Brick_1750 = 1750,
    28.         FerrousMetal_7500 = 7500,
    29.         NonFerrousMetal_5500 = 5500,
    30.         Custom
    31.     }
    32.  
    33.     [Header("Density kg/m^3")]
    34.     public DensityTable Density = DensityTable.Wood_750;
    35.     [Range(10,30000)]
    36.     public float CustomDensity = 900;
    37.  
    38.  
    39.     [Serializable]
    40.     public struct BuoyancyVolume
    41.     {
    42.         public const int SECTORS = 3;
    43.         public List<Vector3> BoundPoints;
    44.         public float HalfVolume;
    45.     }
    46.  
    47.     public BuoyancyVolume BuoyancyVolumeInfo = new BuoyancyVolume();
    48.  
    49.     [Flags]
    50.     public enum DebugFlags
    51.     {
    52.         None = 0,
    53.         WaterLevel = 1 << 0,
    54.         CenterOfMass = 1 << 2,
    55.         BoundPoints = 1 << 3,
    56.         DrawForce = 1 << 4
    57.     }
    58.  
    59.     public DebugFlags Flags = DebugFlags.None;
    60.  
    61.     private void BuildBoundPoints()
    62.     {
    63.         BuoyancyVolumeInfo.BoundPoints.Clear();
    64.  
    65.         for (int ix = 0; ix < BuoyancyVolume.SECTORS; ix++)
    66.         {
    67.             for (int iy = 0; iy < BuoyancyVolume.SECTORS; iy++)
    68.             {
    69.                 for (int iz = 0; iz < BuoyancyVolume.SECTORS; iz++)
    70.                 {
    71.                     float x = Collider.bounds.min.x + Collider.bounds.size.x / BuoyancyVolume.SECTORS * (0.5f + ix);
    72.                     float y = Collider.bounds.min.y + Collider.bounds.size.y / BuoyancyVolume.SECTORS * (0.5f + iy);
    73.                     float z = Collider.bounds.min.z + Collider.bounds.size.z / BuoyancyVolume.SECTORS * (0.5f + iz);
    74.  
    75.                     var p = transform.InverseTransformPoint(new Vector3(x, y, z));
    76.  
    77.                     BuoyancyVolumeInfo.BoundPoints.Add(p);
    78.                 }
    79.             }
    80.         }
    81.     }
    82.  
    83.     private void SetupBuoyancy()
    84.     {
    85.         BuildBoundPoints();
    86.  
    87.         void FindClosestPoints(IList<Vector3> list, out int firstIndex, out int secondIndex)
    88.         {
    89.             float minDistance = float.MaxValue, maxDistance = float.MinValue;
    90.             firstIndex = 0;
    91.             secondIndex = 1;
    92.  
    93.             for (int i = 0; i < list.Count - 1; i++)
    94.             {
    95.                 for (int j = i + 1; j < list.Count; j++)
    96.                 {
    97.                     float distance = Vector3.Distance(list[i], list[j]);
    98.                     if (distance < minDistance)
    99.                     {
    100.                         minDistance = distance;
    101.                         firstIndex = i;
    102.                         secondIndex = j;
    103.                     }
    104.                     if (distance > maxDistance)
    105.                     {
    106.                         maxDistance = distance;
    107.                     }
    108.                 }
    109.             }
    110.         }
    111.  
    112.         void WeldPoints(IList<Vector3> list, int targetCount)
    113.         {
    114.             if (list.Count <= 2 || targetCount < 2)
    115.             {
    116.                 return;
    117.             }
    118.  
    119.             while (list.Count > targetCount)
    120.             {
    121.                 int first, second;
    122.                 FindClosestPoints(list, out first, out second);
    123.  
    124.                 var mixed = (list[first] + list[second]) * 0.5f;
    125.                 list.RemoveAt(second); // the second index is always greater that the first => removing the second item first
    126.                 list.RemoveAt(first);
    127.                 list.Add(mixed);
    128.             }
    129.         }
    130.  
    131.         WeldPoints(BuoyancyVolumeInfo.BoundPoints, 16);
    132.  
    133.         if (Collider.bounds.size.x < Collider.bounds.size.y)
    134.         {
    135.             BuoyancyVolumeInfo.HalfVolume = Collider.bounds.size.x;
    136.         }
    137.         else
    138.         {
    139.             BuoyancyVolumeInfo.HalfVolume = Collider.bounds.size.y;
    140.         }
    141.         if (Collider.bounds.size.z < BuoyancyVolumeInfo.HalfVolume)
    142.         {
    143.             BuoyancyVolumeInfo.HalfVolume = Collider.bounds.size.z;
    144.         }
    145.         BuoyancyVolumeInfo.HalfVolume /= 2 * BuoyancyVolume.SECTORS;
    146.     }
    147.  
    148.     public void BuoyancyUpdate(float waterLevel)
    149.     {
    150.         Volume = Rigidbody.mass / (Density == DensityTable.Custom ? CustomDensity : (float)Density);
    151.  
    152.         float archimedesForceMagnitude = 1000 * Mathf.Abs(Physics.gravity.y) * Volume;
    153.         var archForce = new Vector3(0, archimedesForceMagnitude, 0) / BuoyancyVolumeInfo.BoundPoints.Count;
    154.  
    155.         if (Flags.HasFlag(DebugFlags.WaterLevel))
    156.         {
    157.             DebugEx.DrawCircle(new Vector3(transform.position.x, waterLevel, transform.position.z), 0.15f, Color.red);
    158.         }
    159.  
    160.         if (Flags.HasFlag(DebugFlags.CenterOfMass))
    161.         {
    162.             DebugEx.DrawWireSphere(Rigidbody.worldCenterOfMass * transform.localScale.sqrMagnitude, 0.3f, Color.white);
    163.         }
    164.  
    165.         for(int i = 0; i < BuoyancyVolumeInfo.BoundPoints.Count; i++)
    166.         {
    167.             var wp = transform.TransformPoint(BuoyancyVolumeInfo.BoundPoints[i]);
    168.             float d = waterLevel - wp.y;
    169.  
    170.             if (Flags.HasFlag(DebugFlags.BoundPoints))
    171.             {
    172.                 DebugEx.DrawCross(wp, 0.1f, d < 0 ? Color.cyan : Color.red);
    173.             }
    174.  
    175.  
    176.             if (wp.y - BuoyancyVolumeInfo.HalfVolume < waterLevel)
    177.             {
    178.                 float k = (waterLevel - wp.y) / (2 * BuoyancyVolumeInfo.HalfVolume) + 0.5f;
    179.                 if (k > 1)
    180.                 {
    181.                     k = 1f;
    182.                 }
    183.                 else if (k < 0)
    184.                 {
    185.                     k = 0f;
    186.                 }
    187.  
    188.                 var velocity = Rigidbody.GetPointVelocity(wp);
    189.                 var localDampingForce = -velocity * 0.1f * Rigidbody.mass;
    190.                 var force = localDampingForce + Mathf.Sqrt(k) * archForce;
    191.                 Rigidbody.AddForceAtPosition(force, wp, ForceMode.Force);
    192.  
    193.                 if (Flags.HasFlag(DebugFlags.DrawForce))
    194.                 {
    195.                     Debug.DrawRay(wp, force / Rigidbody.mass, d < 0 ? Color.cyan : Color.red);
    196.                 }
    197.             }
    198.         }
    199.     }
    200. }
    201.  
    202.  
     
  20. NilsLeijdekker

    NilsLeijdekker

    Joined:
    Dec 19, 2018
    Posts:
    10
    How do I do that exactly?
    I'm assuming I just call the setup in start and the update in update?

    And how would I do that with Gameobjects because it says that Network Entity is not recognized?
     
    Last edited: Dec 20, 2022
  21. ep1s0de

    ep1s0de

    Joined:
    Dec 24, 2015
    Posts:
    168
    I won't explain anything, a knowledgeable person would have moved pieces of code into his script long ago
     
  22. NilsLeijdekker

    NilsLeijdekker

    Joined:
    Dec 19, 2018
    Posts:
    10
    Hi again, thank you ep1s0de for the code, it works great. The only issue I'm having is getting the water level. I tried using a ray cast but that only got a fixed point even though the water is moving up and down. So is there a better way of going about that maybe?
    Thanks in advance,
    Nils L.
     
    ep1s0de likes this.
  23. ep1s0de

    ep1s0de

    Joined:
    Dec 24, 2015
    Posts:
    168
    I'm glad that I helped, because water does not have a physical box (except BoxCollider), I do it through OnTriggerStay, which is called when updating physics. Getting a collider, I'm looking for my component where there is a buoyancy logic and using FindWaterSurfaceHeight I get a wave point

    Important! The water collider should be just above the maximum wave height


    Code (CSharp):
    1.  
    2.     private void OnTriggerStay(Collider other)
    3.     {
    4.         if (other.TryGetComponent(out PhysicsEntity entity))
    5.         {
    6.             searchParameters.startPosition = searchResult.candidateLocation;
    7.             searchParameters.targetPosition = entity.transform.position;
    8.             searchParameters.error = 0.01f;
    9.             searchParameters.maxIterations = 8;
    10.  
    11.             if (WaterSurface.FindWaterSurfaceHeight(searchParameters, out searchResult))
    12.             {
    13.                 entity.BuoyancyUpdate(searchResult.height);
    14.             }
    15.         }
    16.     }
     
  24. NilsLeijdekker

    NilsLeijdekker

    Joined:
    Dec 19, 2018
    Posts:
    10
    Thank you so much! It works great!
     
    ep1s0de likes this.
  25. NilsLeijdekker

    NilsLeijdekker

    Joined:
    Dec 19, 2018
    Posts:
    10
    Sorry but is there a way to do this in the 2023 alpha, because there they don't have a FindWaterSurfaceHeight function?
     
  26. imblue4d

    imblue4d

    Joined:
    May 27, 2016
    Posts:
    110
    Is this a bug? or am i missing something
    upload_2022-12-26_20-43-18.png

    Can't see the water no matter what, and in edit mode the stats indicates detection of geometry
    upload_2022-12-26_20-47-17.png
    upload_2022-12-26_20-48-18.png

    I made sure Water surface is enabled in HDRP High Fidelity Quality setting, and that it is the active one
    Tried creating new materials, making and checking in a build, and using DX12 but the problem still exists
    Using 2023.1.0a24, no error message
     
    Last edited: Dec 26, 2022
  27. NilsLeijdekker

    NilsLeijdekker

    Joined:
    Dec 19, 2018
    Posts:
    10
    Did you add the Water Rendering override to the volume object in your scene?
     
  28. imblue4d

    imblue4d

    Joined:
    May 27, 2016
    Posts:
    110
    Yes did that too
    upload_2022-12-26_22-30-50.png
     
  29. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    I recommend that someone of the UI department takes a look at the usability in general, not just this asset. But it's a good example of non-consistency:

    upload_2022-12-26_22-30-50.png

    First click is to activate the checkbox that activates the dropdown. Then you have to make another click to open the dropdown. And then you have to make a 3rd click to set it to "Enabled". And that while you have a checkbox for activation / deactivation of the entire script.
     
    OBiwer and soleron like this.
  30. Patrudoizero

    Patrudoizero

    Joined:
    Nov 30, 2018
    Posts:
    13
    It works great in game mode and editor, but not in build. Has anyone had this problem?
     
  31. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    760
    It's probably the frame settings.
    Go to your Project settings and see if water is enabled
    upload_2023-1-2_11-13-59.png
     
    hkalterkait likes this.
  32. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    760
    Yes, the API have changed in 2023 since now you can have a non horizontal water surface, you can check my post above with example on how to use the API depending on the version here.

    TL;DR
    • Function FindWaterSurfaceHeight has been replaced with ProjectPointOnWaterSurface
    • searchParameters variable startPosition is now startPositionWS
    • searchParameters variable targetPosition is now targetPositionWS
     
    NilsLeijdekker and hkalterkait like this.
  33. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    I believe some of you might've seen this, but in case for those who doesn't. This is a good underwater rendering effect, it's not on unity tho. And i hope at least the underwater effect target are similar to this
     
  34. imblue4d

    imblue4d

    Joined:
    May 27, 2016
    Posts:
    110
    Thanks this worked, i didn't expect there would be a third box to tick

    I mean i like this level of control, but shouldn't it be pre-ticked when we turn on water rendering on the hdrp asset?
     
    Last edited: Jan 2, 2023
    chap-unity likes this.
  35. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    760
    It shouldn't be pre-ticked because you turned on Water Rendering.
    But it should be pre-ticked by default (meaning frame settings should be opt-out for new features) and it will in the next version (a fix has been done very recently to address this for every new 2023.1 features, landed in 2023.1.0a25)
     
    Last edited: Jan 3, 2023
  36. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
    One question regarding this water system, and I guess Unity's general idea/goal with HDRP. I've been playing a bit with the Crest water asset in the built-in render pipeline in my first person project, and now I wanted to try a copy of my project in HDRP as well just to try and gauge the state of HDRP a bit.

    One thing I immediately noticed when using Crest was that looking up/out from the water looked really ugly with the default settings due to the realistic index of refraction for the water. You could only see out of tiny "window" directly above you, and everything around the "window" was black. I'm guessing it's black because you would need expensive reflection calculations to get proper reflections on the underside of the water surface so that it's physically correct? Luckily you can easily set the index of refraction to anything you want in Crest, and setting it to 1 makes everything just look a lot better, and due to it removing the limitation with the lack of underwater reflections and instead showing refractions it even makes it look more correct and realistic in my opinion.

    But even ignoring all of that I want the player to be able to see out of the water for gameplay purposes.

    Coming into HDRP I see the water has very few settings, and seemingly no settings that allow for physical incorrectness like changing the index of refraction of the water. Currently looking up/out from the water in HDRP looks extremely bad. I'm guessing this is mainly due to this being in development?

    But my question is this: Will there be an index of refraction setting for the water in HDRP or is the whole idea of HDRP to not allow for physically incorrect setups?

    If the goal/idea of HDRP goes against crafting the gameplay that I want, then maybe HDRP will never be right for me, and learning that sooner rather than later is probably beneficial in terms of me choosing the right render pipeline.
     
    chap-unity likes this.
  37. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    760
    Thanks for the detailled feedback, I completely agree and this is something that is currently being discussed internally.

    Currently, what we do is having a hardcoded IOR for water and when underwater only fallback on the color buffer, which given the refrative index, results in, as you said a tiny refracted window and a harsh fallback on scaterring color.
    This prevents players to have a direct look of what's in front of them. (cf COD MW2 underwater gameplay)

    Now, we are evaluating two things to add to water independently:
    • The ability to disable refraction underwater altogether (basically overriding the IOR to 1 for underwater scenario). It's very likely we will implement and add this.
    • The ability to fallback to Sky and/or Reflection Probe in addition of the color buffer when underwater. This will boil down to cost mostly but if it's fair, that will greatly help reducing the hard fallback on the scattering color a give a much smoother transition
     
    shikhrr, TwiiK and hkalterkait like this.
  38. Deleted User

    Deleted User

    Guest

    What are the plans for the water system in 2023? I know there is no plan for integration with the new spline system, but i think unity must start working on it for this year..
    It's would be very useful for creating rivers and manual foam lines! i think unity must give it a high priority this year
     
  39. JRW_WSP

    JRW_WSP

    Joined:
    Jun 26, 2017
    Posts:
    37
    Is anyone else getting "Can't find Height" error in the console when running the non-burst version of the example scripts? I can't seem to get them working either 2022 or 2023 but the burst versions are working fine.
     
  40. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    568
    As you probably heard in the video, the person speaking is a senior lighting artist at Ubisoft.

    The people who are making the water feature despite their good will and positive attitude and talent ,do not have this level of artistic experience and I assume; they are just programmers trying to make something according to mathematical equations based on physics that they believe should resemble real water. (Never does, that is why artistic approaches bring better results in visuals than physics approaches.)

    There is no sign that this water will be able to provide high quality artistic results, but it is better than nothing for people who do not have the budget for a dedicated graphics programming team and AAA production proven technical artists to create it for them.
     
  41. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    760
    Hey, I completely agree we need more things like that.
    I can't share a lot of details because nothing is set in stone yet, but part of the 2023.2 roadmap is focusing on having a set of tools to help artists setup things more easily and have a faster iterations time basically.
    So focusing on workflow in addition to the features I already talked about above.
     
    shikhrr likes this.
  42. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    I think I set the bar pretty high using MicroVerse for that, here's with Crest:


    I tried to do the same with the Unity Water, but I didn't get there. Do you think it's possible somehow the way I do it above with Crest? If so, got any pointers for me? Would love to support a Unity Ocean the same way. All I need is an Ocean prefab that I can drag in
     
    Last edited: Jan 11, 2023
  43. JRW_WSP

    JRW_WSP

    Joined:
    Jun 26, 2017
    Posts:
    37
    I can't seem to get any of the script interactions working in 2023.1.0a24. When stepping through the WaterSurface.cs script I can see that there are references to a variable named "simulation" which is always evaluating to null which is why none of my method calls are working. This is despite having script interaction enabled wherever I can. Is anyone else actually using any script interaction on this forum or are we all just talking about the graphical side of things?
     
  44. JRW_WSP

    JRW_WSP

    Joined:
    Jun 26, 2017
    Posts:
    37
    I'm guessing there's no way of submitting bug reports on an experimental feature but I've noticed that when capturing a 360 view using the Unity recorder that the water system speeds up or slows down based on the target FPS. So for me at 30 and 60 fps the water is much faster than it should be and it is only at a target frame rate of 15fps that it seems more along the lines of what I see normally in the game view. Capturing as non-360 appears correct.
     
    chap-unity likes this.
  45. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    760
    First of all, there's no such thing as water being in experimental. Our last version is just in its alpha phase :).
    And you can absolutely submit bug in this phase, this is exactly why we release stuff in the alpha phase!
    Now regarding your issue, as a matter of fact, something was logged this very morning about this. And it can be reproed even without the 360° capture.
    Here's the link of the issue to be able to follow when the fix is coming.

    As for you question on the script interactions, if you use the script referenced here, there shouldn't be any issue.
    You just have a to check Script interactions on your water surface and on the current HDRP asset.
    Then feed the component with the water surface you want to evaluate and it should work seamlessly.
     
  46. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    760
    You can just create a water surface and make it a prefab very easily.

    To add more detail, the idea is really to fix some of the workflow issues artists and devs are currently experiencing when authoring water surface in specific scenarios in their projects.
    You can already slap an ocean in a project in 2s, problem is more about creating belivable currents, waterMask, river that follows terrains, add foam where you want.. etc
     
  47. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    But the way to get there is a stony one. With a prefab I'd assume I drag it in and it all works. But to make the water system work you have to find settings in all kinds of various places in separate corners of Unity ;)

    Or in other words: Accessibility needs some love. I expect water to be the same as it is to create a primitive or at least a terrain.
     
    OBiwer and chap-unity like this.
  48. JRW_WSP

    JRW_WSP

    Joined:
    Jun 26, 2017
    Posts:
    37
    Ah ok no problem glad to see that someone's already logged it (and that I can submit bugs!). For now I've kind of cheated by adjusting the time variable on the water surface.

    On the subject of the script interaction I can't seem to make sense of what I might be doing wrong. Brace yourself for screenshots...

    I've got script interactions enabled in the HDRP profile that is active in my quality settings (in fact I've enabled it in all of them).



    I've also enabled water in the default frame settings (although there is no script interactions option here).



    On my water surface (which is an infinite ocean) I have script interactions enabled.



    ...and water rendering is enabled in my global volume.



    If I try the 2023 burst example script on a newly created cube then everything works fine.



    However on the same cube if I instead use the non-burst 2023 script I get the "Can't Find Height" error as the simulation variable is null for some reason.




    Should I log a bug report or am I missing something / doing something stupid?

    Cheers!
     
  49. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    760
    Thanks for the detailled answer. You setup seems to be correct in every way.

    I tried on my side to be sure, and indeed, "Can't Find Height" is thrown in the console but only one the first frame (probably because the simulation is still null) so after that it works fine.

    Since it works with Burst, best you can do is try to send me a simle project (privately) and I'll have a look to see if there is something wrong on our side.
     
  50. OBiwer

    OBiwer

    Joined:
    Aug 2, 2022
    Posts:
    61
    What is the recommended approach for reflections?
    I've an beach to the ocean, and you can see pretty far, and you can easily see dark lines where the reflection probes end.