Search Unity

[RELEASED] Lux Water

Discussion in 'Assets and Asset Store' started by larsbertram1, Jun 18, 2018.

  1. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    it has been a while that i tested it with the rift, where it looked fine.
    i am not familiar with the quest and what "link cable" means. but the quest uses a mobile gpu so you may run into precision problems
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,438
    it seems to mostly work in regular use,
    just when tilting the head this happens: (right side underwater fog(?) disappears or so)

    upload_2021-8-26_12-13-12.png
     
  3. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hmm, looks fine here using mockhmd and single pass instanced.

    underwaterfog.PNG
     
  4. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,294
    Having fun with the new Malbers Crocodile in Lux Water :)

     
    sjm-tech likes this.
  5. toblex

    toblex

    Joined:
    Aug 22, 2017
    Posts:
    7
    Hi, I'm getting an error when importing "SHader properties can't be added to this global proeprt sheet" using 2019.4.9f1
     
  6. toblex

    toblex

    Joined:
    Aug 22, 2017
    Posts:
    7
    This is also appearing in the 202.3.17f1 version
     
  7. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hi, i haven't ever heard of this before.
    maybe you have another asset in your project that causes the trouble?
    have you tried to import it to a fresh project?
     
  8. toblex

    toblex

    Joined:
    Aug 22, 2017
    Posts:
    7
    I have tried in a fresh project and get the same error. Can provide screenshot.
     
  9. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    the project i publish from on the asset store is on unity 2019.4.23f1, win 10 pro and dx11. no errors of course :)
    so what do you use?
     
  10. Christ0phoros

    Christ0phoros

    Joined:
    Sep 1, 2019
    Posts:
    13
    Hi. I don't know it's the bug or maby i'm doing something wrong but i found this problem. On first picture we can see the foam corectly but on second is disaper. It's hapen when Camera is close to gameobject wher should be projected foam.
     

    Attached Files:

  11. toblex

    toblex

    Joined:
    Aug 22, 2017
    Posts:
    7
    I did the exact same settings, fresh URP project, 2019.4.23f1 and only imported Lux Water. Screenshot is straight after import.
     

    Attached Files:

  12. Christ0phoros

    Christ0phoros

    Joined:
    Sep 1, 2019
    Posts:
    13
    Lux water doesn't support URP
     
  13. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    neither nor. foam is calculated in screen space taking the depth buffer as input and therefore is extremely view dependent. most water shaders use this technique (as it allows foam on dynamic objects with no extra costs) so most of them suffer from this.
     
  14. wwg

    wwg

    Joined:
    Apr 2, 2014
    Posts:
    130
    @larsbertram1 - The underwater volume renders fine with my first player, but when I re-spawn the volume doesn't render and the debug message shows "Registered Volumes: 0". My main camera is part the of the player prefab that is spawned.

    Any ideas? Do I need to re-register the water volumes and/or camera when re-spawning a player?
     
    Last edited: Sep 20, 2021
  15. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    if you destroy the underwaterrendering instance you have to re-register the volumes. by default they only register onenable.
     
  16. KingfisherWyvernStudio

    KingfisherWyvernStudio

    Joined:
    Oct 5, 2011
    Posts:
    324
    I was wondering if I can make waterfalls with the current version. I know this same question has been asked ever two years ago, but since there have been various updates since then, I thought it best to ask again

    Also, will there be support for URO and HDRP on the future?

    Thanks!
     
  17. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    the shader may add foam from slopes. but in order to create a believable water fall you will need more white water nd probably some particles as well.
    time will tell. altho these might just be individual products.
     
  18. aoigai

    aoigai

    Joined:
    May 28, 2017
    Posts:
    3
    Does this asset work VR in unity 2018.4?
     
  19. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    i only tested it with unity 2019.
     
  20. KingfisherWyvernStudio

    KingfisherWyvernStudio

    Joined:
    Oct 5, 2011
    Posts:
    324

    Thanks you! :)
     
  21. Haze-Games

    Haze-Games

    Joined:
    Mar 1, 2015
    Posts:
    189
    Hi @larsbertram1,

    I'm having an issue on Xbox, in which the water surface blinks/disappears (seems to no longer rendered) when I get close to it on a vertical axis. It looks like the underwater blur is being activated too early, thus blurring the water from "top" side while the camera is still above the water surface.

    This only happens in an Xbox build on devkits, with underwater rendering enabled. Without underwater rendering, it all seems fine.

    I saw an older post in which this issue was described. You then replied with this answer, but I was not able to make it work on my side.

    Would you have some time to explain the solution for underwater rendering to work on Xbox (DX12)? I'll continue digging meanwhile ;)

    Thanks,
    Charles
     
  22. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    oh, i only gave some input and did not implement any solution myself.
    maybe @Fabraz can share more details?
     
    Fabraz likes this.
  23. Fabraz

    Fabraz

    Joined:
    Sep 15, 2014
    Posts:
    66
    Hi! Yup, that sounds like the issue we ran into as well. I believe the issue was around a difference in shader semantics with DX12 that I had to add an api-specific frag function in LuxWater_WaterMask.shader to fix. Heres the fixed code from my file.

    Code (CSharp):
    1.  
    2. #if defined (SHADER_API_GAMECORE)
    3.                 fixed4 frag (v2f i, bool _facing: SV_IsFrontFace) : SV_Target {
    4.                    
    5.                     UNITY_SETUP_INSTANCE_ID(i);
    6.                     UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
    7.                    
    8.                     float facing = _facing ? 1 : -1;
    9.  
    10.                     #if UNITY_VFACE_FLIPPED
    11.                         facing = -facing;
    12.                     #endif
    13.                     #if UNITY_VFACE_AFFECTED_BY_PROJECTION
    14.                         facing *= _ProjectionParams.x; // take possible upside down rendering into account
    15.                       #endif
    16.  
    17.                 //  Metal has inversed facingSign which is not handled by Unity? if culling is set to Off
    18.                     #if defined(SHADER_API_METAL) && UNITY_VERSION < 201710
    19.                         facing *= -1;
    20.                     #endif
    21.  
    22.                       fixed2 upsidedown = (facing > 0) ? fixed2(1, 0) : fixed2(0, 0.5);
    23.  
    24.                     fixed2 depth = EncodeFloatRG(i.depth);
    25.                     fixed4 col = fixed4(upsidedown, depth.x, depth.y);
    26.                     return col;
    27.                 }
    28.                 #else
    29.                 fixed4 frag (v2f i, float facing : VFACE) : SV_Target {
    30.  
    31.                     UNITY_SETUP_INSTANCE_ID(i);
    32.                     UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
    33.                    
    34.                     #if UNITY_VFACE_FLIPPED
    35.                         facing = -facing;
    36.                     #endif
    37.                     #if UNITY_VFACE_AFFECTED_BY_PROJECTION
    38.                         facing *= _ProjectionParams.x; // take possible upside down rendering into account
    39.                       #endif
    40.  
    41.                 //  Metal has inversed facingSign which is not handled by Unity? if culling is set to Off
    42.                     #if defined(SHADER_API_METAL) && UNITY_VERSION < 201710
    43.                         facing *= -1;
    44.                     #endif
    45.  
    46.                       fixed2 upsidedown = (facing > 0) ? fixed2(1, 0) : fixed2(0, 0.5);
    47.  
    48.                     fixed2 depth = EncodeFloatRG(i.depth);
    49.                     fixed4 col = fixed4(upsidedown, depth.x, depth.y);
    50.                     return col;
    51.                 }
    52.                 #endif
    Additionally we ran into a really long loading hitch whenever first rendering the underwater fog on gamecore. In case you also run into the same issue, we fixed it by just adding a water object to our startup/splash scene and having a quad/UI block it off visually. The same pause/hitch occurred, but was unnoticeable to players, and was viable as a workaround.
     
    Quast and Haze-Games like this.
  24. Haze-Games

    Haze-Games

    Joined:
    Mar 1, 2015
    Posts:
    189
    Wow, thank you so much for you help @Fabraz and @larsbertram1!
    I'll take a look and test this ASAP :)
    Will keep this in mind for potential loading hitch as well.

    Cheers,
    Charles
     
    Fabraz likes this.
  25. Haze-Games

    Haze-Games

    Joined:
    Mar 1, 2015
    Posts:
    189
    Wow, you rock - a great big thank you from me! It worked directly and solved all my problems on Xbox :)

    Cheers!
     
  26. Fabraz

    Fabraz

    Joined:
    Sep 15, 2014
    Posts:
    66
    Awesome, glad it helped! Console porting is no joke, happy to help bypass some of the frustrations :D
     
  27. TaylorCaudle

    TaylorCaudle

    Joined:
    Feb 8, 2018
    Posts:
    158
    Using the newest version of Azure Sky and Lux Water, I'm getting this error when AzureFogScattering.cs is attached to the MainCamera, and using the Deep Water rendering demo scene. Only happens while underwater, above water the fog works fine and looks normally.

    If I remove the AzureFogScattering component from the main camera, the Deep Water volume works fine, along with Azure, but no Fog. Is Lux still compatible with Azure? I've commenting out the standard fog and uncommented the Azure lines in LuxWater_Setup.
     

    Attached Files:

  28. bubbabruce

    bubbabruce

    Joined:
    May 23, 2014
    Posts:
    16
    I bought lux water to replace my current water solution and it works great. However I am also using an asset called GDOC that does occlusion culling by writing to the depth buffer. Lux water messes up the occlusion culling by writing to the depth buffer. I really want to use both assets together.

    You have LuxWater_CameraDepthMode to work around metal writing into the depth buffer messing up Lux Water. Do you think it is possible to have something going the other way. Basically preserving the depth buffer of GDOC from the changes that Lux Water does (or potentially some future assets that do some similar writing to the depth buffer).

    I am wondering it is possible. I don't need you to implement anything on your side although if possible I wonder if you could point me in the general direction of how to implement it myself.

    Kevin
     
  29. Quast

    Quast

    Joined:
    Jul 5, 2015
    Posts:
    560
    Could you add one or two toon water?
     
  30. Woolf

    Woolf

    Joined:
    Dec 4, 2012
    Posts:
    35
    Hello. I have a problem with glare on the water. I would like to do as in the first photo, but it turns out the glare is only in a very limited area (as in the second screenshot). How do I expand the glare area and "sharpen" them?

     
  31. ght1875

    ght1875

    Joined:
    Jul 29, 2016
    Posts:
    32
    Can you port it with better shader?
     
  32. Lynxbird

    Lynxbird

    Joined:
    Aug 19, 2018
    Posts:
    17
    Is there a way to detect when object entered water?

    I need to play water walk sounds when player is in water, I already have player foam working, so is there a way to detect when player foam is active or not? or any other way to detect that object entered water?
     
  33. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    Just add a collider/trigger to the water plane and detect when it enters it. Super simple. I did it.
     
  34. EdLooping

    EdLooping

    Joined:
    Jun 4, 2017
    Posts:
    3
    Hi !
    The Global Factor of rotation works in editor but not by script.
    How can I just change the direction of the waves ?
    Thx
     
  35. aoigai

    aoigai

    Joined:
    May 28, 2017
    Posts:
    3
    Ripples does not show up well in VR.
    Is there a solution?
     
  36. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    is Lux working already in URP? I want to switch to URP but this package was the main reason I couldn't
     
  37. CarlJack

    CarlJack

    Joined:
    Dec 9, 2021
    Posts:
    3
    Hi! larsbertram1,

    We are trying to use LUX water in 3D project that is oriented toward VR visualization. When we put LUX water on a plane, the water can only be rendered in a limited distance. Only when the user gets closer to the plane will more water appear in sight.

    Can you help us solve the problem?

    Best,
    Carl
     

    Attached Files:

    • 1.png
      1.png
      File size:
      534.2 KB
      Views:
      272
    • 2.png
      2.png
      File size:
      435 KB
      Views:
      263
    • 3.png
      3.png
      File size:
      429.8 KB
      Views:
      262
  38. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    any hopes this package gets updated to URP?
     
    ProtoPottyGames likes this.
  39. JustinAHS

    JustinAHS

    Joined:
    Feb 18, 2013
    Posts:
    33
    This works fine in Unity's editor with a Quest 2 headset.
    But when I try to build and run on the Quest 2 itself, it doesn't work at all.

    I see talk in this thread of this working but this isn't the case in my experience.

    Anyone experienced the same problem and know how to get around this?
    I'm sick of buying, testing, and refunding water assets and this is one of the nicer looking ones I've found.

    On my main camera,
    + I have Lux Water Camera Depth Mode
    + I do not have Lux Water Under Water Rendering (because I read that it does not work in VR)

    And I have a water plane I copy-pasted from "01 LuxWater Simple Demo > Water clear > _WaterPlane"

    Forward rendered, single instanced
     
    Last edited: Mar 6, 2022
  40. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,438
    imported this on a new project (2019.4.19f1, standard pipeline), some errors in the editor scripts:
    Code (CSharp):
    1. Assets\LuxWater\Scripts\Editor\LuxWater_GFDrawer.cs(7,23): error CS0115: 'LuxWaterGFDrawer.OnGUI(Rect, MaterialProperty, string, MaterialEditor)': no suitable method found to override
    2.  
    3. Assets\LuxWater\Scripts\Editor\LuxWater_VectorFourDrawer.cs(7,23): error CS0115: 'LuxWaterVectorFourDrawer.OnGUI(Rect, MaterialProperty, string, MaterialEditor)': no suitable method found to override
    4.  
    5. Assets\LuxWater\Scripts\Editor\LuxWater_VectorThreeDrawerNoSpace.cs(7,23): error CS0115: 'LuxWaterVectorThreeDrawerNoSpace.OnGUI(Rect, MaterialProperty, string, MaterialEditor)': no suitable method found to override
    and more.. *it does work if remove those, so can still work on the project.
     
    Last edited: Mar 13, 2022
  41. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,438
    Tried the underwater again in VR, and using the latest package fixes the issues i had previously (problems in right eye).
     
  42. the_unity_saga

    the_unity_saga

    Joined:
    Sep 17, 2016
    Posts:
    268
    hello

    is this water asset more performant than Crest?

    also, does it permit you to swap out water textures??
     
  43. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    This water used to work perfectly in VR, now I'm getting this very weird behavior running in on my PC, windows 11 and rtx 2070, directx 12 support.

    I compile it with Unity 2021.2.18f and the graphics api is set to Direct3D11 (directx 11).

    When I go around the water, it goes missing, it seems as if the depth buffer or something is vertically reversed. It's hard to explain with the picture but if you pay attention, the water disappears in the same shape as my cockpit, but as if it was inverted on the Y axis. It also happens with the mountains and other stuff when I get closer. It is as if the shader is removing the water rendering thinking that it's covered by my geometry. But it's flipped on the Y.

    Any ideas?


    wateroff.jpg
     
    Last edited: Apr 6, 2022
  44. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    i can't reproduce your issue. checked in unity 2019.4. using MockHDM. even after upgrading the project to 2021.2.14f1 water just renders fine.
    so maybe something is wrong with your cockpit.

    waterVR.PNG
     
  45. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    The cockpit I placed there just so it is more obvious. If I remove the cockpit you will see the mountains reversed in the water. Or the bridge. Or whatever is on the depth buffer but reversed in the Y axis. It has to be in the device. If you test it on mockhd or only on the editor, it will look fine. You need to actually plug a device.
     
  46. MatthewPaquette

    MatthewPaquette

    Joined:
    Nov 5, 2020
    Posts:
    9
    I'm trying to use this with AR Foundation, it works great on Android but on iOS the water seems to move with the camera and I can see some kind of mask over the water as I move (looks like a shadowmask maybe?)
     
  47. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    i am not familiar with ar foundation, sorry.
     
  48. MatthewPaquette

    MatthewPaquette

    Joined:
    Nov 5, 2020
    Posts:
    9
    Actually, it looks like it I have this issue without ARFoundation, made a simple scene with a moving camera and it happens there as well. In Unity 2020.3 targeting iOS 11 can I not use forward rendering? I see the part in the docs about metal, I was hoping my graphics API would be OpenGLES3 but apparently we are not allowed to select that anymore.
     
  49. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    metal 1 only had issues when it come to deferred rendering. forward just should be fine.
     
  50. MatthewPaquette

    MatthewPaquette

    Joined:
    Nov 5, 2020
    Posts:
    9
    Here is what I'm getting in forward rendering on iOS. This is in AR but it does the same in a scene with a normal camera.