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,902
    that does not include anything related to lux water...
    so your entire scene and not only the water may stutter. try to add e.g. a sine based animation to a sphere and look how it moves when the water starts to stutter
     
  2. novaVision

    novaVision

    Joined:
    Nov 9, 2014
    Posts:
    518
    Just purchased this asset, but I can't find this scene in the examples.

    Furthermore, most scenes doesn't work properly on Mac standalone, even in Editor. If camera rendering set tot Deffered water is just invisible, if I set it to Forward, water starts blinking
     
  3. rostik1975

    rostik1975

    Joined:
    May 14, 2015
    Posts:
    44
    Thank you. This didn't help unfortunately (I tried various values in the range 2900 - 3100, inc. 3010). I think this relates to the shader.
     
  4. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    please refer to the documentation when it comes to metal and deferred rendering.
     
  5. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    use the frame debugger to see in which order water and your quad gets drawn.
    then you may have to edit the glass distortion shader manually and find a proper queue.
     
  6. rostik1975

    rostik1975

    Joined:
    May 14, 2015
    Posts:
    44
    It seems the water is drawn first, and then the watersplash screen is drawn. However the water is still invisible. Could you advise what parameter in the shader I should set, to fix it?
    Thank you.
    render1.jpg render2.jpg render3.jpg
     
  7. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    that is the right order. now you have to make the distortion shader do another grab which also contains the water:
    if you look at the frame debugger: 1st pass in "RenderForward" is "GrabRenderTexture" which is used by both: water and distortion. so the distortion shader does not see the water at all but only the scene like it was before the water got drawn.
    usually you force another grabpass by not declaring a garb texture in the garb pass of the shader or giving the grab texture a specific name like "_GrabDistortion". you should find more info about this in Unity's documentation about the grab pass.
     
    rostik1975 likes this.
  8. terpardev

    terpardev

    Joined:
    Dec 4, 2019
    Posts:
    10
    I only removed the ship. It is working just fine except for the ocean.

    I tested the LuxWater without the tessellation, only the clear water and it worked smoothly on my iPhone X.

    Is there any setting I can tick or change in the water surface tessellation shader to fix the stutterring/skipping?
     
  9. terpardev

    terpardev

    Joined:
    Dec 4, 2019
    Posts:
    10
    Disabling the gerstner waves fixed the problem too. But I needed the waves.
     
  10. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hmm,you may try to edit the shader and replace all half, half2, half3, half4 values with float, float2, float3, float4 in ther gerstner function.
     
    terpardev likes this.
  11. cpkcpk

    cpkcpk

    Joined:
    Dec 13, 2019
    Posts:
    48
    Is HDRP support coming at some point? I really love the look of Lux Water more than any other water asset!
     
  12. Image3d

    Image3d

    Joined:
    Jun 20, 2008
    Posts:
    155
    EcoSurfers - WIP - iOS

    Can you add a flowmap option to Flux Water so we can add flowmap effects to improve surf water Effects ?

    Images: Lux Water on the up coming EcoSurfers Game - Tech Demo

    Screen Shot 2020-02-24 at 12.54.55.png Screen Shot 2020-02-24 at 10.24.17.png Screen Shot 2020-02-24 at 12.55.48.png Screen Shot 2020-02-24 at 12.54.20.png
     
    Last edited: Feb 26, 2020
    Vincent454 and Rowlan like this.
  13. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,056
    Nice breaking wave, looks great with the light coming through it, how did you create that wave?
     
  14. terpardev

    terpardev

    Joined:
    Dec 4, 2019
    Posts:
    10
    Wow! Thank you so much, man! Stuck on this for a week, but now it finally worked!

    I also had to change other values in other shaders related to water ocean tessellation from half to float, as it is causing squares when the camera is near to the waves, or is looking from below the water.
     
  15. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    oh, great that it worked out!
     
  16. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    no eta.
     
  17. rostik1975

    rostik1975

    Joined:
    May 14, 2015
    Posts:
    44
    Thank you very much! This did help to fix the issue.
     
  18. vampir26

    vampir26

    Joined:
    Mar 29, 2010
    Posts:
    108
    Hi

    I have a problem with underwater effect. The effect is horizontal splitted (in every depth of the water) and the effect (blur) is very noisy. Generally, I got very different results like other people. Do you have an idea what's wrong?

    Thank you

    lux.png
     
  19. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    can you take a better and not so dark screen shot please?
     
  20. vampir26

    vampir26

    Joined:
    Mar 29, 2010
    Posts:
    108
    I increased the ambient color, but the "underwater area" was still dark. Then I figured out: The intensity of the directional light affect the "underwater area" altrough it es deactivated. The "underwater area" is change direct with the intensity and color of the DEACTIVATED directional light.

    If I delete and unassign the directional light the unterwater volume don't change. It have the color of the last directional light.

    The noise effect appeared only with light intensity 0 or black light color. This problem is now solved.

    It seems Lux Water require a directional light, but my game plays in underground. I just use a dark low ambient color and dynamic lights.

    Perhaps I get Lux Water working, because it's affected by the "deactivated" directional light. This way, I can modify the underwater color and brightness and the light don't affect the game level.

    But I have still the issue with the splitted underwater. The split is directly at the camera Y and if I look around, the split don't move. If I go up or down, the split move with the camera Y. Hope you understand me :rolleyes:

    lux4A.png

    lux4B.png

    Edit: The directional light is also required to see the caustic effect.
     
  21. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    underwater is an image effect, so it has no idea about lights. for this reason the underwater rendering script picks up the directional light and passes its values to the underwater image effect.
    maybe you can hock in here: it should be just direction and color/intensity that gets passed.
     
  22. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    not really. may it is the underwater mask?
     
  23. Image3d

    Image3d

    Joined:
    Jun 20, 2008
    Posts:
    155
    Technique is the same used in Surf's Up movie.. Wave was modelled and animated in Carrara, then exported as .MDD. Played back with MegaFiers Point Cache Modifier...
     
  24. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    version 1.1 has been published.

    ### Added
    - Added simple slope based foam (only applied if the water uses uv mapping)
    - Added a slection to choose between scroll along U or along V in case uv mapping is used.
    - Exposed "Final Foam Erosion" which lets you control the softness of the final foam borders. Default was 0.375.
    ### Fixed
    - Final normals fixed if the water uses uv mapping, arbitrary geometry and gerstner waves.
    - Normal mapping fixed if the water uses uv mapping.
    ### Changed
    - If the water uses gerstner waves and uv mapping the 4th wave now uses the tangent direction and ignores the settings in the material. This gives us some kind of directionality. But actually gerstner waves are not mafe for this...
    - Gerstner Waves: Some variables changed from half to float to better support mobile.
     
    hoodoo and sjm-tech like this.
  25. Image3d

    Image3d

    Joined:
    Jun 20, 2008
    Posts:
    155
    Larsbertram, can you add a flowmap option to Flux Water so we can add flowmap effects to improve surf water Effects ?
     
  26. blackant

    blackant

    Joined:
    Jun 18, 2009
    Posts:
    529
    Hello,

    i'm having some problems integrating underwater effect for my game.
    as you can see on screenshots, everything works but the mask is not exactly following the waves.

    i don't know whitch parameters can affect this ?
     

    Attached Files:

  27. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    if you use a proper mesh (like the provided volume and surface meshes) it should fit.
    have you checked the demos? do you see the same bahaviour there?
     
  28. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    flow maps are not on my list at the moment. that would be a totally different shader...
     
  29. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    @larsbertram1 Are there any plans to add some sort of water drops on camera effect when exiting the water? Something like we see in AQUAS?
     
  30. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    no. there are a bunch of similar effects out there already.
     
  31. blackant

    blackant

    Joined:
    Jun 18, 2009
    Posts:
    529
    i use Ocean mesh and skirt, and it also do the same in the demo scene
     

    Attached Files:

  32. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    i grabbed latest version from lux water and imported it into unity 2019.3.3f1. then i opened "12 LuxWater infinite Ocean Demo". i noticed that the Lux Underwater Rendering" script on the camera was missing the "Sun" input, so underwater was just pitch black. after having assigned the directional light to the script it all worked as expected.

    infinite ocean.PNG

    please reimport the package and see if this fixes your issues.
     
  33. blackant

    blackant

    Joined:
    Jun 18, 2009
    Posts:
    529
    i made a small verification by opening the demo in an empty project, and it works like it should,
    this makes me think why it doesn't in my project ?
     

    Attached Files:

    Last edited: Mar 9, 2020
  34. blackant

    blackant

    Joined:
    Jun 18, 2009
    Posts:
    529
    also, i used "reimport all" and unity reimported alls cripts...
    i go errors and crash

    ... After reopening the project, there is no more error.... -.-'

    and finally i updated with the new update, and finally got it to work in my project too.

    thanks, the shader is beautifull and flexible, a must have !
     

    Attached Files:

    Last edited: Mar 9, 2020
  35. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    looks as if it was not working because the number of shader keywords exceeded...
     
  36. RadioactiveBullfrog

    RadioactiveBullfrog

    Joined:
    Jul 8, 2017
    Posts:
    55
    Forgive me if this is a silly question… But when you say to overwrite the anchor position, what should I overwrite it with?
     
  37. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    easiest would be to take the transform of the reflection itself and plug it into the anchor overwrite of the skirt meshes.
     
  38. RadioactiveBullfrog

    RadioactiveBullfrog

    Joined:
    Jul 8, 2017
    Posts:
    55
    That didn't seem to make a difference. Any other suggestions?
     
  39. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    strictly technically it MUST solve it... but you may ask hendrik from enviro for another solution.
    basically enviro's reflection probe is simply too "small".
     
  40. RadioactiveBullfrog

    RadioactiveBullfrog

    Joined:
    Jul 8, 2017
    Posts:
    55
    It didn't work, I'm not sure what else to say. And the ENVIRO developer told me he would be unable to help me with your product. So I'm not sure what to do now?
     
  41. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hack the enviro code and increase the size of its reflection probe.
    it is not a problem with lux water. it is a problem with enviro: simply replace the material on the skirt with a simple chrome mat: you will get the same result.

    but actually using the anchor overwrite should work. maybe you give it another try.
     
  42. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    425
    Hi, is it possible to use Lux Water with a runtime camera ? I am using a fps camera as my main camera and switching in game sometimes to a third person camera (which is loaded at runtime).
     
  43. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    yes.
     
  44. blackant

    blackant

    Joined:
    Jun 18, 2009
    Posts:
    529
    hmmm, sry to bother you
    today i have an incoprehensible problem:

    i made a prefab of my camera, everything is ready to be used, and it was working nicely... but...
    Screenshot at 2020-03-13 23 33 12.png

    for an obscur reason, lux water script is missing when i instenviate the prefab...
    Screenshot at 2020-03-13 23 36 55.png

    why only lux water ??? wtf ???
     
  45. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    i don't know.
     
  46. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    509
    Hi,

    Im using 2 cameras that are changed with DialogueSystem and when I switch back to my main camera I get this error

    Code (CSharp):
    1. ArgumentOutOfRangeException: capacity was less than the current size.
    2.  
    3. Parameter name: value
    4. System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) (at <7d97106330684add86d080ecf65bfe69>:0)
    5. System.Collections.Generic.List`1[T].set_Capacity (System.Int32 value) (at <7d97106330684add86d080ecf65bfe69>:0)
    6. LuxWater.LuxWater_UnderWaterRendering.OnEnable () (at Assets/LuxWater/Scripts/LuxWater_UnderWaterRendering.cs:279)
    7.  
    Do you have any ideas how to fix it? The same thing happens if I just enable / disable my main camera.
     
  47. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    you may try increase the capacity...
     
  48. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    509
    I increased it from 10 to 11 and I dont get this error. The problem now is when I talk to an NPC there is a different camera and what Im doing is entering / exiting the dialogue 5-6 times, then I start running towards the water and the game freezes and crashes with this error (as soon as the water is visible on my screen)



    You can see how small is the scrollbar and if you drag it down the same message from this pic repeats. I use defered rendering and Im using WaterSurface_Tessellation, here's my setup where I can replicate it:

    MainCamera (LuxWaterUnderWaterRendering enabled, object active during the crash)
    SecondCamera (This object is instantiated only during dialogues and then destroyed, so not in the scene during the crash).

    I have gotten a crash before adding the 2nd camera, but Ive never investigated what caused it, because it was so rare and maybe it has something to do with this, even though this crash happens almost all the time when I follow the steps above.
     
    Last edited: Mar 16, 2020
  49. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    fine.

    somewhere in the log it says:
    failed to create staging 2D texture w=128 h=2
    which i would read as: your screen size is 128x2px?!

    then there is a message about invalid pass calls (calling pass 5 but there only 3 valid passes).
    looks like the script assumes that tessellation is enabled but the used shader is the regular one.
    do you switch from tess to none tess in your scene?
     
  50. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    509
    No, I will try the non tess shader now. My screen size cant be that small Im testing on my pc and uses predator monitor.