Search Unity

[RELEASED] Lux Water

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

  1. mr_fr3d

    mr_fr3d

    Joined:
    Jan 4, 2015
    Posts:
    5
    Hi,
    your asset is very great and the best for me, but i've just a problem with the particle, as you can see in my image we can't see the particule (white dot line) when you are above the waterplane, i've drawn in red dot where they should appear. have you an idea,or better a solution ?
     
  2. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    if you want particles to be drawn on top of the water you have to render them at a higher render queue compared to the water e.g. 3001. please note: changing the render queue might break sorting of other transparent materials.
     
  3. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Hello @larsbertram1 ! I cant for some strange reason get the underwater effects work with spltscreen.. I have capsule collider and rigidbody on the player and the cam is a bit behind since is a thirdperson.. it changes the caustics and adds the ”barrier” and bubbles but no ”fog” like how it looks in the demo scene, I copied it ALL.. what have I missed?
    Thanks
     
  4. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    so underwater post is rendering (because you see caustics when the camera is underwater) but it does not add visible fog? try to increase the fog density along the view axis. that is all i can say right now.
     
  5. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    I have same camera set, and copied the water from demo.. works there with the exact setup bit not in my own scene..

    EDIT: Okay i got it to work now, seems not to work with standard assets third person controller ..So I just use a camera to test with sphere, trigger and rigidbody.. BUT: When I look up its black the water surface from beneath the water surface, I know I can change the underwater fog to like black then it looks good (but who wants it black) I want to change the black underwater water surface so it matches the fog or else it looks weird and the barriers show... I cant get it look blueish like in the splitscreen demo, where the fog is blueish and the water undersurface is blueish...?
     
    Last edited: Feb 2, 2019
  6. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    do you know why? and this should effect the entire underwater post – not only fog.

    the water surface from beneath is dominated by "total inner reflections". so if it is black your skybox (from which the global reflection probe is generated, see lighting tab) or the local reflection probe that gets picked up by the water is black at the bottom (enviro e.g. does this by default). so you have to "fix" the skybox or reflection probe.
     
  7. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    779
    For the record, only the non-optimised version works on my Mac setup. The issue is due to metal being unable to unroll loops of indeterminate length, I believe.
     
  8. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    Thanks!
     
  9. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Im usng som HD skybox that comes with Gaia and it added some global reflection probe too... I have to check it out! Thanks!!
    And I think the reason were with the standard controller that the maincamera was not a child of the character itself.. It had only a camera controller..
     
  10. Pandur1982

    Pandur1982

    Joined:
    Jun 16, 2015
    Posts:
    275
    Hey all, i have a question, will lux water works with UniStorm?
     
  11. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    i do not own unistorm. sp i do not know if it comes with its own custom fog?!
    if not, it should be fine.
     
    Pandur1982 likes this.
  12. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Hello! It still looks like this, even if I delete the probes and put the default skybox..?

    PROBLEM.png
     
  13. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    that looks totally broken. even if reflections were black you should get some underwater fog on the backside.
    no idea what is going on there.
    have you checked the rendered water mask (you have to click/check gizmos in game view (upper right corner))?
     
  14. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    No I dont think so, but I just generate lightning and suddenly it worked?! shouldnt have anything with that to do..
     
  15. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    how does it look now?
     
  16. thedarkstudio

    thedarkstudio

    Joined:
    Jan 16, 2017
    Posts:
    7
    Hello,
    I really like your Lux Water asset, the underwater effect is really gorgeous. I do have a problem however, I can't quite understand how to use the underwater volume mesh when it is very large (my map is 13000x8000x13000). How to adapt it so that the underwater effect works everywhere with such constraints ?
     
  17. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    the underwater volume has to be visible for the camera which means that it can't be bigger than the camera's far clipping plane.
    so in case all your map is covered by water you will have to move the water mesh and volume with you camera.
    make sure you move it in steps which fit the distance between the vertices of the water mesh to prevent water from popping.
     
  18. thedarkstudio

    thedarkstudio

    Joined:
    Jan 16, 2017
    Posts:
    7
    ok so, do I have to create a mesh for the volume of water or I can use the ones of the demos scenes?
     
  19. thedarkstudio

    thedarkstudio

    Joined:
    Jan 16, 2017
    Posts:
    7
    because my map is an ocean and I admit that I'm struggling to implement your asset despite the doc it's a shame because the rendering is perfect
     
  20. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    you could use one from the demos – but actually i would recommend to create your own optimized version.
     
  21. thedarkstudio

    thedarkstudio

    Joined:
    Jan 16, 2017
    Posts:
    7
    I didn't such information in the documentation, or maybe i missed it ? How can I create my own version ? Thank you by the way.
     
  22. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
  23. thedarkstudio

    thedarkstudio

    Joined:
    Jan 16, 2017
    Posts:
    7
    Last edited: Feb 4, 2019
  24. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    me too :)
    maya.
     
  25. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    like in the demo scene but with my own coloring :D
     
  26. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    779
    When using this and AFS, which custom deferred shading library do I use?
     
  27. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    in case you need deep water lighting?
    you should take the afs deferred lighting shader and modify the "CalculateLight" function like in the LuxWater_DeferredShading.shader. make sure you include the "LuxWater_DeferredLibrary.cginc" and that it can be found by the afs deferred lighting shader – simply be copying it into the same folder.
     
  28. papaonn

    papaonn

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

    I just bought your assets, which your demo inspired me.
    But I have tried importing it and played with the demo scene, and it failed at generating anything for volume based demo. All other simple ocean and river shader are working fine, except the volume and deep water, which totally render nothing and even surface of water is gone. Any help with this?

    Thanks. Problem.png
     
  29. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    your console shows a lot og errors.
    which version of unity are you on?
    which platform is your target?
    and which graphics api do you use?
     
  30. papaonn

    papaonn

    Joined:
    Aug 21, 2015
    Posts:
    30
    Thanks for the attention!

    Yes,the bug is only one single line, but looping in runtime.
    (FYI, however the bug is not present in other volume scene demo file, it happened randomly sometimes not showing up. I did not take too much concern on them for the moment. )


    I'm currently using Unity v.5.6.0f3 Personal.
    I'm developing in Macbook Air, targeting for MacOS and Windows. ( But the build is in MacOS only currently ).

    Graphics API, I unchecked the Auto to view the options, to find out which is Meta & OpenGLCore.

    #UPDATE - I just checked your documentation once again, and figured out Metal has problem with Deferred rendering etc things, I am not too good at graphics API things for Unity, I will try to disable the Metal API and switch over to OpenGLCore for test to see what will happen.

    GraphicsAPI Settings.png
     
    Last edited: Feb 5, 2019
  31. papaonn

    papaonn

    Joined:
    Aug 21, 2015
    Posts:
    30
    #Update - I removed Metal graphics API, and tried with OpenGLCore, and Deferred Shading, still not showing anything :(
     
  32. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hmm, i have tested it in unity 5.6.3. on mac os 10.11.6. and both work well: metal and openglcore.
    i started with a fresh import and openglcore: the LuxWater Water Volume Deep Water Demo just works – except from the missing light attenuation as i did not assign the deferred lighting shader.
    then i switched to metal (by turning on metal editot support): water went away as expected.
    i added the LuxWater_CameraDepthMode script to the camera a checked "grab depth texture".
    i changed the water material from the tessellation version the the regular one then i edited the shader.

    the result is almost ok :) metal does not handle point lights properly in the editor in 5.6.3.:

    Bildschirmfoto 2019-02-05 um 16.10.31.png
     
  33. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,151
    Hey @larsbertram1 .. So I added Enviro to my project, and now it looks again like the pic above, generate light didnt help... I saw in the manual that I have to edit the script, but isnt that only for fog above the water wich I will use volumetric fog for?
    Thanks
    Mattis
     
  34. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    enviro seems to set the bottom of the reflection probe / skybox to black. there is a checkbox where you can turn that off.



    regarding fog: i am not sure if the new enviro version is already available. if so you would have to edit the setup.cginc file to tell the shader that it shall call enviro's fog functions. you may ask in the enviro forum for further details.
     
  35. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    514
    Lars ~ I currently use TOD but i think its become legacy and i noticed lux is being supported by both Enviro and Azure sky systems for fog. In your personal opinion which of these sky systems works best with lux water? or is that a difficult question to answer?
     
  36. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    i think there is no big difference.
    i think water should not be ranked higher than your sky and weather system – unless you do a water centric game.
     
  37. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    514
    Thanks for the advice :)
     
  38. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    you are welcome!
     
  39. Pandur1982

    Pandur1982

    Joined:
    Jun 16, 2015
    Posts:
    275
    Give it any News about the dry mask future? I have a submarine and a underwater base, and the same Problem like the other customer here in that thread with the subnautica idea for the underwater submarine.
     
  40. papaonn

    papaonn

    Joined:
    Aug 21, 2015
    Posts:
    30
    Fixed.png
    Ahhh thanks for the test!
    It turned out actually I need to update the patch from the store, and then I should change the Deep Water demo's shader from [WaterSurfaceTessellation] to [WaterSurface], now it gave me a good simulation!

    But is there any big difference in between tessellation and surface shader?
    I am quite fine with the result of just [WaterSurface], since my game needs only lightweighted simulation of deep water exploration, so it will do so much, plus I really liked your simulation performance, which is 10x faster than my previous purchased one.
     
  41. papaonn

    papaonn

    Joined:
    Aug 21, 2015
    Posts:
    30
    #Update - sorry it tested fine in my new imported project, but it failed as soon as I dragged in a volumetric lighting library HxVolumetric Light from assets store and my deep water is gone :(

    The water surface is still present, but deep water just gone, no fogging.

    I checked to make sure the Deferred lighting shader settings are okay, but no clue why it messed up :(
    Could it be there any rendering orders problem?
     
  42. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    you can only use one: either lux underwater rendering or hxvolumetric lighting as both do the "same": adding some kind of fog. hx of course adds "real" volumetrics including light shafts while the lux underwater rendering only mimics it.
     
  43. thedarkstudio

    thedarkstudio

    Joined:
    Jan 16, 2017
    Posts:
    7
    Finally I almost managed to implement it for a very wide ocean. However the shader is removed after a certain depth despite the volume of water being correctly edited on maya (I imported one of your fbx volume and changed it directly). The box collider also takes all the depth. I have a small question too : I did not find how to change the density of the fog. How can I do it so that the player would see further under water ?
     
  44. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    sorry, i do not understand what you are saying here. the shader is removed? do you mean the underwater rendering gets disabled at a certain depth? you should be able to check this by enabling debug.

    you control it by changing its "- View Depth" (most common) and/or "- Depth Fade Start(X) Fade Range (Y) Density (Z)"
     
  45. thedarkstudio

    thedarkstudio

    Joined:
    Jan 16, 2017
    Posts:
    7
    At a certain depth, the underwater rendering effect is disabled and the debug information shows I'm still considered inside the water volume.
     
  46. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    you are inside the trigger collider, but are you inside the volume mesh as well?
    if you click/activate "gizmos" in the game view window you should get a preview of the underwater mask. it should be more or less fully green.
     
  47. papaonn

    papaonn

    Joined:
    Aug 21, 2015
    Posts:
    30
    Thanks creator, I will try to come back later as I need to hop onto some other modules at the moment, thanks for the tips, I will try to integrate soon and report back!
     
  48. skyLark9

    skyLark9

    Joined:
    May 2, 2018
    Posts:
    135
    Is there an option for waterfall ?
     
  49. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,021

    Not seen one but you can use any spline/river tool to make the mesh then add the lux river material. After that it's probably a case of adding some particle effects to give the water spray/mist effect.
     
  50. website_unity

    website_unity

    Joined:
    Jan 13, 2018
    Posts:
    4
    This plugin produces stunning looking water, I just wished it behaved like water, unless I am missing something it would be amazing if there was like an example of say a rubber duck floating on the surface? And if the river flowed so again the rubber duck would move down the river (on the surface) as you might expect water to behave.