Search Unity

[RELEASED] Lux Water

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

  1. eaque

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    764
    Sorry to bother as i'm far from my computer to test....
    You never tried but does it sound technically stupid or with perf issues??
    As there are Lux demo scenes with different materials at same time i was thinking about that.....:rolleyes:
     
  2. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    yeah, but no overlapping water surfaces.
    performance should be fine if you make sure you do not render pixels twice. so unfortunately in this case: transparents are rendered back to front, so even if you write to depth, you may produce overdraw. so kep the overlap as small as possible or consider doing something like a depth prepass.
     
    eaque likes this.
  3. camta005

    camta005

    Joined:
    Dec 16, 2016
    Posts:
    320
    Would it be possible to calculate the direction of the gerstner waves so they always move towards a set x,z co-ordinate. You could then set the co-ordinate somewhere in the middle of the island and the waves would look more correct at the shoreline.
     
  4. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    oh, just try to rotate the waves using the functionality provided by the material inspector: as soon as you rotate you will get jumps...
     
  5. camta005

    camta005

    Joined:
    Dec 16, 2016
    Posts:
    320
    I have tried this and I don't mean that the x,z co-ordinate moves, just that all waves move towards a fixed location.
     
  6. eaque

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    764
    So i gave a try, it looked good from top down and from far but the transisiotn from a reg material to the ocean one shows obvious seams that can not be corrected...So navigating from one material to another seems impossible.

    But now i think of this idea:
    Simply have very low waves when character is on the island and if he sails on the sea, then trigger big waves settings in real time.....??

    Is it possible? will the transition from calm water to big waves be smooth if we lerp it by deltatime or something like that???
     
  7. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    it should be. jut hit play then raise or lower the values in the material.
     
    eaque likes this.
  8. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    i do not think that this can be done easily. but i would have to have a look into this.
     
    eaque and camta005 like this.
  9. Fibonaccov

    Fibonaccov

    Joined:
    May 5, 2020
    Posts:
    58
    Hi,

    Are the shaders mobile friendly? Thanks
     
  10. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    they are fast. but if they are mobile friendly heavily depends on the features you enable.
     
  11. Skotrap7

    Skotrap7

    Joined:
    May 24, 2018
    Posts:
    125
    I would really like to know this too. I'm nearing a decision point where I might have to redo all of our water is Lux is not going to support HDRP soon.
     
  12. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    HDRP will not come soon.
     
  13. Boemak

    Boemak

    Joined:
    May 29, 2013
    Posts:
    48
    Hi,

    I just got your wonderful asset and I must say it looks brilliant. I have one thing, in the editor the ocean looks like it should but when I press play it looks daft. All the waves are gone.

    The sample scenes work as they should and I've been trying to figure out what I am missing but am coming up empty.

    Any ideas?
     
  14. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    check the lux underwater rendering script and the height set there.
     
  15. Boemak

    Boemak

    Joined:
    May 29, 2013
    Posts:
    48
    That was it, thanks. :) Awesome stuff BTW.
     
  16. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    thnaks. glad that my random guess nailed it...
     
    Boemak likes this.
  17. Boemak

    Boemak

    Joined:
    May 29, 2013
    Posts:
    48
    Psychic debugging FTW. :)
     
    hopeful likes this.
  18. dajnooo

    dajnooo

    Joined:
    Feb 22, 2019
    Posts:
    12
    is VR supported?
     
  19. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    underwater rendering does not work properly when it comes to vr.
    the basic water surface should render fine.
     
  20. Game_DevKH

    Game_DevKH

    Joined:
    Jun 11, 2017
    Posts:
    23
    Can you help me set up with Aura 2? I tried looking for solution here : lux.jpg but water became pink after that
     
  21. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    answered via email.
     
  22. srhboo

    srhboo

    Joined:
    May 25, 2020
    Posts:
    4
    planar reflections on water surface are broken for me in VR (left / right eye positioning for the planar reflections do not match). any suggestions?
     
  23. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    which vr mode do you use?
     
    Last edited: Jul 8, 2020
  24. srhboo

    srhboo

    Joined:
    May 25, 2020
    Posts:
    4
    multipass - is that what you mean?
    am developing for oculus quest
     
  25. Mattabat

    Mattabat

    Joined:
    Aug 23, 2017
    Posts:
    2
    I have ran into a development issue i need for my project, so i need the underwater volume to be rendered at all times,(even when i am out of the water) while there is no ocean surface.
    I have managed to do this, but due to the way the water surface/watervolume mesh is made only the sides and bottom of the mesh can actually be visible. If looking from top down if i hide the ocean surface i cannot get this part of the water volume visible only if i enter it from that angle. How can i accomplish this?
     
  26. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    when looking top down the water surface is rendered (needed by advanced deferred fog as it replaces the missing information in the depth buffer). you would have to disable the rendering of the watersurface in orde to make the bottom be rendered into the water mask and not get overwritten/hidden by the water surface.
    if you need both then you have to use 2 render targets.
     
  27. srhboo

    srhboo

    Joined:
    May 25, 2020
    Posts:
    4
    wondering if you could clarify if planar reflections should work in vr or if there is a workaround?
     
  28. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    sorry, but i am not into vr... i guess you would need 2 planar reflection textures, which would make it even more expensive so it is not really suitable for vr.
    i recommend to stay with cube map reflections.
     
  29. srhboo

    srhboo

    Joined:
    May 25, 2020
    Posts:
    4
    Ok thanks for the response!
     
  30. lucasgutierrez

    lucasgutierrez

    Joined:
    Jun 20, 2017
    Posts:
    2
    Hello,
    I'm wondering why during game mode the assets turn/look "low-poly".
    How can fix this?
    thanks in advance! :)

    Game mode — low-poly meshes.jpeg
     
  31. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    i don't know. underwater renders as image effect on top. it does not influence your geometry. :)
     
  32. lucasgutierrez

    lucasgutierrez

    Joined:
    Jun 20, 2017
    Posts:
    2
    _
    Extrange. look when i activate Lux underwater redering.
    correct.jpeg lowpoly.jpeg
     
  33. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    oh! it might be the caustic lighting... do you use forward rendering?
    if possible use deferred. in forward the shader has to reconstruct the normals form the depth bufferwhich leads to normals as if they were not smoothed.
    you may also disable or dim the caustics.
     
  34. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    562
    How do I make particles show up when using the planar reflection script with render shadows enabled? As soon as I turn on Render Shadows they disappear but I want to use render shadows. I even used the particle shaders that come with LUX and that still doesn't fix this. Im in Unity 2018.4.20 - standard pipeline - deferred rendering.
     
  35. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hm, no idea. i have no problems in 2019.3.

    particles.PNG
     
  36. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    562
    I had to use the nature manufacture shaders for particles for it to work. It has something to do with fade transparency with anything opaque and it shows up just fine. Using any fade type transparencies it wont show in reflection.
     
  37. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    you mean soft partciles? right, these do not show up because the reflection camera uses an oblique projection matrix. which doesn't allow you to use any simple clipspace tricks like fog or soft particles.
     
  38. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    562
    Ya but the nature manufacture particle shaders show up like 50% of the way good enough to feel right. LUX is awesome love using it for all my scenes. I get to do so much cool stuff with water thanks to LUX your the best lars.
     

    Attached Files:

  39. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    nice scene!
     
  40. ZoNaDak_

    ZoNaDak_

    Joined:
    Dec 20, 2018
    Posts:
    2
    hi,
    I want to express movement by moving the sea and rotating, not by the player moving.
    but, Normal map and form map seem to be rendered on a viewport basis.
    Can you tell me how to solve this problem?
    I am sending you the Gif file as well.
    I am sending you the link to Google Drive because the gif file is too big.

    https://drive.google.com/file/d/1RAiA1yLUifZFqJJ34W4S5nuM-UdxVjtD/view?usp=sharing

    Thanks.
     
  41. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hi there,

    i am not able to open/view the gif. but i guess you run into an issue cause by the UVs being based on world space coordinates: moving or rotating will not change them... you simply may try to switch to regular uvs by checking UV Space Texture Mapping in the material inspector.
     
  42. ZoNaDak_

    ZoNaDak_

    Joined:
    Dec 20, 2018
    Posts:
    2
    That's exactly what I wanted! Thank you so much!
     
  43. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    you are welcome!
     
  44. QbAnYtO

    QbAnYtO

    Joined:
    Dec 18, 2016
    Posts:
    223
    hey guys i'm seconds from buying this, but can I make BEACH WAVES? not calm lake waves. i mean the bigger beach waves with foam and all on the sand/shoreline etc. And change the color of the oceans?

    Also how easy is this to use? Comes with a prefab and stuff? Like aquas? (However I tried aquas and didn’t like it. So this asset got my attention.)

    lastly will this work with the built in pipeline?
     
    Last edited: Aug 3, 2020
  45. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    yes.
    nope.
    yes.

    if you come from aquas then this will run a lot faster. a lot.
    even if there are some missing features.
     
  46. camta005

    camta005

    Joined:
    Dec 16, 2016
    Posts:
    320
    You can get the waves looking really good on a beach, they don't crash like natural beach waves but the shoreline foam looks amazing in this asset, much better than any other water asset on the store. The main issue is the gerstner waves can only go in 1 set direction. So they look great on one side of an island or continent but are going in the wrong direction on the other side. I previously made the suggestion of having the option to have the waves move towards a fixed location, which you would set in the middle of your island or continent so the waves would look like they were coming from approximately the right direction on all sides.

    I found a video of a similar idea which was a modification of the unity water4 shader:
     
  47. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,447
    Great looking water!

    Any ideas to make something like: reflection fade to skybox reflection by distance?

    looking for this kind of effect, when its windy, far away reflections disappear due to the waves:
    upload_2020-8-4_12-46-46.png
    *that second image is modified shader for adjusting reflection normal, based on view distance, but not really working perfectly in most cases..

    photo reference, where can see it:
    upload_2020-8-4_12-48-6.png

    ** well now that i look these images, maybe should just use 2 different water planes, where the distant one doesnt have reflections enabled..
     
    Quique-Martinez likes this.
  48. QbAnYtO

    QbAnYtO

    Joined:
    Dec 18, 2016
    Posts:
    223
    Larsbertram1, thanks for the answers. I love how you did the displacement for the video below but is that automatic? If its manual, would it be hard to implement? Also I noticed the moveing balls have foam trails which is GREAT but no displacement on the water its moving through. Was this intentional? I’m asking because I would like my character to move the water (displacement) as he swims through it and generate foam as well. Is this possible? I nice the dragon video a few pages back does have any displacement or foam so I’m wondering is this is optional or even possible. Thanks! (See video below)








    camta05: that’s awesome, I’m wondering if I can use the waves particle plugin with this water?? This one:
    https://assetstore.unity.com/packages/vfx/particles/environment/beach-waves-94251

    I supposed we can use any particles at any place within unity. Lol



     
  49. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    no, it uses a displacement projector. you can see the displacement and normal texture in the upper left corner of the video.
    everything you need to do so is included. even the scene from the video.
    the spheres show another feature which are foam projectors.
    of course you can combine both: foam and displacement.
     
  50. QbAnYtO

    QbAnYtO

    Joined:
    Dec 18, 2016
    Posts:
    223
    Bro yessssss!!! So my character the move and ripple/move/displace the water around him? Thats awesome.

    Ok im pretty much sold at this point. And what about mobile support to iOS example? How optimized is this?
    Can I use my own foam?
    Speaking of the foam, my foam with aquas turns into white blobs if I use depth of field. Is that an aquas issues or is this the same case with all water foams?


     
    Last edited: Aug 4, 2020