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. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    i hope you can make something nice with it.
     
  2. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    version 1.08 is available.
    please notice that this update might break your materials. have a look into the upgrade guide (changelog).
     
  3. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    Your demo scene alone blew my mind :eek: I had to make a vid of it:

     
  4. Miguelfanclub

    Miguelfanclub

    Joined:
    Jun 14, 2015
    Posts:
    64
    Is it possible that you make the asset working along with aura? (volumetric light shader)
    Right now is not working.
     
    transat likes this.
  5. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    as far as i know, aura v2 will be released soon.
    then i might have a look into it. but no promise and no eta.
     
    transat likes this.
  6. jessejarvis

    jessejarvis

    Joined:
    Aug 9, 2013
    Posts:
    303
    Did you ever figure this out?

    I'm having the same issues. And in trying to fix it I managed to turn my terrain pink LOL.

    Switching Allow HDR on both of my camera yielded the pink terrain result.
     
    Last edited: Feb 22, 2019
  7. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    The new update is sooooo awesome. I'm pleased :)

     
    Dwight_Everhart likes this.
  8. IRobb

    IRobb

    Joined:
    Apr 29, 2014
    Posts:
    16
    Hi to all!

    I have just bought this plugin this weekend. I am playing around all the demos and start making my own scene. I have faced a problem that may be my mistake. When using two cameras (flycam on top and player for example) having a rendering on one and adding the rendering slave to the second, I cant show projectors on both of them. If I add projector renderer on two cameras things get messy. I can only add one projector renderer to one camera.

    What am I doing wrong?

    Thanks!
     
  9. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    oh, i have not really tested split screen rendering and water projectors – as split screen rendering is still in "preview". it has been written due to a very special customer need. so it might just not be supported yet.
     
  10. papaonn

    papaonn

    Joined:
    Aug 21, 2015
    Posts:
    30
    Dear Creator,

    I've discovered something strange. The surface reflection of light is faded out after a certain height of displacement.

    I have posted the simulation in the video :


    For your info, I have grouped everything together ( Light, Water, Camera ) and just dragging up and down of the position and a strange reflection thing happened.

    I also adjusted every parameter in the Crystal water Gresnel material and not seeing any remedy.

    Hope to seek for advice.


    Thanks.
     
  11. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    it looks as if it was an easy fix - updating the global texture each draw made it work for me.

    splitscreen_projectors.PNG
     
  12. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    this should be retalted to "deep water renderdering". please check the material and the underwater rendering script and refer to the docs.
     
  13. papaonn

    papaonn

    Joined:
    Aug 21, 2015
    Posts:
    30
    LuxWaterSurfaceLightProblem.png


    Sorry, it still fails after some attempts, tried adjusting the underwater parameter from positive to negative still not working. can you try to reproduce to confirm if it is only happening at my pc?

    I could clearly see the camera preview is rendering correctly, but somehow when projected onto game view it has corrupted. Using Metal graphical API for mac.

    * I removed all borders of boxes around to avoid reflection of light, and so the surface of water is not getting any reflection. *

    Many thanks.
     
    Last edited: Feb 25, 2019
  14. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    510
    Does this shader support single pass stereo rendering in VR?

    By the way, I have both an Oculus and Vive and could test it in both.
     
  15. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    the pure water shader does (tested on ocolus).
    advanced effects such as underwater rendering and water projectors do not.
     
  16. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    the more often i look at your video the less i know what i see there... it simply looks as if the point light was not moving.
    nevertheless i rebuilt your case (unity 2018.3.1, os x 10.11.6, el capitan) using the "simple demo scene" and parented the camera as well as a point light under the "water clear" go. moving the parent up and down gives me stable lighting. so i can't confirm your issue.
     
  17. papaonn

    papaonn

    Joined:
    Aug 21, 2015
    Posts:
    30
    Thanks for the attempts and responses, I figured out the reflection comes from the boxes / walls that surrounds the water. If I now removed the walls, the reflection of water surface itself is not glowing, I am not quite sure what's the cause since the preview of the render is working but in gameplay rendering it's not. Hope to seek for advice.
     
  18. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,269
    Is this asset integrated into Gaia?
     
  19. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    no. but why and how should it?
    instead of clicking a button (like when using gaia and aquas) you may simply drag the e.g. ocean prefab into your scene to make lux water work.
    setting up under water effects are just a few additional clicks on top.
     
    SirTwistedStorm likes this.
  20. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    501
    Really great water system. Another vote from me for complete VR support. Thank you.
     
  21. glenneroo

    glenneroo

    Joined:
    Oct 27, 2016
    Posts:
    231
    Just purchased this for a VR project and seems to be mostly working, but I too vote for a more complete VR support.
     
    StevenPicard and iddqd like this.
  22. papaonn

    papaonn

    Joined:
    Aug 21, 2015
    Posts:
    30
    Dear Creator,

    I have issue regarding "Water Volume Mesh", I am setting up my own custom surface for water, now the problem comes with Water volume mesh, which I couldn't get the mesh correct, dug through the documentation and not seeing any mention of how to bake a water volume mesh either, could you show some lights into this problem?
    Thanks.
     
  23. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    oh, there is a chapter in the documentation dealing with this. it describes how to setup the mesh if you have a single, closed mesh like for a lake, a pond, a pool:
    https://docs.google.com/document/d/...m38h-u3Az-ozaaOX0/edit#heading=h.a35xd36psn27

    if you need a sliding water volume (like for a huge or "infinite" water surface) you will find the needed information here:
    https://docs.google.com/document/d/...m38h-u3Az-ozaaOX0/edit#heading=h.rejxcjteg7n2
     
    papaonn likes this.
  24. papaonn

    papaonn

    Joined:
    Aug 21, 2015
    Posts:
    30
    Super many thanks! I will take a look asap after work! Love ya!
     
  25. GorkaChampion

    GorkaChampion

    Joined:
    Feb 6, 2018
    Posts:
    103
    How can I activate / desactivate the Gerstner Waves (and the rest of the shader settings) from script?
    I need to modify them depending the status of my game. On my Game Manager.
     
  26. GorkaChampion

    GorkaChampion

    Joined:
    Feb 6, 2018
    Posts:
    103
    And for my setup I need to mix your infinite Ocean and Deep Water rendering. I mean I need both of them, so how do I do? Witch scripts do I need to add to the camera and How can I get a shader that has the 2 of them?
    By the way, awesome Asset, Thanks!
     
  27. josh-horsley

    josh-horsley

    Joined:
    Jun 20, 2013
    Posts:
    39
    Hello!

    Very nice looking water! Question - How would I go about removing water from inside of an object, like a submarine with a big window:

    sub_in_water.PNG
     
  28. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    you will have to switch to another material which does not have gerstner waves enabled.
    enabling/disabling the related keyword in the material will not work as it is a shader feature. you have to change it from shader_feature to multi_compile.
     
  29. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    having both of them is no problem. simply take the infinite ocean example and enable deep water rendering in the underwater rendering script.
     
  30. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    there is no solution for this yet :(.
    you could try to add a subtractive volume to the water mask which gets sampled by the under water post shader.
    but you also have to clip the water surface... you could render a simple depth only material at the very end of the opaque pass. but this would effect all transparents and particles as well. so i guess you will have to copy the depth buffer, add the volume here and use this modified depth texture to manually discard the water surface in the pixel shader.
     
  31. GorkaChampion

    GorkaChampion

    Joined:
    Feb 6, 2018
    Posts:
    103
    I have spent more than 4 hours trying to setup Underwater Rendering. It doesn't work when you try to add to your own camera. I always get the debug message "Registered volumes: 1. Active water volume: none" no matter how many times and different cameras I use.

    If I put the camera you use in the deep underwater demo scene works great and it adds the volume to the Active water on the debbug.
    But when I add the scripts you use on the demo scene to my camera (I have tried 3 or 4 different cameras, just in case) doesn't work.

    Above water works fine always. Any point that may consider?

    PS: "deep water rendering" option in the "underwater rendering" script doesn't exist. I have tried all possible combinations but what option Exactly are you referring?
     
  32. GorkaChampion

    GorkaChampion

    Joined:
    Feb 6, 2018
    Posts:
    103
    Thanks, done
     
  33. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    the camera needs the trigger script, a collider and a rigidbody. all these 3 components are needed to trigger the water volume.
     
  34. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    deep.PNG
     
  35. GorkaChampion

    GorkaChampion

    Joined:
    Feb 6, 2018
    Posts:
    103
    Ok great, thanks that It works also setting in the collider "is trigger", otherwise wouldn't work in some Character assets as the one I'm using UCC2 from Opsive.

    Now it looks awesome. One more thing: How can I suscribe to same event or somewhere in your code to apply more FX effects (bubbles on the character, underwater sounds) on my scripts when going / leaving underwater? Thanks
     
  36. glenneroo

    glenneroo

    Joined:
    Oct 27, 2016
    Posts:
    231
    I am working on a VR project and have Post Processing Stack V2, HxVolumetric lighting and since several days the amazing LUX Water with only a couple of issues which I can't seem to figure out. I have tried to remain as close to demo #10/11/12 because they look the closest to what I am trying to achieve.

    In my project, I start above water, using a procedural skybox shader and everything looks wonderful. The problems start when I dive underwater, where I switch to a 2nd procedural skybox shader. Here is my horizon about 20m below the surface (after endlessly tweaking colors on the shader):
    horizon line.png

    I found that it's because I deleted the rigidbody, which you say is required for the water volume feature, so I added it back in but then everything else (particles and sprites) are blurry underwater, as well as the horizon line still being partially visible, which of course I wish to make a smooth transition between ocean surface and underwater:
    rigidbody.png

    I have tried disabling Post Processing Stack + HxVolumetrics, along with tweaking almost every other option I can find but nothing seems to help. Do you have any suggestions how to make sprites not appear blurry? And how to get the horizon to blend better?
     
  37. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    i think this causes your issue :)
    at lest if you use single pass stereo rendering which i guess and hope ou do.
    unfortunately lux water does not support this (yet...): the water mask is broken and so all under water effects are too.
    this might cause the "strange" horizon you mentioned.

    this most likely is caused by the underwater blur effect. you may simply turn it off.

    as i am very short on time i won't be able to have a look into single pass stereo rendering within the next weeks. and even then it might turn out to be more complicated than i think now. so no eta on this, sorry.
     
    glenneroo likes this.
  38. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    oh, there is no api or whatsoever for this.
    and it heavily depends on what you want to do.
    • do you want to spawn some particles or splashes?
      in case you are using gerstner waves the water volume collider will give you just a very, very rough estimation. so in most cases it wont really help you. you will have to get the height from the gerstner waves (see the last demo in the package), compare it with the position of your camera and eventually spawn some particles if both are equal or pretty close.
    • do you want to add some more underwater effects?
      then you will have to sample the water mask in the effect to limit it to the underwater parts. the under water post shader should be a good starting point: if green in the underwater mask is > 0 you know that the corresponding pixel is under water.
     
  39. glenneroo

    glenneroo

    Joined:
    Oct 27, 2016
    Posts:
    231
    Thanks for writing back so quickly! Yes, single pass stereo rendering (but not single pass instanced). Other than the flat horizon problem, the ocean looks quite amazing in VR, both above and below the water! It's by far the best I have tested so far...

    That was it! Thanks!

    Well my first deadline is a small art festival at the end of May, so still 2 months away ;) I will continue to try to make LUX work, I have already spent 5 days implementing and it looks really amazing. I will find a way around this somehow ;)

    Another question.. I have found another strange thing, maybe it's related to VR but maybe you have another tip? Sometimes when I point the camera towards the floor at an angle, a weird black triangle (size/shape depends on camera position) appears at the bottom-right part of the screen, here is a screenshot:
    lux water weird triangle.png
     
  40. GorkaChampion

    GorkaChampion

    Joined:
    Feb 6, 2018
    Posts:
    103
    I need some effects depending the wave's high, but for now I just need an event when the camera (and therefore the underwater rendering) enters in the water, also when leaving.
    I think it would be a good idea for you to add two events in LuxWater_WaterVolume when you call waterrendermanager.EnteredWaterVolume on the OnTriggerEnter and waterrendermanager.LeftWaterVolume on TriggerExit so we don't need to modify your code. It's how most of the water assets work and help us to instantiate our own effects (Example: underwater loop sound, etc...)
    Thanks
     
    glenneroo likes this.
  41. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    if it is such kind of deadline i would try multipass stereo rendering. if it works properly you know you have a fallback.
    and it's easier to go and get some new hardware than trying to get through my code :)

    i can only guess: maybe the water volume is too big and culled by the camera's far clipping plane?
    it always has to be "fully visible" – or better – the face of the volume you are looking at must be close enough to the camera that it actually gets rendered.
    otherwise you will get holes in the water mask like shown in the docs:
    https://docs.google.com/document/d/...m38h-u3Az-ozaaOX0/edit#heading=h.xu6ch897omdc
    try to scale down the volume or raise the far clipping plane to test.
     
    glenneroo likes this.
  42. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    version 1.081 lets you subscribe.
     
    glenneroo and GorkaChampion like this.
  43. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    Hi, I noticed in the infinite ocean example scene, the ocean is actually formed by many water tiles.
    So is it possible for me to access the wave height data from a world position? If so, how's the API's cost? It's mainly for buoyance simulation.
    And can I blend change two preset data for infinite ocean? Like I've created a blue ocean preset, and a muddy swamp preset, is it possible to procedurally change the preset from one to the other in runtime?
     
  44. GorkaChampion

    GorkaChampion

    Joined:
    Feb 6, 2018
    Posts:
    103
    Just bought Aura 2, you both have now the best water and volumetric light on the Asset Store, but the shaders seems not to be compatible (colors and bright are very very different in your water that in the rest of the scene once you set up Aura 2), and its a pitty. You should talk each other to make them compatible soon!
     
    transat and Rowlan like this.
  45. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    yes, if you look into the ocean (not the infinite ocean) demo, you will find spheres and submarines which sample the height at their world positions.
    doing 5 samples like in the demo cost around 0.05 – 0.07ms on my core i7 @2.8 GHz.
     
  46. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    So, with infinite ocean, does the same API work? Or I'll need to specify the water tile I'm on?
     
  47. GorkaChampion

    GorkaChampion

    Joined:
    Feb 6, 2018
    Posts:
    103
    With infinite ocean you are always on the same tile as the "ocean" is following your camera / player, on a very intelligent way. Anyway @larsbertram1 has the last word :)
     
  48. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    same api works.
    right. but worldposition chanhes. anyway: the provided function should return the proper height.
     
  49. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    864
    What about different settings blending? If I want to turn clear blue ocean into a muddy pool in runtime, do I just change some parameters in the material?
     
  50. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    yes.
     
    Harekelas likes this.