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
    version 1.081 has landed!

    ### Fixed - Water projectors support and split screen rendering.
    ### Added - LuxWater_WaterVolume.cs: You may subscribe to OnTriggerEnter and OnTriggerExit.
     
    glenneroo and GorkaChampion like this.
  2. GorkaChampion

    GorkaChampion

    Joined:
    Feb 6, 2018
    Posts:
    103
    That was fast! Downloading now
     
  3. glenneroo

    glenneroo

    Joined:
    Oct 27, 2016
    Posts:
    231
    Unfortunately it didn't work, but no problem, I am getting closer to my desired result one step at a time.

    Yessss that was it, thanks! I never would have thought of that. For other people who who may have this problem using a Vive Pro - changing it from 1000 to 1200 to fix weird triangles when looking down (lower values didn't work completely).
     
  4. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    859
    This water asset looks amazing. I'm buying this today but I did want to add that I hope you get Single Pass rendering in VR working. This would look amazing in VR and I'd love to use it my project.
     
  5. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    thanks! i will have to find some time to dive into ingle Pass rendering tho :)
     
    StevenPicard likes this.
  6. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    859
    I just bought it but forgot to add your new particle system to the cart. That looks great, too. I'll pick that up really soon.

    I know you need to find the time but I don't doubt your skills and I'm pretty confident you'll get Single Pass working. :cool:
     
  7. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    oh, that is a big failure :) if you need lit particles this package may be the one.
     
    StevenPicard and hopeful like this.
  8. GamePowerNetwork

    GamePowerNetwork

    Joined:
    Sep 23, 2012
    Posts:
    257
    I'm loving this water asset so far.. however I'm having one issue. I can't get the water to use the fog system. As you can see using Enviro the water kinda stands out compared to the land... and at night it looks like it's glowing.

    I would also like to mention that this issue is only happening with the water surface shader... the water surface tessellation shader looks great in all lighting with fog.


    2019-03-08 (3).png 2019-03-08 (5).png
     
    Last edited: Mar 9, 2019
  9. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    this is more than strange – as both shaders share the same core.
    have you reimported both after you edited the setup include file?
    and as the tessellation shader works: how is the vertex density of your water mesh? i never ran into any issues caused by vertex to fragment interploations but you never now...
     
    GamePowerNetwork likes this.
  10. GamePowerNetwork

    GamePowerNetwork

    Joined:
    Sep 23, 2012
    Posts:
    257
    Just for clarification I'm using the Ocean 5x5 and Skirt. It's the skirt that's not blending in (using the water ocean far material). Here are screen shots. As you can see the Ocean looks great, but the skirt is having the issues with lighting/fog.

    I reimported all the shaders/materials still no luck.

    2019-03-08 (9).png 2019-03-08 (8).png
     
  11. GamePowerNetwork

    GamePowerNetwork

    Joined:
    Sep 23, 2012
    Posts:
    257
    Hi @larsbertram1 I actually figured it out. It was user error. I had two types of fog defined in my LuxWater_Setup.

    Now everything looks great! Thank you!
     
    hopeful likes this.
  12. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    ah, that is an important information.
    this might be caused by enviro's reflection probe whose size is too small (size gets set automatically by enviro).
    so the skirt geometry does not receive the same reflections as the other water tiles.
    fix this by overwriting the anchor position of the skirt's water tiles in their renderer component.
     
    null511 likes this.
  13. GamePowerNetwork

    GamePowerNetwork

    Joined:
    Sep 23, 2012
    Posts:
    257
    Thank you so much! I did as you suggested and now my scene looks amazing! thank you!

    2019-03-09.png
     
    Dwight_Everhart likes this.
  14. GamePowerNetwork

    GamePowerNetwork

    Joined:
    Sep 23, 2012
    Posts:
    257
    I have one other question about underwater effects that I'd like to tackle.

    Would it be possible for me to use my own post-rendering effects whenever the camera enters the water volume? The reason I ask is because for me, the fog is a bit too strong and a lot of gameplay will happen under water.

    Thanks!
     
  15. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    fine!
     
  16. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    you are. just use the water mask texture to distinguish between under and above water. the underwater post shader should give you a good starting point.
     
  17. GamePowerNetwork

    GamePowerNetwork

    Joined:
    Sep 23, 2012
    Posts:
    257
    Sorry, I don't think I explained that correctly. I want to use the unity Post processing v2 stack when i'm underwater. I wanted to know if there was maybe an event I could listen to so that I can switch Post-processing profiles if I'm above or below water.

    I apologize, I don't know anything about shaders, so I was hoping I could use Unity's post-processing stack.
     
  18. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    you can listen to ontriggerenter in the water volume script or simple use post processing volumes.
    however if you use gerstner waves the feedback from the collider/volume will not exactly tell you if the camera is underwater or just a little bit above. you have to calculate the gerstner height at a given position (using the provided utility functions) to get a precise info if the camera is underwater or not.
    driving an image effect this way however will effect the entire screen while maybe only parts of it are underwater.
    lux water's underwater post and blur shaders use the under water mask to get a pixel accurate result.
     
    GamePowerNetwork likes this.
  19. jmd01

    jmd01

    Joined:
    Sep 15, 2017
    Posts:
    2
    Single pass would be awesome. I've been looking for a water shader that supports SP and I can't find one
     
  20. pdq72

    pdq72

    Joined:
    Sep 29, 2013
    Posts:
    43
    Does VR work with the projector ripples (particle system)? because when enabling XR for Oculus, the projector ripples are rendered twice and you clearly see two particle systems that appear separated and not rendered properly. Below is what I have and tried:

    -Unity 2017.4.22f
    -XR with Multi-pass setting enabled
    -Tried single camera (target eyes set to both) and two cameras one for each eye.

    Thanks.
     
  21. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    i have not been looking into VR ver deeply yet, sorry.
     
  22. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    779
    Hi Lars, any updates on Aura 2 integration? :)
     
    SickaGames1 likes this.
  23. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    i have not looked into this yet.
     
    antoripa likes this.
  24. GorkaChampion

    GorkaChampion

    Joined:
    Feb 6, 2018
    Posts:
    103
    Please we need it :)
     
    local306, SickaGames1 and iddqd like this.
  25. ffertigo

    ffertigo

    Joined:
    May 31, 2015
    Posts:
    12
    Thanks, but using projector caustic shaders are tricky since they don't work with your underwater fog.
     
  26. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    ?
    they will be occluded by fog: which is fine.
     
  27. vopiman

    vopiman

    Joined:
    Mar 11, 2019
    Posts:
    1
    Hello everyone) Tell me please, how well this asset works on mobile platforms (in particular on the android middle price tag). Thanks for the help)
     
  28. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    i have not tested it – but do not recommend it on mobile anyway.
     
  29. Zeven001

    Zeven001

    Joined:
    Sep 11, 2017
    Posts:
    10
    hi i have a big problem whit all the water shaders it get the atmos scattering fog upload_2019-3-15_16-40-53.png
    i use AtmosphericScattering for planet atmosphere
    it works if i set the shader on alphaTest but than i get weird behaiver of your shader
     
  30. local306

    local306

    Joined:
    Feb 28, 2016
    Posts:
    155
    @larsbertram1 I saw a previous post requesting support for Aura 2, and I second that :p
     
    SickaGames1 likes this.
  31. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    i don't know which scattering you use – currently only enviro and azure are supported, sorry.
     
  32. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    i already contacted the author. you may imagine that he is quite busy...
     
  33. Zeven001

    Zeven001

    Joined:
    Sep 11, 2017
    Posts:
    10
    so when you dont have enviro or azure you cant have fog whit this water... thats to bad
     
  34. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    built in fog works works a swell of course.
    i do not even know which one you mean. if it is the one from Unity's Blacksmith Demo: this one is quite dead. last update was on Jan 22, 2016.
     
  35. GorkaChampion

    GorkaChampion

    Joined:
    Feb 6, 2018
    Posts:
    103
    Hi,
    When I change cameras (I do usually active / desactive the camera I'm using on each controller, for instance different camera views in my boat) I get the following issue:
    - I lose the effects that some of your scripts and I have to enable / disable them one by one or I need to enable / disable the cameras instead to activate true / false. I have the following scripts on the cameras:
    LuxWater_ProjectorRenderer, LuxWater_WaterVolumeTrigger, LuxWater_UnderWaterRendering, LuxWater_UnderWaterBlur

    Is not possible to just set active true / false when you change the camera and keep all the components running smoothly? All the rest of the components work great: Postproccesing, custom scripts, weather plugins, etc.... and I don't need to reset them...
     
  36. GorkaChampion

    GorkaChampion

    Joined:
    Feb 6, 2018
    Posts:
    103
    For instance, what I see it happens when you chance cameras is that the LuxWater_UnderWaterRendering component dissapears in run time, even when it's installed on the editor
     
  37. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    i am not sure if a really get what you are saying.
    but if it is just about switching camera, then i recommend to simply not do it :)

    always keep your main camera and in case you want to switch, copy over the properties of the "virtual" camera you would switch to like position, rotation, fov etc.
    the projectors renderer and water volume component both rely on objects registered to them: so if you turn off the current camera and its components, the new camera and its component will not have any knowledge about registered volumes nor projectors.
    furthermore activating these components most likely will create a little spike as they have to create the needed resources. you will not get this spike if you always keep the same camera.

    another possibility is to split the projectors renderer and water volume components into 2 parts:
    keep the camera relevant things on the camera and move the rest to a singleton which manages all cameras.

    i would prefer the first solution as you have a single camera prefab with all needed components attached ready to go.
     
  38. GorkaChampion

    GorkaChampion

    Joined:
    Feb 6, 2018
    Posts:
    103
    Thanks for the quick answer. In may case the different cameras have very different components as they belong to different controllers but I'll take this into consideration.
     
  39. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    fine. let me know if my suggestion helps.
     
  40. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    501
    Hello. I'm trying to understand where my Skybox reflection is coming from.

    I disabled "Planar reflections", this gives me a perfect Skybox reflection, where does this come from? It's great, I'm just trying to understand how I can make it reflect changes to the Skybox at runtime or how I can trigger Lux to update the Environment Reflections.

    I'm not using any Reflection Probes.

    Thank you.
     
  41. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    it comes from the "global" reflection probe. see --> lighting tab --> environment reflection --> source. usually this is set to "skybox".
     
  42. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    501
    Thanks for the quick reply. What would I have to do for Lux to update the reflection at Runtime? The global reflection probe does update since I can see the terrain change it's lighting.
     
  43. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    oh, then lux water should update it too. it does not do anything special but fully relies on unity pushing an updated probe: the shader uses the standard reflection code. so it reflects whatever unity puts in there.
     
  44. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    501
    I just tested it again with a fresh Lux Import, it doesn't update at runtime. Could you please take a look?
     
  45. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    sorry, but there is nothing for me to look into. it is all driven by unity's GI.
    if the reflections on the water do not update then you must have done something wrong:
    • is the shader set to sample planar reflections? would be wrong.
    • do you use real time reflection probes? then the water might simply not be covered by the probe's volume. try to overwrite the anchor in the water's renderer component.
    simply check the "ocean demo". make sure "auto generate" in the lighting tab is activated, then rotate the sun. it takes a few seconds, but then you should get updated reflections on the water.
     
  46. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    501
    Planar reflections are disabled. Auto generate is on.

    Yes, with the procedural skybox in the ocean demo it works, because sun reflections work fine with Lux and the procedural skybox only has a sun. But use a static skybox and it will reflect in the ocean, then change it for another static skybox at runtime. The ocean will still reflect the old one.

    If you change it while the game is stopped, the water will update the skybox reflection.

    Just runtime the skybox reflection is not updated. I tried the ocean demo.
     
  47. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    the reflection cubemap it automatically fed to the shader by unity.
    and if i change the skybox at runtime the environment reflections are not updated at all: neither on a standard material nor the water.
    if you set "environment reflections" to "custom" and change the assigned cubemap in playmode water and any other material will immediately pick up the new reflection.
    again: it is unity which feeds in the cubemap. lux water does not do anything about this.
     
  48. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    501
    Ok, thanks for clarifying.

    I was surprised because my terrain and trees will adapt to the color/tint of the skybox when it's changed at runtime. But in this case I guess this just updates the ambient lighting.

    Your solution with using a cubemap as env. reflections works great. Still strange that Unity updates the Cubemap reflection, but not the Skybox.
     
  49. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    i guess this would need some parts of enlighten which are not present in the run time. like you can not bake lightprobes at runtime as well.
     
    iddqd likes this.
  50. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    366
    Just installed Lux, and it works beautifully. There's one aspect of reflections, though, that I don't seem to be able to change: how reflections are affected by fog. This is what I'm getting now:

    Screenshot 2019-03-19 at 21.35.24.png

    As you can see, the reflections are entirely unaffected by fog.

    I'm running on 2018.3.8.f1 under Metal (all source adjustments done and components installed). Other relevant software used is Enviro and MicroSplat.

    I'm probably just missing a setting somewhere. Grateful for any help.