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

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

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

  1. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    my goodness... I just found your post today, Still have the thread watched. And good question! Haven't really heard anything from Lars for a while now.

    Point being, if Lars is up to something, he will most likely be adapting the entire thing for Unity 5. Who knows? ;)

    EDIT: OOPS! Read a few previous posts and realised what's going on! :D
     
  2. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    lux 2.0 is coming (some shader are already up at github). it will be for unity 5 and not be built upon custom lighting but rather use the new pbs lighting from unity 5.
     
    id0 and Baldinoboy like this.
  3. Alabatross

    Alabatross

    Joined:
    Dec 15, 2012
    Posts:
    223
    Afraid not it seems, but we're still using them (1.0) in Unity 5. Much nicer to work with, tons of control :)
     
  4. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Maybe you need to create a new thread for 2.0 just to make the discussion clean.
     
    hopeful likes this.
  5. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
    So I was checking out the texture postprocessor script and I am not seeing any effect at all. I followed the instructions to a T.

    I get the console log that the filtering is succesfull but I see no result in the actual specularity alpha texture.

    Do I need to use the Lux shaders for this postprocessor? It doesn't mention that in the TexturePostprocessor.txt file.
     
  6. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    have you checked the mip levels?
     
  7. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
    I have now. Works beautifully.

    Thank you very much.
     
  8. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    you are welcome!
     
  9. RockSPb

    RockSPb

    Joined:
    Feb 6, 2015
    Posts:
    112
    Hello. First of all my respects for your job)
    So i have a question, is it possable to use your cubemap baking and convolution tools in realtime builed project?
     
  10. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    it is not optimized for speed… so without any improvements i would say: no.
     
  11. RockSPb

    RockSPb

    Joined:
    Feb 6, 2015
    Posts:
    112
    I undertand that isn't optimized=) We have full procedural geometry. its a house and we need some lighting solution that can be rebuilded in realtime when we need (ofcouse not in one millisecond, maybe in background process)
     
  12. RockSPb

    RockSPb

    Joined:
    Feb 6, 2015
    Posts:
    112
    Ok! Here is an exemple.
    Unity 5 and 4.6.5
    So I bake cube maps 2 time and increase exposition of diffuse for 5...
    Its looks close (in Unity 5 bounce increase for 2). But in theory I can redo this in standealone build)

    I Start bake cube maps forom neutral one because of no ambient light in scene
     
    Last edited: Jun 13, 2015
  13. RockSPb

    RockSPb

    Joined:
    Feb 6, 2015
    Posts:
    112
    \

    Don't work in project rebuilded from svn(after completely crash)((
     
  14. RockSPb

    RockSPb

    Joined:
    Feb 6, 2015
    Posts:
    112

    your foliage shafers looks like AAA+ =)
     
  15. RockSPb

    RockSPb

    Joined:
    Feb 6, 2015
    Posts:
    112

    +SMAA of course
     
  16. Duende

    Duende

    Joined:
    Oct 11, 2014
    Posts:
    200
    Hi,

    Lux Wet Shaders Demo uses two textures: RoughConcrete [Specular][Roughness] and RoughConcrete [Height][Noise].





    How do I create these textures in GIMP or Photoshop?
     
  17. larsbertram1

    larsbertram1

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

    specular
    is a "regular" specular texture: usually an uncolored dark gray for non metals (the texture from the package was taken from magascan’s demo materials) (3 channels, 24 bit).

    roughness or smoothness
    is a "regular" roughness/smoothness texture (1 channel, 8 bit).

    specular goes to rgb, roughness to alpha.


    height

    is a "regular" height map (1 channel, 8 bit).

    noise
    noise is just a noise pattern for the puddles (1 channel, 8 bit). you could google for "perlin noise texture", paint it or just copy one channel from another tiling texture like marble.

    Height is stored in the Alpha Channel, Puddle noise is taken from the red color channel. both us the tiling and offset of the base texture.

    i am not a gimp expert. so i can not help you as far as copying channels is concerned, sorry.

    lars
     
    Duende likes this.
  18. Duende

    Duende

    Joined:
    Oct 11, 2014
    Posts:
    200
    Thank you, lars. :)

    If I have any additional questions I'll let you know.
     
  19. id0

    id0

    Joined:
    Nov 23, 2012
    Posts:
    455
    Hello Lars, I have question. Unity 5 reflection probes is nice and smooth, but they NOT HAVE IBL! Did you planning to make something like in old LUX in LUX 2.0? Or maybe add IBL in unity REflection probe, something like this?
     
  20. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Unity does have IBL o_O
     
  21. id0

    id0

    Joined:
    Nov 23, 2012
    Posts:
    455


    I mean different IBLs inside specific areas, like reflections in reflection probes.
     
  22. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Ah, OK I totally misunderstood you before. Was confusing IBL with reflections :oops:
    It's maybe not an ideal solution, but AFAIK you can get pretty good results with light probes, and I believe it even supports realtime GI (so as the GI updates the light probes do as well). It would be probably perfect if light probe placement wasn't such a pain in the ass -_-
     
  23. id0

    id0

    Joined:
    Nov 23, 2012
    Posts:
    455
    Thing is light probes just don't work without baking scene.
     
  24. iluh

    iluh

    Joined:
    Jun 19, 2015
    Posts:
    4
    Hey, guys! I'm playing with Lux Shaders since for awhile, but can't figure out how to do a decent car paint shader. As for an example, I'm looking at FH2 shaders:

    As I can see, there are several layers, not to mention drops or dirt (i don't think it sparks), with different smothness (u5-wise). How is it achievable with lux? Is it just subshaders? Sorry, I'm a bit new to all this :D
    looking into tri-planar shader then
     
    Last edited: Jun 23, 2015
  25. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    Car paint (and other shiny paint with semi-transparent layers on top) need special shaders to look right. I thinkt here are some packages on the asset store.
     
  26. iluh

    iluh

    Joined:
    Jun 19, 2015
    Posts:
    4
    You're absolutely right on special shader case. Probably, most beautiful one is Car Shaders Assets, but I saw it's using MatCap. All my small experience with MatCap tells me it does not get affected by light and reflection, so what's the use of it? I'm going to contact the publisher on this case. Others seems a bit outdated.
    FH2 uses Clustered Forward+, which is pretty awesome by itself. I think the main idea behind this shader is "rough under-reflection+smooth over reflection", as it was mentioned in alloy framework thread (from the same thread: "its a metallic shader with a glaze over it. metallic has a base and rim color, glaze is a layer you add over it. funny part is they have the same IOR. theres no reflection offset" - http://forum.unity3d.com/threads/al...sion-3-for-unity-5.305178/page-7#post-2151142 ).
    There are a lot of technical papers about pbs car paint, and it seems that there is no decent car paint shader still. Even newest UBER shader (http://forum.unity3d.com/threads/uber-standard-shader-ultra.335493 - from the creator of Relief Terrain Pack and such, released soon) lacks in proper car paint.
    So, that's the question - does Unity capable of doing something this cool?)
     
    Last edited: Jun 23, 2015
  27. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    Absolutely. Someone just has to write those shaders. I'm surprised car shaders didn't to the trick for you. I have no real experience whatsoever with car paint shaders in unity, though, so I can't recommend anything, sorry.
     
  28. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Not in deferred rendering, but you could write a forward-only car shader which does the two-layer thing.
     
    hopeful likes this.
  29. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    I'm not quite sure the two-layer shader would work with actual alpha blending, if that's why you say it wouldn't work with deferred rendering.
     
  30. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    No, that's not why, I mean that you couldn't render the car itself with deferred shading (everything else could be), because it requires a specialized shading model to do the two-layer effect (which isn't possible in deferred rendering, as everything must be rendered with the same shader), so it would have to be done in a forward pass.
     
  31. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    Doesn't the deferred lighting pipeline take care of that? Projects in unity 4 with lots of different shaders were working with deferred lighting just fine, as far as I know.
     
  32. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Not quite. If you use a Surface Shader and you only change the part that generates the bits that are passed to the lighting system, then your shader will be rendered in deferred BUT if you override the lighting model in your shader then Unity must render it in a separate forward pass - so it will work, but will not use deferred rendering for materials using that shader.
     
  33. IFL

    IFL

    Joined:
    Apr 13, 2013
    Posts:
    408
    I love the Skin RC3 shader. Is it entirely @larsbertram1's work? (I want to give proper credit where it's due)
     
    hopeful likes this.
  34. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    it is based on the work of many, especially mr. penner and farfarer.
     
    IFL likes this.
  35. Pretty_In_Punkxo

    Pretty_In_Punkxo

    Joined:
    Jul 28, 2015
    Posts:
    2
    As part of a Uni Assignment i have to create a Treasure Island game in Unity, i came across ATS Colormap Shader and then this, however i have imported the assets for LUX and don't appear to see anything for terrain, a little help would be much appreciated :)
     
  36. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,899
    make sure you get the latest version from github.
     
  37. Pretty_In_Punkxo

    Pretty_In_Punkxo

    Joined:
    Jul 28, 2015
    Posts:
    2
    I'm having two problems with my terrain....

    Firstly the grass's normal map cant be seen, it just looks like sand as shown below https://gyazo.com/d0fe35c41f8f5ab88c55b9efb8f52391 is there a way to make the grass and pebbles more visible and look more like grass and pebbles rather than sand?

    Secondly i can't add any grass textures to the terrain?
     
    Last edited: Aug 17, 2015
  38. larsbertram1

    larsbertram1

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

    hmm, i haven’t looked into the lux terrain shader for more than a year. but it should still work i guess.
    so for the grass normal: check your textures!
    grass textures: that should not be related to lux as it is an editor feature. lux only takes over shading…

    lars
     
  39. joeee19

    joeee19

    Joined:
    Jul 14, 2012
    Posts:
    56
    Hello

    Does terrain shader not work in Unity5?
    Even if import does terrain demo scene under the LUX folder and opens the scene, terrain becomes the pink.

    By the way, I develop it in MAC pro, are you connected with each other?
     

    Attached Files:

  40. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    All I used in Unity 4 for terrains was the Lux terrain shader. In Unity 5 all my terrains turned pink and there where a ton of errors. So no. The Lux terrain shader does not work in Unity 5. Not sure how much editing it would need but Unity 5 does use different lighting and there would no longer be a need for custom diff and spec cubemaps so it would seem you need to start from scratch.
     
  41. joeee19

    joeee19

    Joined:
    Jul 14, 2012
    Posts:
    56
    OK. Thank you for an answer.I wanted to apply normal map to detail( floor and grass) of terrain in ios.

    Do you know any asset looking good free?
     
  42. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    Not for free no. At least not for Unity 5. There is Lars' ats Colormap Terrain Shader though. It is only $10 and looks and performs great. A little more work is needed to set it up opposed to Lux terrain shader but it is much more advanced. The performance is really great. It also has mesh blending but I have not tried it yet.
     
  43. joeee19

    joeee19

    Joined:
    Jul 14, 2012
    Posts:
    56
    > ats Colormap ULTRA Terrain Shader
    I wanted to buy this for some time very very beautifully.

    However, is this the thing which moves lightly in iOS(METAL API)?
    Without a trial version, I hesitated about buying it without being written about Mobile support, and being because there was not the plan to develop PC gaming.
     
  44. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    Not sure about mobile and metal support. This is his thread but maybe ask about that on the ats thread so that other people who have the same question can find it.
     
  45. joeee19

    joeee19

    Joined:
    Jul 14, 2012
    Posts:
    56
    ok. thank you for advice!
     
  46. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    397
    Well, it might be a nooby question. But what about the perfomance on mobile platforms?
     
  47. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    I tested an android build a while back with lux shaders, it tends to depend on your scene complexity.
    I can say that from the performance margin between my pendo pad and my mum's phone, it's probably going to run ok on most modern phones and tablets, since it ran about 20fps on my pendo pad. (It's not that good... :D my mum's phone runs a fair bit faster)

    On top of this, if your game code's well optimized, that leaves a fair bit of room for adding in graphical effects. It all depends on the audience you're targeting as well. :)
     
    Last edited: Oct 8, 2015
    hopeful likes this.
  48. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    A bit late, but I could take a look at the issue and see what I can do. :)
     
    Baldinoboy likes this.
  49. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Again, a bit late, but could you pass me the terrain shaders? It may be as simple as some stupid HLSL error... SOme of my shaders broke on unity 5, and most of it was thanks to unity switching to HLSL!
     
  50. zelmund

    zelmund

    Joined:
    Mar 2, 2012
    Posts:
    437
    hi there
    cant do build by unity itself

    Assets/Lux/Lux Scripts/Lux Cubemapper/Scripts/LuxCubeProcessor.cs(1040,8): error CS8025: Parsing error
    Error building Player because scripts had compiler errors

    any advice ? because cool shaders totaly useless if they cant be used in game ;)