Search Unity

Lux-an-open-source-physically-based-shading-framework

Discussion in 'Assets and Asset Store' started by larsbertram1, Mar 19, 2014.

  1. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    Wow! How are you doing the cloud shadows?
     
  2. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    415
    Question: in the decal scene is the tilted decal supposed to look like this:
    decals.PNG

    Also my translucent materials look a bit funky, they flicker around where some parts of the models get this cutout effect
    translucent.PNG

    Btw, the wetness effect makes materials look darker because of light reflects between the layer of water and the material. In order to achieve this I have to paint the water layer black. Should it do that automatically in the shader in order to be more physically correct? related link: https://www.youtube.com/watch?v=wRsprwNpSbE
     
    Last edited: Jun 23, 2016
  3. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    does not look that bad...
    that is definitely not intended and looks like a bug. a z-fighting bug. which rendering mode? which api and which version of unity do you use? gpu?
    lux already handles this for you and darkens albedo according to wetness.
     
  4. invadererik

    invadererik

    Joined:
    Oct 31, 2010
    Posts:
    148
  5. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
  6. invadererik

    invadererik

    Joined:
    Oct 31, 2010
    Posts:
    148
    I was asking about the dithered alpha with temporal AA ( I quoted your post with the hair alpha ) I was wondering what solution (your dithered alpha, with x anti-aliasing solution) you used for that screenshot.
     
  7. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    it is lux dithered alpha and temporal aa from the the upcoming cinematric image effects
     
  8. invadererik

    invadererik

    Joined:
    Oct 31, 2010
    Posts:
    148
    Thanks, sorry if question was confusing.
     
  9. Deleted User

    Deleted User

    Guest

    Substance Painter and Designer. First off this is by far the best SSS / skin shader I've used. I'm putting it into our pipe at work and wondering if I can set up in Painter. I've looked around quite a bit but can't find anything.

    Thanks
     
  10. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    thanks a lot for the flowers. very well appreciated!
    but to be honest: i do not really get the point of your post (maybe caused by rolling back the forums): are you looking for information about how to get the lux skin shader up and running in painter?

    lars
     
  11. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,079
    Skin shader looks like this after using SEGI
    Also it looks same when I enable G-buffer on HBAO asset.

     
  12. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    the skin shader in lux personal is forward only. so the other assets you use seem to rely on a proper gbuffer – which you simply will not have in case any forward rendering shader is present in your scene.
    not a bug in lux – but rather a missing feature in segi...
    as far as hbao is concerned: using the normal depth texture instead of the gbuffer should fix the problem.
     
    ksam2 likes this.
  13. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,079
    Thanks for answer, skin shaders should only be on the forward? why it can't be deferred?
     
  14. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    well, it can be deferred. but that would need Lux plus :)
    currently unity's built in deferred lighting shader only supports one single brdf which is GGX and skin would need a hole different one – which ships with Lux plus.
     
    ksam2 likes this.
  15. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    and just to clarify: you may simply use deferred lighting. but skin will be rendered using forward automatically.
    which works out of the box – unless you use shaders which rely on the gbuffer.
     
  16. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,079
    Thanks but what is Lux plus?
     
  17. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Paid version
     
    ksam2 likes this.
  18. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    Lux plus will bring skin, anisotropic and translucent lighting to deferred.
     
    ksam2 likes this.
  19. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,079
    I can't find this Lux Plus on asset store or anywhere! where is that?
     
  20. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    not published yet...
     
    ksam2 likes this.
  21. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    507
    Can you release skin shader from Lux plus separately? I will buy for sure.
    Also I don't really need other Lux shaders, only skin and maybe glass shader.
     
    Last edited: Jul 25, 2016
  22. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    unfortunately, no.
     
    Crossway likes this.
  23. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    507
    Is there any release date?
     
  24. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    not yet.
     
  25. TheAlmightyPixel

    TheAlmightyPixel

    Joined:
    Jun 21, 2014
    Posts:
    263
    I saw someone mention global illumination and saying that Lux doesn't support it - is that true?
     
  26. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    Lux supports built in GI from Enlighten.
    Only the tessellaton examples do not – but you can easily activate support for GI in these shaders too.
     
    TheAlmightyPixel likes this.
  27. TheAlmightyPixel

    TheAlmightyPixel

    Joined:
    Jun 21, 2014
    Posts:
    263
    Thanks a lot for the fast reply - this was a deciding factor for me, definitely getting Lux now.
     
  28. ghiboz

    ghiboz

    Joined:
    Sep 7, 2012
    Posts:
    465
    hi @larsbertram1
    congrats for your great job!
    i've a question as a dummy: I'm interested on the snow/rain/puddles feature, to use this, what are the minimum things that I need to add in my project and to use? i've added the lux script and the shaders, etc.. and the snow works, but the rain no...

    thanks
     
  29. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    hi there,
    by "rain" you mean "water accumulation" i guess (rain would need e.g. a rain particle system – which is not included in the package).
    so if you want to add water/wetness to the surfaces you need to adjust the values in the "Lux Dynamic Weather" script:
    - make sure that "WaterToSnow" is set to: 0.0 (otherwise water/wetness will be frozen.
    - then raise "Accumulated wetness", "Accumulated water in cracks" and/or "Accuulated water in puddles".
    to find out more please have a look at the documentation.

    lars
     
  30. ghiboz

    ghiboz

    Joined:
    Sep 7, 2012
    Posts:
    465
    thanks @larsbertram1 for your fast reply,
    but my question was also by the minimum textures needed to use the water accumulation
    ok the textures used in lux component, but for each single material/mesh, what's needed? a specular? heightmap? vertex paint?

    thanks again
     
  31. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    height map for water accumulation in cracks.
    you should always have a specular map – or at least assign a proper specular color value.
    puddles are defined by a puddle mask.
    please have a look at the lux standard shader interface to find out more.
     
    ghiboz likes this.
  32. JBR-games

    JBR-games

    Joined:
    Sep 26, 2012
    Posts:
    708
    @larsbertram1
    I tested Lux, mainly the dynamic weather in an empty project and it worked great.. Thanks

    I then imported it into an existing project and the terrain stays kind of off white even when snow is off. I'm guessing maybe a compatibility with another shader in the project ? any ideas? sorry if this issue has already been answered and I missed it.

    edit- I deleted all the other shaders in the other packages and reloaded lux and it seems to be working now. thanks again for the great work here
     
    Last edited: Aug 16, 2016
  33. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    you are welcome.
    and feel free to post some results here :)
     
  34. ghiboz

    ghiboz

    Joined:
    Sep 7, 2012
    Posts:
    465
    hello again,
    i've tried to use snow and rain..
    looking in the samples, i've reached to do a thing in a sample scene but not in my scene...
    the material are the same, i've created a script that simply do this:

    Code (CSharp):
    1.  
    2. Shader.SetGlobalFloat("_Lux_SnowAmount", AccumulatedSnow);      Shader.SetGlobalVector("_Lux_RainfallRainSnowIntensity", new Vector3(Rainfall, RainIntensity, SnowIntensity));
    3. Shader.SetGlobalVector("_Lux_WaterFloodlevel", new Vector2(AccumulatedCracks, AccumulatedPuddles));
    4. if (RainRipples)
    5. {
    6.     Shader.SetGlobalTexture("_Lux_RainRipples", RainRipples);
    7. }
    8. Shader.SetGlobalFloat("_Lux_RippleTiling", RippleTiling);
    9. Shader.SetGlobalFloat("_Lux_RippleAnimSpeed", RippleAnimSpeed);
    10. Shader.SetGlobalFloat("_Lux_RippleRefraction", RippleRefraction);
    11.  
    and the snow is perfect, the accumulated rain is also ok, but I can't see the ripples in the water.. what I miss?
    thanks in advance
     
  35. JBR-games

    JBR-games

    Joined:
    Sep 26, 2012
    Posts:
    708
    So the terrain and the grass are changing to snow perfectly. Anyone have any ideas on doing the trees ? I noticed there is an older version of a snow shader system that does trees from lars. Does that still work? Any plans of adding a dynamic snow shader for trees maybe in colormap ultra v3 maybe something compatible with speed tree wind effects. Also as mentioned above ,on terrains i dont seem to be getting ripple effect with rain.
    Thanks
     
  36. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    hi there,

    your script misses at least: Shader.SetGlobalFloat("_Lux_WaterToSnow", ...
    0.0 means that snow has melted and it might rain, 1.0 means that all water is frozen (no ripples, no flow).
    you may test this first.

    if setting "_Lux_WaterToSnow" to 0.0 does not help, please check if you have pushed a proper rain ripple texture to the gpu and enabled the needed keyword in your custom shader (either "_WETNESS_FULL" or "_WETNESS_RIPPLES"). lats thing i can think of would be wrong texture import settings on the rainripple texture. should be: advanced -> bypass srgb sampling.
     
  37. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    hmm, as you can see in the example video there should be ripples on the terrain:

    as the terrain shader does not support height maps it simply takes the blue value from the albedo texture and writes it as height:
    LUX_SET_HEIGHT( o.Albedo.b )
    rain ripples only appear on surfaces which have accumulated a certain amount of water and need "deep" cracks. maybe your albedo.b simply does not give that?
     
    JBR-games likes this.
  38. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    as it was written for unity 3.x i guess you will have to edit the shaders and do some tweaks.
    i might think about adding this to my afs package.
     
    JBR-games likes this.
  39. JBR-games

    JBR-games

    Joined:
    Sep 26, 2012
    Posts:
    708
    Please do :) as that would really complete your packages

    Just had a look at afs v4 looks really good. I was already planning on purchasing colormap V3 this weekend, after seeing how well lux worked. does afs support standard terrain grass, or is it only as independant gameobjects in the scene ?

    Unfortunately i couldn't write a shader to save my life...
    thanks
     
  40. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    it supports terrain and manually placed grass.
     
    JBR-games likes this.
  41. ghiboz

    ghiboz

    Joined:
    Sep 7, 2012
    Posts:
    465
    thanks! i've also tried but nothing.. everything seems ok but the ripples aren't visible...
     
  42. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    have you assigned a correct ripple texture to your script?
    then your shader should be fine. must be something missing in your script or setup.
     
  43. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    397
    Seems like all the shaders under the Lux tab are broken now in 5.4. They are all pink but they are not displaying any errors.
     

    Attached Files:

  44. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    397
    Oh, by the way. Unity 5.5b just released and Lux standard shaders are broken now.
     
  45. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    i haven't tested 5.4 and 5.5 beta yet, sorry
     
    Last edited: Sep 2, 2016
  46. ludos

    ludos

    Joined:
    Nov 14, 2011
    Posts:
    55
    Hi, im currently trying lux with a small project. When i try to make a build i encounter a problem. My scene is completely lit by area lights which change theyr intensity depending on the players position. It works in the editor, but when i make a build all materials are static.
    i am using 5.4.0f3 on OSX. I have tried using deferred and forward. I have set the custom deferred shaders as descried in the docs. The meshes are non static...
    Do you have any hint what i might be missing?
    Thank you

    Edit: Apparently it is not only my scene, but the demo as well that does not allow chaning parameters during runtime.

    Edit 2: I have found the reason: updateLight is only called in edit mode in the LuxAreaLight Script. When i call it from manually from my script that also changes the values it works.
     
    Last edited: Sep 5, 2016
  47. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    to be honest: right now i have no idea.
    and just to clearify: it works in play mode in editor but not in built?
    cheers, lars
     
  48. ArtisticSliz

    ArtisticSliz

    Joined:
    Jan 4, 2014
    Posts:
    40
    The refractive shader has two major conflicts for me: it can't be totally clear, like really high-quality glass is, unless you change the fresnel to be nearly white which is not physically realistic; and it doesn't render any other transparent objects behind the faces, so you can't render double-sided refractive geometry, nor can you put a refractive inside or behind a refractive and have it render. It does some fantastic things with the lighting and make the glass look SO real:

    pasted1.png

    But it has an issue. This next one is your standard shader with the same albedo, alpha, and specular values:
    pasted2.png

    As you can see, refractives don't render backfaces nor even front faces behind other front faces, but DO render the doubled effect on their own faces they aren't rendering. (Kind of paradoxical, that it gives you the refractive effect, but none of the specular, albedo, etc.) Also, if there's a transparent object INSIDE the geometry of the dome, it is simply vanished by the refractive shader. Is there any way to fix this? As a work-around, I tried making the inside layer of the glass separate from the outside layer, and assigning the refractive to one and the reflective to the other, but it doesn't fix the problem. The refractive side still blocks the transparent objects from rendering.

    The basic transparent objects, rendered with no culling and double-sided faces, can give extremely accurate results for specular reflections of lights. It's really excellent. I just want this level of detail with the refractive.

    I know that this may be a big request, and if I simply can't have it fixed, I understand. But double-sided refraction without this bug would come in handy for me in many places in my game.
     
  49. ArtisticSliz

    ArtisticSliz

    Joined:
    Jan 4, 2014
    Posts:
    40
    On this note, I'd think you really don't need to render refraction for front- and back-faces, as the refraction itself in almost all cases blocks you from seeing the interior edges of objects. Only rendering front-faces works as long as front-faces behind front-faces rendered with proper specularity and such. Especially for thick-bodied refractives, like this glass dome, being able to see the thickness is important. Am I missing something on that?
     
    Last edited: Sep 8, 2016
  50. ArtisticSliz

    ArtisticSliz

    Joined:
    Jan 4, 2014
    Posts:
    40
    I think Baldino asked this as well, but what cloud rendering system are you using that allows for shadow casting?