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,900
    do you use single or multi pass rendering.
    multipass should work more or less. single pass does not.
    addng support for vr is on my list but no eta, sorry.
     
  2. ffertigo

    ffertigo

    Joined:
    May 31, 2015
    Posts:
    12
    Multi Pass, yes Single Pass doesn't work at all.
     
  3. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    in multi pass the water mask is a bit too large... which might cause your issue.
    i will have a look into this. i hope i will have it soon.
     
  4. ffertigo

    ffertigo

    Joined:
    May 31, 2015
    Posts:
    12
    Actually the water is working in single pass in vr. I get the same glitch in single pass. The glitch is just not visible when i set the Underwater Scattering to 0, so it has something to do with it. Would be so thankful if you could work on that!
     
  5. SpaceBoatStudio

    SpaceBoatStudio

    Joined:
    Apr 6, 2016
    Posts:
    3
    Any chance for HDRP version this year?
     
  6. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    sorry, hdrp won't leave preview til the end of the year. so the answer is no.
     
  7. budukratok

    budukratok

    Joined:
    Jan 3, 2011
    Posts:
    30
    Hello! I need a little advise, Is it possible to create a zone of calm water? Maybe with projectors (I'm not sure if they can modify tesselation and waves)? Or it's better to cut water planes for it? Thank you.
     
  8. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    unfortunately: no.
     
  9. ciathyza

    ciathyza

    Joined:
    Aug 16, 2015
    Posts:
    109
    Hi, is there any support for Lux Water working properly with UniStorm? If yes, how can I enable it? If not I'd like to request adding support for UniStorm.
     
  10. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    unistorm is not officially supported. but what is your problem?
    can you share some more information?
     
  11. ciathyza

    ciathyza

    Joined:
    Aug 16, 2015
    Posts:
    109
    Can it be made to be officially supported?
    So far I'm trying to get Enviro and Unistorm to work with Lux Water and have the underwater look as desired. I followed the instructions to change the shader include to support Enviro. But even with that it looks nothing like the way Lux Water appears with just unity default lighting.

    Please compare these screenshots of a test with "10 LuxWater Water Volume Deep Water Demo":

    Only Lux Water: http://files.ciathyza.com/wl/?id=3CeTaQNeRjSncPXBmExihgIwLEBrTz3J
    With UniStorm: http://files.ciathyza.com/wl/?id=TFYKUfc3Jos28rR0KTYr1kNRyHUVHAD2
    With Enviro: http://files.ciathyza.com/wl/?id=e46DdbzQtmkeH3YdmX49NSBYn2daYx1B

    It's very obvious that the water's foggyness/"volmuniess" goes missing with UniStorm and Enviro.

    Since Enviro is supported by Lux Water I assume it can be made work together so that the water look is preserved as close to the first image. Though I would like to see official support for UniStorm. I've had only few time to compare Enviro and UniStorm but so far UniStorm seems to have better graphical quality.
     
    Last edited: Sep 1, 2019
  12. no00ob

    no00ob

    Joined:
    Dec 13, 2017
    Posts:
    65
    In unity 2019.3 the whole camera view turns black with lux water enabled, with the frame debugger I think I narrowed it down to the LuxWater_UnderWaterBlur
    Code (CSharp):
    1. (This is from the framedebugger)
    2. >Camera.ImageEffects
    3.           >LuxWater_UnderWaterBlur
    4.                     Draw Dynamic
    Edit: LuxWater also apparently stops all of my transparent shaders from rendering...
    Edit: Apparently the Post processing I'm using in 2019.3 is completely broken and is causing almost all of my assets to break including Lux so I fixed my issue by removing all post processing for now.
     
    Last edited: Sep 1, 2019
  13. Vondox

    Vondox

    Joined:
    Jun 3, 2013
    Posts:
    2,421
    Hello, its a simple fix for enviro:

    Make sure that EnviroSkyRendering component is in front of the LUX Water_Under Water Rendering component. That way the underwater fog from LUX will be applied after enviro effects.

    upload_2019-9-1_16-38-18.png
    upload_2019-9-1_16-38-4.png
     
    Rowlan and ciathyza like this.
  14. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    @Vondox thanks a lot for helping out here!
     
  15. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    hendrik has already addressed your enviro issue.
    the author of UniStorm contacted my and i gave him a voucher. he told me that he already got it up and running – except from the moon lighting. this should be rather easy to accomplish by accessing the public "sun" variable (it is a transform) in the Under Water Rendering script. However you also have to set the sun light color (tkaen from the light assign to the SunLight variable – which currently is private). you may simply set it to public so you can change sun (transform) and SunLight (light) from script.
     
    ciathyza likes this.
  16. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    so post processing is broken in 2019.3 and your issues are not related to lux water?
     
  17. ciathyza

    ciathyza

    Joined:
    Aug 16, 2015
    Posts:
    109
    Vondox & Lars .. thank you for your hints! I will follow your suggestions as soon as I get home!
     
  18. PieterAlbers

    PieterAlbers

    Joined:
    Dec 2, 2014
    Posts:
    246
    I am trying to get the water to receive realtime shadows.
    The shaders has references for it - but I am unable to get it to work. I was able to adjust the shader to have lightmaps, but I would love to have realtime shadows as well.
     
  19. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    i checked it once: sampling shadows in the vertex shader. but even if i used tessellation it did not really look convincing...
    you may try to do it per pixel of curse.
     
  20. HonKasumi

    HonKasumi

    Joined:
    Apr 25, 2018
    Posts:
    45
    Can i make the water low poly somehow and use an material
     
  21. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    if you use a custom mesh for the water you could add some noise to your mesh and disable normal smoothing in the import settings or in your DCC app.
     
  22. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    Are you able to confirm if this works on mobile VR with forward rendering single-pass? We are targeting the Oculus Go/Quest/GearVR
     
  23. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    vr is still in development, sorry.
     
    ROBYER1 likes this.
  24. anna_unity663

    anna_unity663

    Joined:
    Jun 14, 2019
    Posts:
    1
    When is the shader expected to work with the Oculus Quest?
     
  25. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    sorry, no eta yet.
     
    ROBYER1 likes this.
  26. PieterAlbers

    PieterAlbers

    Joined:
    Dec 2, 2014
    Posts:
    246
    Hi! I am unable to get it to work :(
    I am only look for receiving shadows on flat water surfaces. No tesselation, no gerstner waves.
    Tried a bunch of stuff but no results. Can you help me out?

    -Pieter
     
  27. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    as the water does not write to depth (at least not during the opaque pass) you have sample shadows in the pixel shader directly from the cascades.
    in order to get you started i would recommend to get my asset "Lux lit particles": these particles may sample shadows in the vertex or the pixel shader and the package contains all needed shader code and the script that grabs the cascades.
     
  28. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    does this work on opengl2 for mobile? It looks awesome. I don't need the waves, I only need water similar to a lake. I'm wondering about performance since I've been using community ocean shader until now.
     
  29. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    509
    Im using Deferred in Unity 2019.1.9 if I have Enable Deep Water Lighting checked my beach sand texture turns black once I go underwater and Im not talking about the water you see in front of the character, its a completely different oasis on the island. The oasis doesnt even use the sand texture its just the 1st texture on the terrain so I dont know whats the relation between them

     
  30. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    Hi, I'm trying to make the fog affect the water surface, i'm also using Enviro and have altered the Lux seup file as stated but as seen from the image the fog does not effect the surface. Other people have had issues with underwater fog but thats all working fine for me. Thanks alot Jim upload_2019-9-20_17-30-54.png

    upload_2019-9-20_17-30-54.png
     
  31. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    according to the reviews on the asset store the performance is pretty good.
    so it might work on older mobile devices as well in case you do not activate feature such as real time planar reflections.
    disabling caustics also gives you a nice performance boost.

    do you have any screenshots that show how you use water right now?
    and what is the freedom of the camera?
     
  32. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    lux water does not do anything with the textures. it just tweaks the lighting.
    and this is absolutely independent from being above or below the water surface.

    it does not even need water to be active in the scene.
    all it does is fading out the directional light according to the height in world space like shown on the sreen shot below.
    so are you sure that waht you see is related to deep water rendering?


    Bildschirmfoto 2019-09-20 um 19.47.34.png
     
  33. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    underwater, fog, lux and enviro effects the underwater post processing.
    when looking from above the water shader actually has to pick up fog from enviro.
    so i doubt (sorry) that you have changed the setup properly (like forgot to comment unity's fog) – or simply forgot to reimport the shader?
    if you open the frame debugger and look for the water plane being rendered, frame debugger will show the active keywords used by the water shader. there you must see FOG_ENVIRO and no other FOG related keyword.
     
    Last edited: Sep 21, 2019
    llJIMBOBll likes this.
  34. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    There is a video here, you can see the water. That video was done with an iphone 5, 30 fps with water and everything else going on.
     
  35. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    sorry – but in this case water would be the star when it comes to visual fidelity :)
    you can definitely disable caustics.
    and probably even foam.
    gerstner waves are not that expensive.

    actually i think you do not even need a grab pass and proper distortions by the water.
    all it would need was a some kind of soft particle shader which fades out water where it hits other geometry.
    and a proper blending of the normals to hide the tiling of the bump maps.
     
  36. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    509
    When I disable it the problem is fixed even if I go underwater, but now the problem is when I disable it the ocean is black if I get close (on the same height as the ocean)
     
  37. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    i have not checked it in Unity 2019.1.9.
     
  38. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    ok, i purchased it... really slow compared to the community ocean shader on my mobile. I tried several of the scenes removing the terrain and I didn't manage to get it over 7fps on my android. Is there a shader on the package that i can try to modify to remove all what you are saying to see whether it improves?
     
  39. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    no, you will have to work on the provided shaders...
    most things i mentioned (caustics, foam or gerstner waves) are checkboxes in the material editor.
    disabling refraction however needs you to change the shader code.
    but as i wrote: if the video shows the overall visual fidelity you can achieve on your traget devices then lux water is way over the top.
     
  40. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    734

    Finally I got a new project which looks perfect to be integrated with Lux Water... always amazing water shader! ;)
     
  41. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    163
    Hey,
    Haven´t found an answer: Can Lux be used for an endless ocean ?
    Thanks !
     
  42. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    yes, it uses sliding water planes and volumes which follow the camera.
     
    secondsight_ likes this.
  43. KarlLakner

    KarlLakner

    Joined:
    Jan 30, 2019
    Posts:
    18
    Hey,

    I am looking to do the exact same thing; I'd be perfectly happy to live with a flat plane (a sliding one with the ocean shader) if I could manage to render shadows. Any chance you could provide a non-technical solution?
     
  44. PieterAlbers

    PieterAlbers

    Joined:
    Dec 2, 2014
    Posts:
    246
    @larsbertram1
    Sorry for not replying anytime sooner - things are quite hectic at the moment.
    After purchasing Lux Lit Particles and delving through the shaders it was pretty much a breeze to include some basic shadows in the water shader. Thanks for your help!

    @KarlLakner
    You would have to need Lux Lit Particles as well. At least that would be the easiest & fastest solution.
    Furthermore a little water shader editing is involved, but if you PM me I could help you with that.
    My solution is pretty basic though. I implemented Shadow color and Shadow strength, nothing fancy

    -Pieter
     
    Lars-Steenhoff and KarlLakner like this.
  45. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    as pieter already offered his help i would like to point you towards him.
     
    KarlLakner likes this.
  46. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    could you please share the shadows instructions pieter?
     
  47. KarlLakner

    KarlLakner

    Joined:
    Jan 30, 2019
    Posts:
    18
    A million thanks, will PM you.
     
  48. carodak

    carodak

    Joined:
    Sep 22, 2018
    Posts:
    11
    Hello,
    Thank you very much again for your asset, it works like a charm.

    Could you please explain to me how to have access to the material "water water volume deep rendering" and get the water speed (Far Normal: W)?

    I would like to change the speed of the water via a script in real time but I have no idea how to reach it.

    Thanks
     
  49. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    there is no such meterial... deep water rendering is implemented using a custom deferred lighting shader.
    please have a look at the material properties _FinalBumpSpeed01 and _FinalBumpSpeed23 which both are hidden and get set by the material editor script.
    [HideInInspector]_FinalBumpSpeed01
    [HideInInspector]_FinalBumpSpeed23
     
  50. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    163
    Hello,
    So, I´ve bought Lux and I love it ! Works great with Enviro and is very fast.
    But in my scene there seems to be no foam around the ship. And shouldn´t there be a reflection as well ?



    Not sure if I´m missing something or not here. I´m using only a slight modified material from the endless ocean demo.
    Thanks !
     
    Vincent454 likes this.