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

[RELEASED] Lux Water

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

  1. Deleted User

    Deleted User

    Guest

    Does this asset work with the Universal Render Pipeline (URP)? I certainly cannot make it work with URP. Any help would be much appreciated.
     
  2. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    water renders the global skybox here showing the ground as total reflection when looking from below the surface.
    i have not checked planar reflections from bleow nor local reflection probes.
     
  3. wwg

    wwg

    Joined:
    Apr 2, 2014
    Posts:
    130
    @larsbertram1 - I'm spawning my player (and player camera) into the scene and it seems to be causing this error:
    NullReferenceException: Object reference not set to an instance of an object
    LuxWater.LuxWater_WaterVolume.Register () (at Assets/LuxWater/Scripts/LuxWater_WaterVolume.cs:50)

    The water volumes don't get registered and therefore don't work. Any suggestions for correcting this? Maybe an initialize/register function to call when spawning the player.

    Thanks!
     
    Last edited: Apr 27, 2020
  4. potatosallad3

    potatosallad3

    Joined:
    Sep 10, 2019
    Posts:
    31
    Im just wondering how to get access to the reflection camera in the hierarchy? I have set its hideFlags to .DontSave but I am still not seeing it anywhere. I would like to get Massive Clouds reflecting off of the water surface, but it is a camera effect so I need to place it on the reflection camera in order to get the effect. Any help appreciated, cheers
     
  5. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    could you paste the entire error log here please?
     
  6. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    i guess you will have to make it a regular camera and then assign massve clouds manually - which most likely will be a killer.
     
  7. will_catkins

    will_catkins

    Joined:
    Oct 11, 2018
    Posts:
    18
    I would be grateful if you could give me some advice on how to display the normal display of the ocean edge(like atmosphere) at an altitude of 9000 meters.
     
  8. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    i would be happy to do so if i understood your question.
    what is "normal display"?
     
  9. will_catkins

    will_catkins

    Joined:
    Oct 11, 2018
    Posts:
    18
    Sorry,My english is bad.
    Just like the following image,the ocean's edge is like a sphere's edge when you see it at a high altitude.
    timg.jpg
     
  10. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    ª
    oh, lux water does not support this. you would have to tweak the vertices in the vertex shader and map them on a sphere at far distances.
     
  11. will_catkins

    will_catkins

    Joined:
    Oct 11, 2018
    Posts:
    18
    Thanks anyway~~
     
  12. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
    Hi, anyone get this working with VR? If so, how did you set it up? Thanks!
     
  13. RakkuAmiya

    RakkuAmiya

    Joined:
    Jan 9, 2016
    Posts:
    53
    I'm also having trouble with reflections in VR... any advice to set this up would be welcome.

    I also get the odd View Frustum error, which is also rather frustrating. Any advice for VR setup with Lux would be very welcome. :)

    Thanks;

    Graeme

    Edit: I should elaborate... it almost works perfectly. The general view in VR is great with no issues. It's just the reflections that are not rendering correctly. The best way I can describe it is that the reflection texture for each eye seems to be half the width it needs to be, so when panning your head the reflection moves quicker than what is being reflected.

    Is there a way to split the texture to make it per eye, or render for each eye? Has anyone been able to do this? Thanks. :)
     
    Last edited: May 2, 2020
  14. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    509
    I am experiencing an issue when using Alloy hair shader. I had to set its render queue to 2999 otherwise I get problems with Enviro.

    What Im seeing with Lux is when my character is underwater if the camera looks from above the hair doesnt render. If I move my camera under the water where I see all the fog and other effects, my hair pops back up.

    Underwater vs above water camera angle.

     
  15. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    all you can do about this is trying some other render queue settings here.but i think it should be cut out (not transparent), so everything between 2450 and 2995 should be fine?!
     
  16. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    509
    I use Alloy which is cutout, not sure if it has any transparency though. If I decrease it to 2995 it works under water but when Im out and look at the water it cuts the outer layer of the hair, maybe it has transparency I dont know shaders, so both ways its not working as I want.

    Edit:

    Here is a demonstration with Enviro because its easier to see, but Lux is doing the same thing - it cuts the outer layer (transparent?) and it looks really bad.
    When using 2450 even if I decrease the Cut value to say 0.2 it looks nowhere as nice as the right picture. What Im wondering is is there a way when I go underwater to put it on a separate layer lets say "Exclusion" which wont let Lux touch it.

     
    Last edited: May 5, 2020
  17. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    as your images show: using 2999 it is transparent - or at leat uses a transparent add pass.
    2450 is cut out.
    transparent means it does not write to the depth buffer. thus it is not seen by the water and will get overwritten.
    if you need/want transparent hait please have a look into the demos and documentation about transparent underwater meaterials and materials that get switched regarding their queue. not perfect but all we can do.
     
  18. moltke

    moltke

    Joined:
    Apr 28, 2019
    Posts:
    109
    When i follow this to set up enviro fog with your water, it turns all my water objects pink


    Azure, Enviro and Aura 2 Lux Water also supports fog rendered by Azure, Enviro or Aura 2. To enable this feature you have to edit the “LuxWater_Setup.cginc” file as well. Please make sure that you uncomment the corresponding #define and #include and comment all other #defines. Please note: Azure, Enviro or Aura 2 should be installed at their default location. If you have moved them you will have to adjust the path of the #include

    here are my errors: https://imgur.com/tjoHruv

    i have tried reimporting the shaders and deleting the shaders and re-importing them and still pink
    Error:

    unrecognized identifier 'Enviro'
    Compiling Vertex program with UNITY_PASS_FORWARDBASE DIRECTIONAL LIGHTPROBE_SH GEOM_TYPE_LEAF GEOM_TYPE_BRANCH_DETAIL GEOM_TYPE_FROND _GERSTNERDISPLACEMENT _PIXELSNAP_NONE
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR
     
    Last edited: May 13, 2020
  19. cpkcpk

    cpkcpk

    Joined:
    Dec 13, 2019
    Posts:
    48
    From your error screenshot it looks like you have uncommented line 14, you should only do lines 15 and 16. Also remember to comment the #define for the built-in fog on line 7 or 8.
     
  20. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    sorry, but i guess you have not followed the description properly. as @cpkcpk pointed out: you have uncommented a comment not the needed define which is in line 15.
     
  21. moltke

    moltke

    Joined:
    Apr 28, 2019
    Posts:
    109
    thanks silly of me to miss that i made that mistake, i did it but fog still doesnt seem to affect the water so ill just ignore it for now
     
  22. gueei

    gueei

    Joined:
    Dec 2, 2013
    Posts:
    3
    It seems like the skybox or the ground, but either way, is there ways to reflect the object under water surface? For instance the cube's reflection.
     
  23. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    the water will reflect the reflection probe it picks up. either the global one. or a local.
     
  24. Skotrap7

    Skotrap7

    Joined:
    May 24, 2018
    Posts:
    125
    I am using the infinite ocean script for an island, that happens to also have a lake near its center that is within the same water depth as the ocean. The lake and ocean water are being overlapped. Is there a way to mask out the lake from the ocean or something like that so I can have these 2 water planes (one infinite) co-exist? Or should I be trying some different setup?
     
  25. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    the ocean demo contains a lake which however is at a higher level.
    so i guess you will have to hack the script which moves the tiles and check for a certain position which would overlap with the lake. simply park the tile somewhere in your scene like pos.y -= 3000.0f
     
  26. Skotrap7

    Skotrap7

    Joined:
    May 24, 2018
    Posts:
    125
    That is what I was going to do as a work around, so I guess it will have to be sufficient.

    Thanks
     
  27. Skotrap7

    Skotrap7

    Joined:
    May 24, 2018
    Posts:
    125
    I just made it so the subdivided plane that overlaps the lake is disabled. That seems to work without having to do the above. Is that a bad solution?
     
  28. bonickhausen

    bonickhausen

    Joined:
    Jan 20, 2014
    Posts:
    115
    Hi!

    Let's say I want to spawn a prefab exactly on the water.

    Provided with X and Z world coordinates, how do I get the ocean's Y height at a given X/Z point?
     
  29. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    nope.
     
  30. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    the package comes with a c# script which gives you an approximated y position.
     
  31. Skotrap7

    Skotrap7

    Joined:
    May 24, 2018
    Posts:
    125
    On an island with infinite ocean, is there a way to have the waves from tiles surrounding the coast approach the island like you would see if you were standing on the beach, or would you suggest having a separate material for each tile surrounding the coast with different angles for the waves?
     
    camta005 likes this.
  32. bonickhausen

    bonickhausen

    Joined:
    Jan 20, 2014
    Posts:
    115
    Are you talking about SetToGerstnerHeight? Because i've tried using one of the functions within that script (GetGerstnerDisplacement) and i keep getting weird height values that don't really snap to the ocean. What could I be doing wrong?
     
  33. camta005

    camta005

    Joined:
    Dec 16, 2016
    Posts:
    320
    I have the same question. I have been able to get my infinite ocean to look amazing and am really happy, aside from the direction of the waves around an island.
     
    eaque likes this.
  34. dajnooo

    dajnooo

    Joined:
    Feb 22, 2019
    Posts:
    12
    Is it possible to use enviro distance blur with lux water?
     
  35. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    unfortunately lux water does not offer a solution for this.
     
  36. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    it can only approximate the height as it does not take the vertical movement into account.
    maybe this helps:
    https://www.gamedev.net/forums/topic/689445-finding-height-of-gerstner-wave-at-coordinates/
     
  37. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    509
    I checked the documentation about "Lux Water/Underwater/Transparent Premultiply" and "Lux Water/Underwater/Transparent Blend" shaders and as far as I can see there is no way to achieve what I want without modifying the hair shader.

    What I want in terms of functionality is to switch the hair shader render queue to 2000 when the camera is above water (but character is underwater - the third person camera is looking down at the character) and to 3000 when the camera is underwater.
     
  38. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    305
    impossible de publier un avis sur l'Asset Store. J'ai essayé 3 fois et ce n'est jamais enregistré.

    Et: Pas de solution ? Tant pis. J'ai encore essayé aujourd'hui. Pourtant je peux mettre un avis sur d'autres Assets mais pas sur Lux Water:furieux:
     
    Last edited: May 25, 2020
  39. dajnooo

    dajnooo

    Joined:
    Feb 22, 2019
    Posts:
    12
    I'm getting some strange artefacts when using lux water with enviro. How can I fix this?

    With black ground mode disabled:


    With black ground mode enabled:
     
  40. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    do you use depth or field as well?
    how does it look without dof?
     
  41. dajnooo

    dajnooo

    Joined:
    Feb 22, 2019
    Posts:
    12
    I changed the render queue and that seems to have fixed it.
     
  42. melonhead

    melonhead

    Joined:
    Jun 3, 2014
    Posts:
    630
    are shadows cast on the water surface or just on the ground under the water?
     
  43. cpkcpk

    cpkcpk

    Joined:
    Dec 13, 2019
    Posts:
    48
    Do you plan on adding HDRP support now that it's out of preview? I'm guessing there's no ETA but just wondering if it's coming at some point, either as an update or a separate asset. I've mostly switched over to HDRP but missing Lux Water a lot!
     
  44. eaque

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    755
    Same idea here:
    So you say it is not possible to use a regular water material around the island and the ocean material overlapping it at distance?
     
  45. XyrisKenn

    XyrisKenn

    Joined:
    Dec 8, 2015
    Posts:
    92
    Hi, I'm trying Lux again and in a scene with the standard renderer, deferred rendering, linear. I'm using Time of Day as the skybox and main light source and Aura 2 is also used. I've edited LuxWater_Setup for Aura, and added the Lux Deferred render shader in Player Settings.

    - Firstly I tried following the Getting Started guide by making a Lux water shader, a plane, and adding the shader to the plane. The plane was a flat dark color. I tried copy/pasting the Ocean planes from the Ocean Demo and same result, no detail or color.
    - In Scene and Game view there's a muddy beige water texture. When I run the game the water plane looses all texture and lighting.

    Is the setup as simple as described in Docs or are there other requirements in Camera, Lighting, Lightmaps to make this work? What are the basic assumptions made by the shader for it to work in-game? Might there be a compatibility issue with the Time of Day environment?
     
    FuriantMedia likes this.
  46. gueei

    gueei

    Joined:
    Dec 2, 2013
    Posts:
    3
    Hi, I've tried to add a reflection probe (dynamic update or bake), under camera or separate globally, still no underwater reflection; but above water is working without any probe. Is there any options in the scripts to enable it?
     
  47. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    the water surface does not receive shadows as it transparent.
     
  48. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    it never tried this, sorry.
     
    eaque likes this.
  49. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    it should work out of the box using dx11. in case you use metal you might have to add some tweaks as described in the docs.
    when it comes to lighting you have to make sure that there are any kind of reflections: either from the sky or local probes. otherwise the water will just look odd.
    check if and how TOD tweaks ambient lighting and ambient reflections.
     
    XyrisKenn likes this.
  50. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    how does underwater then look like?
    have you tried to tweak the "Underwater IOR"?