Search Unity

[RELEASED] Lux Water

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

  1. MightyAnubis

    MightyAnubis

    Joined:
    Jan 29, 2018
    Posts:
    19
    Hm. I am really new step into Weather Maker, i will look again.

    Found my Failure, the Code was correct. (ColorColor not work ^^ just it s Color)

    i do some variable settings now, and change them slow ( to compicatet to explain here,
    it s a little longer script ) and the Results are Fantastic.

    so: if you change the UnderwaterFog with the Sunlight, it gives really nice Effekts.
    very thank you for your Help Lars! I think you got (one of? dont know ... ) the best Water here in Asset Store this time.
    it s absolutly amazing.

    I do not have Weathermaker here on this PC, so i use Azur for a short Demo.
    I think, this looks really nice.
    its just a little Test. The Fading Times at the moment, are really fast, to test out.
    The Colors are not final, but better than changing "Specular".
    Next is: if you diving, you can do the Fading back, so that the Player gets the Default fog,
    after a periode of Time. This works great, and gives a special "bound" to the Sunlight
    / Weather Situation "over" the Sea.

    Best Greetings, and Thank you.

    Azurexample.jpg

    PS: Please have a look into, for this annoying Mistake "HDR" in Weather Maker, i am not the
    only one have this Problems.
     
    Last edited: Jun 27, 2019
  2. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,094
    whatever work for you is fine.
    so just for the records: underwater fog is lit in realtime by directional, spot and point lights (according to the global per pixel light limits) and receives ambient sh lighting. just like foam.
    i do not get this, sorry.
     
  3. MightyAnubis

    MightyAnubis

    Joined:
    Jan 29, 2018
    Posts:
    19
    hm. Here it looks like this:

    CameraError.jpg

    Error happens, if you put on "allow HDR".
    In the Scene are only:

    Lux Weather
    Weather Maker Prefab, on standard.

    nothing more. There no other Shaders or Things in the Scene, only this.
    Also the Project, does not contain other Assets ( only 1 blender Model, because it s my Development scene for this Model).
    No other Weather, ParticleEffekts, Shaders, or some other Things, just WeatherMaker and LuxWater.

    if i turn off HDR:
    hdroff.jpg

    all other works nice. The Error only happens with WeatherMaker.
    my Player Setup have not a Flashlight or a moving Controler (because it s a Boat ... )
    and i use no other Scripts, only exeption is my BoatFloatingControler, but this is not a Shader.

    Any Idea ?
    Oh: console tells .......... "nothing", clean light a new born baby.
    unity Version: 2018.3.0f2

    Graphic Cards: 2x NVidia 1080 @ SLI.
    Driver Version (if important) : 22.21.13.8205

    best Greetings.

    edit: Yes. The Specular will be nicer in the Case you want to change only the Light Settings to the Sun. But if the Player dives ( because it s a Submarine Game) and you change the Fog, it looking really great. Just fade the Fog to the Diving Depht of the Player is an amazing effekt :)
     
    Last edited: Jun 29, 2019
  4. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,094
    use the frame debugger to find out how the frame gets rendered and at which point of the pipeline the error occurs.
     
  5. mrMonkey

    mrMonkey

    Joined:
    Mar 19, 2015
    Posts:
    3
    Hi! This asset is really awesome!
    I have just a little issue when the camera is underwater and look up.
    I see a black ring crossing the sky from a side of the map to an other:

    Any idea? :/
    I use a VR headset.

    Thank you!
     
  6. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,094
    underwater supports only multipass stereo rendering.
     
  7. mrMonkey

    mrMonkey

    Joined:
    Mar 19, 2015
    Posts:
    3
    So I can't resolve this issue? This is ok :)
    Thank you very much.
     
  8. MightyAnubis

    MightyAnubis

    Joined:
    Jan 29, 2018
    Posts:
    19
    Hello Lars.

    i am sorry to disturb you everytime, but this error is annoying.
    i did the following:

    i import Weather Maker clean - in a new Scene, and set it up.
    After this, i import Lux Water, make a Plain, and give her Ocen Material.

    This is the Resuld.
    The Error starts in Frame Debugger @ this point:
    LuxWater2.jpg

    and like i say: if i turn off "HDR", all is nice.

    ( I hope that helps, i am really new to this ( Frame Debugger ) if not, ask i can do all screens you like ^^ )
     
  9. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,094
    that is the water being rendered.
    strange.
    but from what i can see in the inputs:
    - i can't say much about the _CameraDepthTexture: in the minified preview it just looks black. but that might be ok.
    - _CameraGBufferTexture2 looks pretty strange: this i sthe gbuffer normal texture which should definitely not be black.
    - _GrabTexture is white which should not be the case as well.

    so the noise you see on the water plane might silpmy be the noise added to the water to get rid of common bending artifacts. but the entire water rendering might fail because the input textures are totally screwed up (normals and grabpass).

    how does it look if you disable caustics? because onley caustics need the gbuffer normals.
     
  10. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,094
    using multi pass rendering should fix it for now.
     
  11. MightyAnubis

    MightyAnubis

    Joined:
    Jan 29, 2018
    Posts:
    19
    Hello Lars.
    Caustics off brings nothing.

    i made a small Video to this:



    so it looks, Effect starts if Sun is joining, and stops if sun is leaving.
    but it looks ... really ugly, and happens only if you have HDR on. If hdr is offline, all works 100% pretty well.
     
  12. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,094
    then you may try to set subsurface scattering to 0.0.
     
  13. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,056
    Hello @larsbertram1

    I get a couple of errors depending on where on my 16km terrain I am... Im using the splitscreen water (the demo, tweaked it a bit to look more realistic (didnt script) .. I have 2 lakes, one with water volume for underwater, the other NONE because its not possible yet?

    There are my errors:

    Screen position out of view frustum (screen pos 0.000000, 0.000000, 1000.000000) (Camera rect 0 0 476 246)
    UnityEngine.Camera:Render()
    LuxWater.LuxWater_PlanarReflection:RenderReflectionFor(Camera, Camera) (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:251)
    LuxWater.LuxWater_PlanarReflection:RenderHelpCameras(Camera) (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:147)
    LuxWater.LuxWater_PlanarReflection:WaterTileBeingRendered(Transform, Camera) (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:160)
    LuxWater.LuxWater_PlanarReflection:OnWillRenderObject() (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:168)
    UnityEngine.Camera:Render()
    LuxWater.LuxWater_PlanarReflection:RenderReflectionFor(Camera, Camera) (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:251)
    LuxWater.LuxWater_PlanarReflection:RenderHelpCameras(Camera) (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:147)
    LuxWater.LuxWater_PlanarReflection:WaterTileBeingRendered(Transform, Camera) (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:160)
    LuxWater.LuxWater_PlanarReflection:OnWillRenderObject() (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:168)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    Screen position out of view frustum (screen pos 476.000000, 0.000000, 1000.000000) (Camera rect 0 0 476 246)
    UnityEngine.Camera:Render()
    LuxWater.LuxWater_PlanarReflection:RenderReflectionFor(Camera, Camera) (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:251)
    LuxWater.LuxWater_PlanarReflection:RenderHelpCameras(Camera) (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:147)
    LuxWater.LuxWater_PlanarReflection:WaterTileBeingRendered(Transform, Camera) (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:160)
    LuxWater.LuxWater_PlanarReflection:OnWillRenderObject() (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:168)
    UnityEngine.Camera:Render()
    LuxWater.LuxWater_PlanarReflection:RenderReflectionFor(Camera, Camera) (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:251)
    LuxWater.LuxWater_PlanarReflection:RenderHelpCameras(Camera) (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:147)
    LuxWater.LuxWater_PlanarReflection:WaterTileBeingRendered(Transform, Camera) (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:160)
    LuxWater.LuxWater_PlanarReflection:OnWillRenderObject() (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:168)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)


    Screen position out of view frustum (screen pos 0.000000, 0.000000, 1000.000000) (Camera rect 0 0 476 246)
    UnityEngine.Camera:Render()
    LuxWater.LuxWater_PlanarReflection:RenderReflectionFor(Camera, Camera) (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:251)
    LuxWater.LuxWater_PlanarReflection:RenderHelpCameras(Camera) (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:147)
    LuxWater.LuxWater_PlanarReflection:WaterTileBeingRendered(Transform, Camera) (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:160)
    LuxWater.LuxWater_PlanarReflection:OnWillRenderObject() (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:168)
    UnityEngine.Camera:Render()
    LuxWater.LuxWater_PlanarReflection:RenderReflectionFor(Camera, Camera) (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:251)
    LuxWater.LuxWater_PlanarReflection:RenderHelpCameras(Camera) (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:147)
    LuxWater.LuxWater_PlanarReflection:WaterTileBeingRendered(Transform, Camera) (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:160)
    LuxWater.LuxWater_PlanarReflection:OnWillRenderObject() (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:168)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)


    Screen position out of view frustum (screen pos 476.000000, 0.000000, 1000.000000) (Camera rect 0 0 476 246)
    UnityEngine.Camera:Render()
    LuxWater.LuxWater_PlanarReflection:RenderReflectionFor(Camera, Camera) (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:251)
    LuxWater.LuxWater_PlanarReflection:RenderHelpCameras(Camera) (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:147)
    LuxWater.LuxWater_PlanarReflection:WaterTileBeingRendered(Transform, Camera) (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:160)
    LuxWater.LuxWater_PlanarReflection:OnWillRenderObject() (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:168)
    UnityEngine.Camera:Render()
    LuxWater.LuxWater_PlanarReflection:RenderReflectionFor(Camera, Camera) (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:251)
    LuxWater.LuxWater_PlanarReflection:RenderHelpCameras(Camera) (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:147)
    LuxWater.LuxWater_PlanarReflection:WaterTileBeingRendered(Transform, Camera) (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:160)
    LuxWater.LuxWater_PlanarReflection:OnWillRenderObject() (at Assets/LuxWater/Scripts/LuxWater_PlanarReflection.cs:168)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)


    ..What does it really mean?

    mattis
     
  14. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,094
    good question :) the planar reflections are based upon unity's implementation and i did not spend that much time on these i have to admit. i get these errors too from time time and simply ignore them as they do not effect rendering.
    you are right: 2 cameras rendering 2 different water volumes is not supported. a corner case i never took into account.
    but a 16km terrain is also a corner case i did not take into account.
    in a split screen scenario i assumed bothe cameras being more or less close to each other. how do you handle streaming and all this if the two cameras are at totally different locations of your terrain?
     
  15. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,094
  16. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,056
    Okay, but in build, would these interfere? Have to look up if theres a way to ignore them on script level...

    Yes, but I have checked Cascade out, and it seems theres some intergration with lux, where a custom water volume is carved out based on the lake shape, i understood from a interview on youtube with the dev...
    Thought that maybe would fix something but then again theres the splitscreen scenario, dont know how to figure this out.. But on lake works with splitscreen and underwater, it a bit too big so the horizon is shown or it might be some of my settings... Could always make those smaller "lakes" swamps not diveable :p... Both cameras is hooked up for streaming...1km is a tile and are loaded in diagnoal up/bottom, left/right, so it would take more performance if the players are at total different locations, thats something I have to take into account..
     
  17. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,094
    i have not run into any troubles yet.
    there is a cascade version which lets you create the water volumes easily. but i have not checked this 100%.
    a water volume never must be greater than the given far clip plane. otherwise you will have to use sliding volumes.
    as i wrote: 2 different active water volumes in split screen mode are not supported.
     
    mattis89 likes this.
  18. MightyAnubis

    MightyAnubis

    Joined:
    Jan 29, 2018
    Posts:
    19
    @larsbertram1

    seems the Update of Weather Maker fixes the Bug, looks good so far (until now) i try it in a new Projekt again, but here works HDR for now.

    ( Hm, i see Lux Water + DWP, it s now includet ?
    i dont get it really to run, to complicatet, because every Ship will need milliards of Rigid Bodys i think, that not so simple Strucktures like the Boat above ... ), but i will try an other solution.
    ( i can not give every gun, small boat, door, short. every "child" model Rigidbodys, that goes crazy ).

    but i try it with a Cube, Question: how did you handle that it follows the Wave ?
    Documentation tells. "WaterSystem myWaterSystem" <- do not work really.

    and how did you get the flexible Wave Height ? That is the big Question ? because it s everytime other. hm.
     
    Last edited: Jul 4, 2019
  19. XyrisKenn

    XyrisKenn

    Joined:
    Dec 8, 2015
    Posts:
    3
    Greetings! I'm trying Lux water to create an ocean effect. My scene is complicated with assets, using:
    - Time of Day asset
    - Cinema Pro cameras asset
    - World Creator Standalone version.

    I replicated the camera and mesh plane settings from your 10-Deep Water Demo scene. In my image I can see excellent depth effects, but the surface of the water is not specular nor distorted, nor is there foam and edges where the water meets the terrain (the terrain has a collider with 'fjord' dataset but is not a Unity terrain - it is imported from World Creator).

    Looking at my screenshot, might you see at a glance what I might be missing in settings or recognize incompatibility with my camera or environment assets?

    Cheers and Thank you.
    Kenn

    Lux settings.jpg
     
  20. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,094
    hi kenn,
    it is difficult to "debug" just from your screen shot... so just some random thoughts here.

    missing specular reflections:
    direct specular reflections will only show up if the camera somehow looks towards the sun.
    indirect specular reflections need you to provide a valid reflection probe. either a custom one (reflection is deactivated in the hierarchy) or the global one which gets assigned in the lighting tab. i have no idea if TOD handles this automatically. check it by adding a simple sphere to your scene. then create a new material using the standard shader and set it up so it is some kind of polished chrome.
    you also may check the settings of the water's renderer component: "Reflection Probes" should be set to "Off" which means that only the default reflection from the skybox will be sampled.

    missing foam:
    foam settings are not visible in your screen shot – but dynamic foam only relies on the depth buffer. as other depth related effects seem to work properly foam should do as well. try tp play with the foam's "Edge Blend Factor" and see if it shows up when changing the value.
     
  21. robbob44

    robbob44

    Joined:
    Apr 16, 2018
    Posts:
    22
    Hello,

    Do you know how I would go about getting Vegetation Studio trees to render in planar reflections for the water?

    I've tried merely adding the reflection cameras to vegetation studio manager, but the vegetation still does not appear in the reflections. I assume this to be because the camera is disabled and only being rendered on demand by Lux. I also tried forcing those cameras to be enabled (leaving the manual rendering) and its merely a huge framerate dip without the effect (I probably would need to edit LUX to no longer manually render - but the performance is awful).

    As far as I understand no where are the plugins considered compatible with one another, but I'm also very surprised to not even find anyone asking on either end about the other.
     
  22. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,094
    i think your assumption is correct. but i never tried it.
    i am not sure if i get this right. your enabled the reflection camera and added it to vspro? now trees are rendered to the reflection but you get a huge drop regarding fps? well, this is what i would expect to happen: vspro has to do all the work twice.
     
  23. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    443
    How do I get LUX Water to work with the OverCloud sky system? Not sure if you've tried it or not Lars but it would be another good sky system to get working with your water. Creates really nice time of day setups its perfect for Lux water.
     
  24. robbob44

    robbob44

    Joined:
    Apr 16, 2018
    Posts:
    22
    Vegetation Studio (I should be more specific and say Pro) supports multiple cameras without a noticeable framerate drop like I was attempting, but it likely is because the different cameras (like a scope on a weapon) are generally pointed in the same direction. So it shouldn't be double the work for how they claim to have implemented the Direct to Camera option (per documentation "With multiple cameras added, render direct to camera should be enabled. This will make sure the camera does not see the other cameras selection and potentially render vegetation twice."), but the reflection camera is going to have far more in view.

    Regardless though, unless something comes to mind to you, it doesn't sound theres a simple way to get something like Lux, which has manual control of a camera, to also grab vegetation studio camera changes as well.
     
  25. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,094
    i am not familiar with this system. so you should ask the author if he offers custom fog functions which could be included in custom transparent forward shaders (water). if so it should be rather simple to add support.
     
  26. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,094
    the reflection camera has nothing in common with a scope or fps camera – as it does not share the view frustum with the main camera, yes.
    the reflection camera automatically grabs all needed settings from the camera which currently renders the water: be it main camera or the scene camera. if there is a special "vegetation studio camera" it should be synced as well.
    there is no way to not double the work when it comes to reflections, sorry.
    first: the reflection camera has a quite different view into the scene.
    second: it does not even render into the same target as the main camera.
     
  27. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    443
    Adding OverCloud support to a transparent shader. Here's what it says in the docs.

    For the atmosphere/fog there are two options:
    1. Sample the atmosphere in the vertex shader, interpolate and apply in the fragment shader.
    2. Sample and apply the atmosphere in the fragment shader.

    Method 1
    1. Add OVERCLOUD_COORDS(TEXCOORDXX) to your interpolator struct (usually v2f) and swap out XX for an available interpolator. The Atmosphere struct uses three interpolators so slot XX-XX+2 will be occupied.
    2. Add OVERCLOUD_TRANSFER(worldpos, o) to your vertex function. o is your output struct variable.
    3. Add OVERCLOUD_FRAGMENT(color, screenUV) to the end of your fragment function. screenUV can be calculated from the screen position (usually called screenPos): float2 screenUV = i.screenPos.xy / i.screenPos.w; Alternatively you can use OVERCLOUD_FRAGMENT_LITE(color) if you don’t care about using the scattering mask.

    Method 2
    1. Add OVERCLOUD_FRAGMENT_FULL(color, screenUV, worldPos) to the end of your fragment shader. 6 If you want to support alpha blending with the volumetric clouds using the cloud depth buffer, multiply your alpha with the attenuation function like so: color.a *= CloudAttenuation(distanceToCamera, screenUV, blendFactor); distanceToCamera is the distance from the camera to the fragment in world units. screenUV is again the screen-space UVs. blendFactor controls the strength of the attenuation effect. It is best to play around with this value until it looks good.

    Since I'm no shader person which method seems better to work with Lux. Looking at the Lux Water Surface shader it's not just a simple find the area and copy paste for me. Any help would be appreciated.
     
  28. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,094
    both methods should be fine. 1. however needs you to also edit the vertex to fragment struct and the vertex shader.
    so lets go with method 2. for now. this needs you to call:
    OVERCLOUD_FRAGMENT_FULL(color, screenUV, worldPos)
    if you have a look into "LuxWater_Core" you will find a comment "Custom fog" at line 1196.
    this is were OVERCLOUD_FRAGMENT_FULL(color, screenUV, worldPos) will go.
    you can get rid of all the lines between 1198 and 1231 (#if / #endif) because these will include other fog functions.
    simply delete these, then add

    OVERCLOUD_FRAGMENT_FULL(c, i.grabUV, worldPos)

    color maps to Lux's c, screenUV to Lux's i.grabUV.
     
  29. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    443
    When I tried that it says this and the water is pink - Shader error in 'Lux Water/WaterSurface': undeclared identifier 'color' at Assets/LuxWater/Shaders/Includes/LuxWater_Core.cginc(1197) (on d3d11)

    Here's what it looks where I put the lines of code in the LuxWater_Core.cginc. screenshot01.jpg
     
  30. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    61
    Hi,
    Thank you for this very nice asset cheap at all.
    I have this problem: I want to push this crate into the water so that it floats with the Set To Gerstner script.
    But if I activate the script while the crate is on the sand, it moves as if it were in the waves. How to do ?
    Thank you in advance.
     
  31. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,094
    you have to delete line 1197!
    and lthe comment in line 1199
     
  32. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,094
    gerstner waves for the script are infinite. they are everywhere in the world even if there is no water at all.
    brute force: i would do a raycast. if the distance to the hit point is less than what you get from the gerstner waves the waves do not effect the object.
     
  33. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    61
    I did something that works by comparing the altitude of the object with the sea.
     
  34. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,094
    cheaper than a raycast :)
     
  35. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    61
    H
    I have another problem.
    LuxWater works very well but I have a pond in the center of an island made with Unity's WaterProNighttime.
    When I start the game, the water of the pond disappears! Why ?
    Thank you


     
  36. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,094
    how the hack shall i know?!
     
  37. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    61
    "how the hack shall i know?!" ???
     
  38. SirTwistedStorm

    SirTwistedStorm

    Joined:
    Sep 20, 2015
    Posts:
    182
    Ask the person you bought the water from.
     
  39. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,094
    the geo in the foreground also disappears.
    lux water is pretty bullet proof and has been tested by a lot of users under totally different circumstances. i do not know why it does not show up.
     
  40. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    61
    I put a bad option in Culling Mask !!!
    thanks for the answers
     
  41. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    61
    How to play a sound when the camera is under water? Thank you
     
  42. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,094
    lux underwater rendering only effects rendering.
    you could however use the volume trigger to play sounds. this will not be pixel accurate tho.
    LuxWater_WaterVolume.cs: You may subscribe to OnTriggerEnter and OnTriggerExit.
     
  43. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    305
    Hi,

    When I switched to Deferred the water turned like this


    The edge blend factor is already low 0.25 and if I reduce it more the water starts disappearing, is there anything else I could do to fix that?
     
  44. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,094
    have you tweaked the foam edge blend as well?
     
  45. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    305
    Increasing the view depth made it look better, now I have a problem with the underwater effects, Im using kinematic character controller and the collission doesnt work, if I use a character controller it does, but I couldnt make it work with the kinematic controller asset.
     
  46. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,094
    i am not familiar with the kinematic controller.
    but all you need are a collider, a rigidbody and the LuxWater_WaterVolume-Trigger.cs on the object that shall trigger underwater rendering.
     
  47. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    305
    the kinematic character controller only allows a collider, it doesnt have a rigidbody or character controller thats why its not working
     
  48. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,094
    crazy! you do not want to move colliders as they are static. moving a static collider each frame causes huge costs in the physics engine.
    i am not a physics guy. but from all i have read you always combine a collider and a kinematic rigidbody if you want to move something.
    collision between coliider and collider will never fire OnTriggerEnter.
    it needs a collison between a collider and a (kinematic)rigidbody.

    https://docs.unity3d.com/Manual/CollidersOverview.html

    so if you can't add collider and rigidbody to the playerprefab then add them to the camera. and add the script to the cam as well.
     
    Last edited: Jul 21, 2019
  49. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    305
    Its optimized to work in a different way, anyway I solved it by adding a kinematic rigidbody to the trigger (ocean), hope that doesnt cause performance issues because its huge.
     
  50. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,094
    sjm-tech likes this.