Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

[RELEASED] Lux Water

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

  1. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,974
    oh, i misunderstood. you want to tweajk the displacement of the waves. so i would try to adjust:
    _GerstnerVertexIntensity (" Final Displacement", Vector) = (1.0,1.0,1.0,0.0)
    it is a Vector3. so you could use Material.SetVector("_GerstnerVertexIntensity", new Vector3(xxx));
     
    eaque likes this.
  2. eaque

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    764
    my bad, i realized i was not clear once written...:)
    Many thanks, gonna try.
     
  3. eaque

    eaque

    Joined:
    Aug 20, 2014
    Posts:
    764
    Very sorry once again for my poor knowledge after all those years,
    so if i do:
    public material Mat:
    I want to set at start : Mat.SetVector(......) I can't find a reference to ("_GerstnerVertexIntensity")
    If ever you feel like integreting this function we would all be so happy:p

    btw a i don't understand why all the characters models dont float with the settoGer...script. It works for cubes, sphere...but not with my models, what am i missing?
     
  4. KarloE

    KarloE

    Joined:
    Aug 26, 2013
    Posts:
    175
    Thank you, I think this did the trick. I'm sorry for not letting you know sooner. Awesome support!
     
  5. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    I’ve just updated my iPad to ios16.2 and it’s caused lux water to do something strange. I have a huge water plane approx 20km square. There is a small terrain island in the middle. The new problem is when you are viewing a ship kilometres from the island there is a huge reflection on the water of a palm tree! not a good quality reflection but a huge pixelated tree in the water. All worked fine on iOS 15, clearly lux water shaders now not working properly on the latest metal.
     
  6. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,974
    what happens if you use a huge plane using a simple reflective, smooth and transparent material using the standard shader?
    and could you provide some screen shots?
     
    Last edited: Dec 21, 2022
  7. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    Ok, it now does in in the latest unity2021 too on the desktop mac dev system.
     

    Attached Files:

  8. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,974
    just to confirm: the reflection (and palm) comes from a cube map, right? it is not a planar reflection?
    if it was a planar reflection you should check the reflection camera: it does not seem to be aligned with the current active camera. do so by editing LuxWater_PlanarReflection.cs -> and comment line 86:
    go.hideFlags = HideFlags.HideAndDontSave;
    this will make the reflection cam being shown in the hierarchy so you can select it and check its position.
     
  9. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    The reflection is coming from the one and only reflection probe I have in the scene, just happens to be near a palm tree! I’ve just tried a large plane with a default material highly reflective and it too does the same. It seems like every reflective surface in the scene shows a reflection of the palm tree no mater where it it.
     
  10. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,974
    that is the way reflection probes work. they are infinite by default. you may try to use a different probe which has nothing outstanding in it near to its origin (palm) but rather only contains something in the background.
    but in case of the wide open sea this would only be sky. whereas when close to the shore line you may want some trees or cliffs. blending probes might do the trick here.
     
  11. BaoBao55

    BaoBao55

    Joined:
    Apr 8, 2016
    Posts:
    13
    Can I use Lux Water for mobile platforms?
     
  12. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,974
    yes.
     
  13. BaoBao55

    BaoBao55

    Joined:
    Apr 8, 2016
    Posts:
    13
    Is there any limitations for using Lux Water on mobile?
     
  14. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,759
    You can use it on mobile. There are no limitations aside from your mobile device speed.
    I use Luxwater on my mobile/desktop game without issues, you can download free and see for yourself the performance you get on your device www.dogfightelite.com
     
    BaoBao55 likes this.
  15. ml785

    ml785

    Joined:
    Dec 20, 2018
    Posts:
    119
    i'm new to lux water. can the appearance be changed to have toon shading? there are a lot of toon water shaders on the asset store that i'd like to try on Lux Water but i'm not sure if it's possible. thanks
     
  16. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,974
    not really, sorry. lighting is as is. you may try to tweak the foam texture but the shader is not written for a toony look.
     
    ml785 likes this.
  17. crowmaster

    crowmaster

    Joined:
    Jul 6, 2012
    Posts:
    89
    Hello, i need a plain still water for my project, so i disabled almost all options and when underwater i am getting this od semi-sphere artifacts? (this is a demo project scene i modified)
    upload_2023-2-1_17-49-21.png
     
  18. montyjack

    montyjack

    Joined:
    Jan 10, 2014
    Posts:
    45
    Hey- had an issue for a while now but figured I should ask if you know what's going on- billboarded trees appear to be drawn BEHIND the ocean. See below. Any idea why? Thanks in advance!

    upload_2023-2-7_17-17-35.png
     

    Attached Files:

  19. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,974
    this is a common issue with standard unity billboards which are transparent - just like the water.
    as both do not write into depth it is a question of sorting order - which we can not influence and if would not help much.
    you have to use a billboard shader which does alpha testing instead. this is also needed when it comes to third party fog solutions for example.
     
  20. franky_li

    franky_li

    Joined:
    Aug 8, 2016
    Posts:
    165
    Hello, is there a way to get Lux water work with Unistorm fog? I tried Enviro as well, but same problem, EnviroFogCore.cginc is no longer distributed with Enviro 3.
    If possible I would prefer to stick with Unistorm, since it looks much more natural than Enviro and I would like to stick with Lux water for the same reason. (best looking ocean in asset store:))

    Regards
    Frank
     
  21. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,974
    no idea. maybe unistorm provides a custom fog function you could add to the water. you have to ask the unistorm devs.
     
  22. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,790
    Is their a trick to the underwater volume rendering. I followed the instructions in the docs but when I go underwater nothing changes but I do see a small cube under the water and if I get the camera inside it then I see the underwater volume rendering. I used the Ocean Plane for my water surface and pCube2 for the volume mesh. The ocean plane has been scaled up 60 times. But I see no way to do the same for the volume mesh, the docs say it will automatically be scaled but it seems not. If I have to make my own mesh what size do I have to make it, the size of the unscaled Ocean plance, or the size of the scaled ocean plane?
    You can see the volume cube on the right, no scaling applied it seems.
    Screenshot 2023-02-23 140325.png
     
    Last edited: Feb 23, 2023
  23. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,974
    i recommend to have a look into the "ocean" demos which implement the following things:
    • your ocean surface should be made out of several meshes so frustum culling will help to reduce the number of vertices and triangles which have to be rendered. make these meshes follow your cam and you get an endless ocean.
    • for an ocean you should use a "sliding underwater volume". it does not have to be huge as it follows the camera. actually it MUST NOT be huge as you have to guarantee that it does not get culled by your camera's far clip plane.
    • the first ocean demo shows how to combine a sliding volume (for the ocean) and a static one for a "small" lake on the island.
     
  24. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,790
    The problem seems to be that the volume doesn't follow the camera. In the image I attached that is the game camera view and you can see the volume cube and as I move the camera around that cube stays in the same position so it is not tracking the camera at all. Is there some tag, layer or some other option I need to enable.
    This is the component on the Ocean surface:
    Screenshot 2023-02-24 105427.png
    And these the ones on the camera.
    Screenshot 2023-02-24 105459.png
    Can you see anything that stops the volume from being positioned correctly?
     
  25. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,974
    that looks fine. have you checked what gets rendered as mask using the frame debugger?
     
  26. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,790
    I get this for the mask, again a small cube not positioned around the camera at all.
    Screenshot 2023-02-24 182553.png
    And the frame info
    Screenshot 2023-02-24 182623.png
    It just seems that for some reason the mesh is not being put where the camera is.
     
  27. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,974
    sorry, i am a bit out of the birp - what is camera.customrender which comes next?

    the water mask should be rendered using a command buffer and render "AfterSkybox". i do not see it here at all?!

    attached how it is supposed to look like.

    luxunderwatermask.PNG
     
    Last edited: Feb 24, 2023
  28. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,974
    the same goes for the overlay buffers: they are supposed to be rendered a command buffer which runs "before skybox". but your screen shot shows that they are rendered just "somewhere".
     
  29. Dr_D_and_D

    Dr_D_and_D

    Joined:
    May 20, 2020
    Posts:
    27
    Is it possible to make rooms underwater?
     
  30. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,974
    this is not supported.
     
  31. Dr_D_and_D

    Dr_D_and_D

    Joined:
    May 20, 2020
    Posts:
    27
    dang
     
  32. benthroop

    benthroop

    Joined:
    Jan 5, 2007
    Posts:
    271
    Hi Lars, love your work here.

    When using Temporal Anti-Aliasing (TAA) and Post Processing Stack v2 on BIRP, the foam on Lux Water has a bug where it judders. Any suggestions for a fix?
     
  33. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,974
    unlike HDRP the BIRP does not really let you write a dedicated motion vector pass afaik. so my answer is: no, unfortunately.
     
  34. ray_ervi

    ray_ervi

    Joined:
    Jun 18, 2018
    Posts:
    10
    Hello Lars!

    I read documentation that turning on Aura 2 support is as easy as uncommenting few lines - but after doing that, I wonder why the water still looks like on the attached image. The fog doesn't affect the water still, and it's very apparent on thick atmosphere (which will be the mood of my game). Already contacted you via email, but dropping this question here too in case you missed it.



    the tweaked Setup.cginc


    Any help will be greatly appreciated!
     
  35. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,974
    hey!
    this is only half the effort which is needed to make it work :) you also need a tweaked version of the Aura.cginc.
    i will send it via email.
     
  36. ray_ervi

    ray_ervi

    Joined:
    Jun 18, 2018
    Posts:
    10
    Thanks for the swift response! unfortunately - it still looks the same after the package is imported. Is it possible that the tweaked Aura.cginc doesn't work with the latest aura version?
     
  37. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,974
    possible. i haven't checked this for years. can you diff the original file and the one i sent?
     
  38. ray_ervi

    ray_ervi

    Joined:
    Jun 18, 2018
    Posts:
    10
    There's not much difference beside your changes - but there might be something else that prevents the fog to work on the water. Is it possible for you to take a look at the latest Aura 2 update and try to make Lux water works with it? considering that Aura 2 will not receive any further updates as they're working for Aura 3 now.
     
  39. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,974
    ah - you define FOG_EXP2 and FOG_AURA... try to comment FOG_EXP2
     
  40. ray_ervi

    ray_ervi

    Joined:
    Jun 18, 2018
    Posts:
    10
    ah right - that works, thanks a lot!
     
  41. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,974
    Looks epic
     
  42. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    327
    Good morning,
    I can't represent the fog under water. I used the demo and tried quite a few settings. Unity 2020.3.14f1
    What settings should I change for this?
    THANKS
     
  43. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,974
    not sure, but do you have a volume anywhere?
     
  44. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    327
    Lux Water Volume script ?
     
  45. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,974
    script and volume geometry. check the provided demos.
     
  46. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    706
    hi. wanted to test luxWater with DWP2

    and have this strange visual effect
    in the infinite ocean demo
    lux.gif
    I did change to deferred (Edit → Project Settings → Graphics > Built-in shader settings : Deferred to custom, assign LuxWater_DeferredShading)
    the LuxWater_CameraDepthMode on camera does not affect the outcome
     
  47. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    327
    I've found ! I had forgotten Sphere Collider on the camera!
     
    Last edited: May 5, 2023
  48. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,974
    do not really see visual artifacts. maybe you can describe them?
     
  49. bobadi

    bobadi

    Joined:
    Jan 3, 2019
    Posts:
    706
    there are moment when the foam seems to be rendered over the boat (I think the boat is not under water)
    yes, looks like it. here's a picture:
    lux1.jpg
    and the other thing: big area ocean gets dark / shadowy (and then bright for no apparent reason when close up)

    here's another view of the ocean
    lux2.jpg
    unity version: 2021.3.23
     
    Last edited: May 6, 2023
  50. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,974
    if foam renders on top it is underwater.
    overall lighting looks a bit strange. like there is a harsh border between the tessellated near and the non tessellated far water. i do not get this in the provided demo.
    what do your reflections come from?