Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[RELEASED] Lux Water

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

  1. Zaki_X

    Zaki_X

    Joined:
    Jul 5, 2016
    Posts:
    55
    I'm using lots of lights (dozens) with deferred rendering path, but lighting a water surface with all of them isn't that important. I could use only a couple of them to light up a water surface. What I want to achieve is a flooded room/building that a player can explore by walking across it and from time to time he would be able to swim or dive. Water would have to be attached to a plane or a box (volume). Believable surface of a pool and underwater fog are crucial here.
    Ps.Unfortunately I can't show you this interior. I could do a 3d prototype, but I think that my description cleared up what I meant :).
     
    Last edited: Aug 28, 2018
  2. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    well, then you could give lux water a try (it is just 9$ :) )
    the next update will bring water projectors which will let you project local foam and normals on top of the water surface to get some kind of interaction. it is no simulation tho.
     
  3. Zaki_X

    Zaki_X

    Joined:
    Jul 5, 2016
    Posts:
    55
    As I own most of your assets/shaders and i'm really happy with how these work I'll buy it. I will be afk for a couple of days though so I'll write something more about your water asset next week. Btw. does it work ok with your other shaders without problems or do I have to switch something somewhere? :p I'm using Lux, ATG, AFS.
     
  4. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    Lux water is forward. so it does not have any influence on the defered lighting of e.g. Lux.
    looking forward to read your feedback.
     
  5. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    250
    Thank you so much for detailed explanation. I am pretty new to Unity and honestly not so well versed with tweaking assets and effects.

    I will follow your asset and continue work on my game. Hope some day you will have these features.
    Or I will be an expert enough to make these changes :)
     
  6. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    well, then if volumetric fully lit underwater fog is not absolutely needed by the gameplay you may just go with the solution currently available and work on other things: usually time just works for you :)
     
  7. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    version 1.04 has been submitted – which brings a preview of the water projectors and some minor fixes.
     
    sjm-tech and Rowlan like this.
  8. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    version 1.04 now is available.
    i am looking forward to your feedback regarding water projectors.
     
    Rowlan likes this.
  9. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    733
    Just tested ... fantastic update!
    The foam projection is very nice and normal projection super realistic! :)
    I'm just imagine what can be done mixing both together.
    Now to do a good use of them we need a contact water detection and a buoyancy system.:p
     
    hopeful likes this.
  10. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    Showing the projectors in action (coder's art, sorry):

     
  11. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    i started to work on a simple c# script which picks up the settings from your water material and calculates the displacement according to the gerstner waves. no buoyancy, no physics right now, but a good starting point i hope.
     
    Mark_01 and sjm-tech like this.
  12. zmaxz

    zmaxz

    Joined:
    Sep 26, 2012
    Posts:
    143
    Do you have any plans for edge length based tessellation ?
     
  13. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    i haven't made a decision yet.
     
  14. mmaclaurin

    mmaclaurin

    Joined:
    Dec 18, 2016
    Posts:
    244
    Just updated to the projector preview and got this error (on a macbook pro w/gpu)

    > Shader error in 'Lux Water/WaterSurface': Too many texture interpolators would be used for ForwardBase pass (11 out of max 10) at line 166
     
  15. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Hi @larsbertram1 ! I recently bought your asset, but when you test your example scenes, the water shader is not displayed and only the white mesh is visible. It seems that it is the same error that also happens to @mmaclaurin

    When looking at the shaders it is seen that one throws error and another warning. I leave photo.
    LuxWaterProblem.jpg LuxWaterProblem2.jpg

    How can I solve that?? Unity version 2018.2.0f2

    a greeting
     
  16. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    I have the same. Until lars fixes it you might try to increase the shader model version. Opening "LuxWater.shader" and changing "#pragma target 3.0" to "#pragma target 5.0" worked for me, given your gfx card supports shader model 5.
     
    onefaceoneface and ftejada like this.
  17. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    i submitted version 1.041 which fixes this issue on sunday, so it might go online today or tomorrow.
    if you need the fix right now please send me an email or pm with your email address.
     
    mmaclaurin likes this.
  18. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    see above :(
     
    ftejada likes this.
  19. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    I have a feature request, if I may: The problem: I have an animated dragon in the water and in order to make the projector look right I have to attach the prefab to the head which is deep down in a hierarchy of model parts (pelvis -> spine -> neck -> ...) to make it look like this:

    dragon 01.jpg

    I rather prefer to optionally attach the projector directly to my dragon at the root of the gameobject and then just drag the projector source to an (optional?) attribute in the LuxWater Projector script. Would that be possible? Of course I could code it myself, but with every update I'd have to change this for one and for the other, I guess it would be helpful for others as well.
     
  20. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    i do not think that i get you, sorry. do you want to decouple the projector script from the renderer (mesh renderer particle system) into 2 individual game objects? if so, why?
    in case of your dragon i think you will have to use some kind of smooth follow script anyway as the projector should be placed at y position = y position of the water plane.

    projector.jpg
     
  21. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    no, i just don't want to put the projector deep down in the hierarchy of my character. either way thanks for your image, you have a good point there and a smooth follow script would actually make it look even better. i'd have to turn the projector on and off anyway depending on which part of the character is in the water
     
  22. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Corrected. Thank you very much for your help.

    regards
     
  23. mmaclaurin

    mmaclaurin

    Joined:
    Dec 18, 2016
    Posts:
    244
    Thank you! I knew it was an early release so didn't impact me. This shader is amazing and your response is so fast! Happy to help, it's more than worth it for me.
     
  24. mmaclaurin

    mmaclaurin

    Joined:
    Dec 18, 2016
    Posts:
    244
    Some WIP, lux is so lovely in its subtlety. spotlight interactions are gorgeous. Lighting and haze from Enviro (not fully integrated with lux yet but on the way)

    Golden hour




    Sailing at night (spotlight comes on halfway thru)

     
    RendCycle and Rowlan like this.
  25. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    version 1.041 is now online.
     
    onefaceoneface and sjm-tech like this.
  26. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    thanks, and your videos look nice!
    it seems as if you are targeting mobile. so do you have any numbers of how it performs on android or ios?
    it also seems as if you were using planar reflections. but the boat itself does not get reflected? at least it looks a bit "ungrounded" on the water. you may try to increase reflectivity tho by raising the specular color a bit.
    and finally just my personal opinion here: in case you do not want to make a viking game taking place in the caribbean i would add some more underwater fog as neither the baltic nor the north sea do have such crystal clear water :) might have been different a few hundred years ago tho.
     
  27. mmaclaurin

    mmaclaurin

    Joined:
    Dec 18, 2016
    Posts:
    244
    trying again....
    Thanks!

    My game is secretly about global warming :D But I will try some more murk!!

    I will try tuning the specularity. This video was captured on Mac but iPhone planar reflections look better on device because of the crazy pixel count & density.

    This setup is getting about 29fps on iPhone X with 1/8 scale planar reflects. Expecting a frame or two improvement when Enviro releases their lighter version, and another few from random tuning. Might have to give up triplanar mapping on the terrain to fit in tone mapping and AI.
     
  28. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    29 fps is not much :( how many fps do you get without the water? and how many with water on but without planar reflections?
    planar reflections are quite expensive. they are more accurate compared to cubemap reflections of course but in case there is something interesting going on regarding the water surface and you add some more fog to give a better sense of depth cubemaps might just be enough.
    you should definitely do this: triplanar mapping is just a killer!
     
    Last edited: Sep 5, 2018
  29. mmaclaurin

    mmaclaurin

    Joined:
    Dec 18, 2016
    Posts:
    244
    I should mention it's also an infinite world :) If I can get a rock-solid 30 I'll be happy. I'll do some tests for you this weekend - I think the terrains are most of my budget. Microsplat is super-fast but not free :D
     
  30. sadicus

    sadicus

    Joined:
    Jan 28, 2012
    Posts:
    272
    Hi, just purchased LuxWater. I am interested in underwater ocean tutorial.
    How to visualize the "Water Volume Mesh"?
    as shown in PDF with (no page numbers) Thanks!
     
  31. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    i am not sure what you are referring to. i just searched for "visualize" but could not found it in the docs.
    anyway: in order to see how the water volume will be rendered in your scene you can simply replace the water surface mesh with the mesh you use as water volume. then the water should show the volume.
     
  32. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    733
    Are you meaning something like that?
    Lux-Water-Volume.jpg
    • Drag in your scene "WaterVolume_HighTess" mesh from Water Meshes folder and resize it as you like
    • Assign the two material slot starting by someone included in the Demo/Water Materials folder (best if you use two materials than the same assigned to both slots to have the ability to use different settings)
    • Disable "Gerstner waves"
    • Adjust shader settings as you like.
    If you want to go inside the volume and show the underwater fx you need to follow the six steps in the manual (page.15).
     
    Last edited: Sep 7, 2018
  33. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,200
    That should be one of the demo scenes, it's awesome
     
  34. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    250
    I agree! @sjm-tech

    Could you please post some more screen shot where we can see the submerged area like the one here. And how it look in the underwater when there is a light source above the water and below.
    :)
     
  35. sadicus

    sadicus

    Joined:
    Jan 28, 2012
    Posts:
    272
    Thanks sjm-tech! Lars, My apologies, I really don't understand your docs. I think they are probably well written.
    YES! more VISUAL examples!
    I'm not a programmer and like many here have been on a quest for Unity to have a decent Ocean/Underwater for years that just has a few "ready to go" scenes. Tropical Paradise, Open ocean, Beach, Storm, Accurate light fade based on meters; Deep Dive with light fade at 1000 meters, etc. If you are the programmer i'm sure the PDF is great.
    Some of us would benefit with good Video tutorials. Also this Asset is not the only one that needs to be reversed engineered. x20 plus other assets all needing a good manual read.
    At this point (once again) I'm trying to reverse engineer a demo scene, instead of Open the scene drop in a character and go!
    IN FACT ANYONE who has this asset and knows what you're doing and can create a scene based on my needs
    I will PAY to have you set it up. I'm not trying to design a game, I just need a working scene. PM for details.
    ...ceto, UWS, Playway, etc. can anyone tell burnout? lol I've spent the $$$ to get the assets, I can be a loyal customer, I just need a working scene.
     
  36. sadicus

    sadicus

    Joined:
    Jan 28, 2012
    Posts:
    272
    In the demo scenes, where are you getting the cool Rock Textures?
     
  37. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    sjm-tech likes this.
  38. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    the docs already contain some visual examples like how different ior for underwater will effect reflections or the effect of color absorption, fog and fog cancelling absorption... and explain all available settings.
    water can have a thousands different looks. so what i want in the first place is to provide you with the needed information to be able to tweak the shader parameters to get your desired result.

    of course it would be nice to have some kind open database for settings and solutions so i ask anybody here on the thread to share their findings.

    i got some pms during the last weeks concerning different topics of how to tweak settings to get a more pleasant visual result and i will encourage people to do this on the forum instead.

    apart from this lux water has just started. so if you have a look at its visual presentation on the asset store you may simply realize that there is not much time to work on spectacular presentations and more viusal examples :)
     
  39. sadicus

    sadicus

    Joined:
    Jan 28, 2012
    Posts:
    272
    "database for settings and solutions" That sounds like a great idea! Thanks for making this asset, look forward to seeing the progress.
     
    sjm-tech likes this.
  40. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    i started to port the shader to pure cg – which is needed to support tessellation. right now 75% are done. a lot of things still are missing – like support for water volumes – but it seems to be doable. so tess might be an option for one of the next updates.
     
    sjm-tech likes this.
  41. mmaclaurin

    mmaclaurin

    Joined:
    Dec 18, 2016
    Posts:
    244
    Hello @larsbertram1

    Request and a success story:

    My request is for a prefab for doing a trail of ripples behind my boat. I can do a trail of foam or stationary ripples, but not a trail of ripples with the current prefab. As a team of 1, I haven't had a lot of time to dig into particle effects so this would be a big help for me coming up to speed.

    Success story is that Lux is working great for me as an infinite ocean - I have a "cake slice" of ocean that turns with my camera, and it looks great. I know it won't work with Gerstner, but I'm not using that now. Would be happy to contribute to a sample scene. (it's only a few lines of code.)
     
  42. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    what stops you from doing so? if you create the particles in world space it just should be fine.
    it should work with gerstner waves in case you make sure that you shift the water always in steps wich fit the tessellation or vertex distance of the vertices of your water surface mesh.
     
  43. mmaclaurin

    mmaclaurin

    Joined:
    Dec 18, 2016
    Posts:
    244
    1. Nothing stops me on the particle systems except lack of knowledge of the (complex) Unity particles UI. I know I have to learn it someday, though, so this is in the "pure favor" category.

    2. Good point about quantizing the transforms of the ocean surface - I'm not using Gerstner right now anyway, but will keep this in mind in case I want to later.
     
  44. lo-94

    lo-94

    Joined:
    Nov 1, 2013
    Posts:
    282
    Hey I seem to be unable to import the updated version in 2018.1.2f1. Tried deleting package, opening in a clean project, etc. Gets hungup on LuxWater.shader every time
     
  45. KarloE

    KarloE

    Joined:
    Aug 26, 2013
    Posts:
    175
    same happening to me in version 2018.2.8f1, really eager to try it out


    Tried it in 2017.4.1f1, doesnt work either :( help!

    EDIT, succeeded in 2017.4.1f1, ill try again in 2018, really took some time to import

    Ok works in both but took a really long time, maybe should be noted somewhere :)
     
    Last edited: Sep 19, 2018
  46. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    actually i takes some TIME to import: the shader compiles into so many different variants that is takes about 4 min on my core i7 @2.6GHz. so please be patient.
     
  47. tianmowuming

    tianmowuming

    Joined:
    Aug 3, 2015
    Posts:
    9
    This can VR?
     
  48. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    i haven't checked this.
     
  49. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    514
    Hi Lars,

    First off would like to thank you for building a superb water shader. I'm having issues with lighting up the water in my harbor. If i light it up with a couple of point lights set to important i'm getting a weird light popping issue effecting my trees in the scene. Basically it makes the trees pop in and out with different light levels. I'm aware from reading your blog that the water shader uses forward rendering which follows the max pixels lights in the quality settings.

    But even with one light set to important on the water this light popping still remains. I have tried putting the water plane on its own water layer and settings the point light masking to water but this still does not stop this annoying light popping issue.

    Do you have any way to stop this from happening?
     
  50. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,898
    do i get you right: the presence of the water effects the lighting of your trees?

    what kind of trees do you have? speed trees, tree creator trees or fully custom ones?
    which rendering mode do you use, deferred or forward?

    from reading
    i would assume that you are using unity's tree creator trees and terrain billboards, which are rendered as transparents as well. so my first thought would be sorting issues – which however should not be related to lighting.
    you may use the frame debugger to find out in which order things get drawn and if the water simply overwrites your trees under certain conditions.