Search Unity

  1. Unity 2020.2 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

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

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

  1. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,961
    Lars, you are truly a shader magician, amazing what you can make in a few days work : D

    Edit: Btw, did you think any about making a hair shader to compliment this as well?
     
    Last edited: Mar 25, 2014
  2. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,984
    Days? If i could type faster Lux would have cost me not more than 5 minutes ;-)
    And hair mens anisotropic specular highlights means even more work…
    We will see...

    Lars
     
  3. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,250
    I suspected there'd need to be some adjustments. Looking forward to the results! :)
     
  4. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Whatever i'm medium term faffing with atm (not entirely sure what it is yet) is intended to pimp out loads of good stuff, nice awareness and i get to learn lots of things for a long term plan. What I was thinking was having all the systems i figure are great work, even if they oppose, will be given a chance, with an interface or something, so hopefully that should result in the ability to see lux, skyshop, jove all get a look-in in decently different logical situations that infers gameplay, even if there isnt a game, as such, and these not so much opposing (Unlike my water things) as seemingly causing a lot of confusion as to what people need, although I cant factor in alloy atm as I don't have a copy and not so sure with Jove as the creator has taken on quite an ambition away from pbr shaders atm

    I'm hoping to see that there's not a ton of difference from one to the other, other than what just feels 'right', and they all do look great, and i'd like Lux to get a decent look-in a lot because it's definitely not slacking.

    Luckily all my other things i say i will do will end up being useful here so its all to one goal, and it will get done just time involved.

    Also regarding Unity 5's possible threat to these kinds of packages, i think its minimal - its nice of Unity to provide this approach and surely do a good job of it but they won't be able to update things constantly and won't be as flexible as Lux etc, i mean seriously who expects Unity to provide a configurable eye shader? So yes, i think these things can have a long life and no doubt broaden their horizons as they feel necessary, and remain 'agile', in mover and shaker speak
     
  5. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,727
    Days! Github never lies and it says the entire project was created less than a week ago!

    And I'm sure this is your first attempt at shader programming on top! Probably picked up one of them learning pamphlets "Teach yourself shader programming in 24 hours." :)
     
  6. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    It's nice to see some code person bravado going around! If you got it, flaunt it
     
  7. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,727
    As you can see UMA have no problem integrating with LUX, it's merely a matter of having the right specular textures. The wings are using Lux Bumped Specular and the rest of the character is UMA default shaders.

    Please notice the last two sliders, they uses uma to affect the specular channels of the atlas!

    $lux_wings.jpg

    Large webplayer
    http://glscene.com/unity/wings/wings.html

    Smaller webplayer
    http://glscene.com/unity/wings/wings800.html
     
  8. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,869
    WHOA! That sir is impressive, except the wings look a bit out of place in your screenshot... is that due to the atlas adjustment?
     
  9. niosop2

    niosop2

    Joined:
    Jul 23, 2009
    Posts:
    1,059
    It looks different because:

     
  10. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,727
    The goal is to get specular maps for the rest of UMA as well so the lighting can look consistent across the character. I could have balanced this scene a little better by toning the specular color down a bit and such getting a more consistent lighting, but since I'm aiming at using only lux shaders I'll wait with tweaks until it's all there.
     
  11. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    I'm assuming Lux uses gloss maps? Those specular highlights definitely need toning down a great deal and roughened up especially in the thin skin of the wing membranes. An idea for a Lux shader might be a transmissive/sss one, I think Alloy has such a thing, it could get the wings looking really nice, perfect use for it really. Even after importing i havent had a go because of distractions but i'll get to it soon i hope
     
  12. sandboxgod

    sandboxgod

    Joined:
    Sep 27, 2013
    Posts:
    366
    Great looking screenshots you guys this asset looks great :)
     
  13. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,727
    Awesome stuff!

    Can't wait to see a uma character fully rendered with lux. :)
     
  14. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,984
    thanks!
    but i think it is mostly the model and its textures...

    lars
     
  15. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,418
    Looks great lars. Incredible detail. When is the Asset Store going to post Lux?
     
  16. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,984
    i don’t know. i am waiting for it to be approved for about a week.
    may be it is due to gdc?

    but you will always get the latest version from the repository: https://github.com/larsbertram69/Lux

    lars
     
    Last edited: Mar 27, 2014
  17. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,869
    @UnLogick niosop2: fair enough. what does UMA stand for again? I am presuming it's the PBR implementation in Unity 5 that you're talikng about.

    @Lars: A HAIR SHADER?! Or is that just very cleverly modelled strands? :p
     
  18. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,250
    UMA = Unity Multipurpose Avatar

    It's a way of assembling unique humanoids in the editor or in the game at runtime. Procedural people. ;)
     
  19. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,012
    Interesting I found this thread. I actually need a hair shader that is PBR and lux looks like it's up to the task. I should ask you Lars if these shaders will work properly even though I have Alloy... thanks a bunch, and great job here man.
     
  20. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,869
    @hopeful: HUH?! I had no idea this was possible! Just saw it, and i now know where they got 46 values from...

    @Neptune: isn't alloy a metalness workflow tool? I am so sure i read in a recent post that Alloy works ok with lux...
     
  21. niosop2

    niosop2

    Joined:
    Jul 23, 2009
    Posts:
    1,059
    It's another PBR framework/shader pack that also includes some tools, and uses metalness. I would think that having Lux installed w/ Alloy might cause the Alloy shaders to look a little different since I seem to remember that Lux modifies the way Unity handles stuff in deferred a little bit. So, it could work, but you might have to adjust the Alloy shaders/textures to account for that.
     
  22. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,012
    Yeah, I am not gonna risk that right now
     
  23. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,440
    Geezz....Lars....don't you ever take a break....???? :p
     
  24. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,984
    Lux will "break" alloy – or alloy will "break" lux as both ship with a modified prepass lighting shader.
    Where "break" means that thinks will look slightly different after having installed one package over the other.
    But that only happens if you use deferred lighting and on shaders that uses the deferred lighting pass.

    The Lux hair shader however is forward for it comes with its own lighting function giving you anisotropic specular highlights.
    So it just works completely independently and does not interfere with alloy.

    Lars
     
  25. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,727
    Unity Multipurpose Avatar, it is a free open source package. Version 1.0 was launched on the asset store 25th of December. It requires Unity 4.3.1 or higher.
    https://www.assetstore.unity3d.com/#/content/13930

    It is open source in continuous development and there are multiple publishers offering cheap content, character editors and other extensions.
    https://www.assetstore.unity3d.com/#/search/uma

    Since then thousands have downloaded the package and played around with it. The latest release 1.1 correctly handles additional bones, like the wings I showed in a previous post.

    The uma shaders have always been a weak spot. The quality wasn't amazing and it required special pre-processing of the textures. Many people have been looking at Marmoset and Skyshop, wishing for a higher quality. And now with Lux being open source we can finally reach that higher quality. We will still support the old uma shaders for mobile and other weak platforms.

    Now that Lars have made shaders for skin, eyes and hair, we have our work cut out for us to create the needed specular maps to harness the power. Unfortunately it feels like we have three coders for every artist, so it may take a couple of weeks before we're fully there.

    I suspect we'll do the integration in two steps, first we convert everything to the lux bumped specular shader to get the one draw call advantage. And then we add skin, hair, eye shaders one at a time.
     
  26. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,012
    Sweet man... And hair is all I needed :). Do you think you could create a package of these shaders and put them on the git?

    Nevermind, downloaded the shaders...about to have a play
     
    Last edited: Mar 27, 2014
  27. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,984
    hi there,
    right now im am still finishing the first version of the hair shader.
    i will upload it to the repo as soon as it is done. may be tonight, may be tomorrow.

    lars
     
  28. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,012
    Cool... and I will definitely play with this... Needed a hair solution that can handle many shells
     
  29. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,984
    well – it uses alpha cut out. so shells are no problem…
     
  30. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,984
    Hi there,

    the hair shader is available at the repo:
    https://github.com/larsbertram69/Lux

    please make sure that you read the "_Lux Hair Shader.txt" – especially if you want to use this shader along with solutions such as skyshop or alloy.

    lars
     
  31. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Amazing work Lars! =D

    I´ll have to focus on recording some extra tutorials for UMA, but as soon those are done, I´ll take a good look on providing the necessary textures to get UMA + LUX fully working.

    Cheers
     
  32. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,984
    thanks fernando!
     
  33. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,869
    @lars: YES! a hair shader! turns out i was right... :p And thanks for pointing out the Alloy workflow compatibility, i obviously heard wrong...

    @UnLogick: Yes, i saw that in the asset store: amazing looking asset! and i reckon i know where you got the 46 values from! ;)
     
  34. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,012
    Ehhh, I was hoping to avoid that... I have VERY detailed hair (taken from zbrush, and the cutout shaders are VERY ugly to look at :(
     
  35. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,984
    sorry about that, but anything else would be more than rocket science...
    how would you handle transparency in deferred? or even in forward? and still provide correct real time shadows?
    all there is to hair rendering i am aware right know is using post processing effects.

    lars
     
  36. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,984
    hi there,

    i have completely rewritten the hair shader and added some more features:
    - support for specular shift and noise texture
    - setup the shader according to your uv layout / tangent orientation: it is now a bit less picky (and much more accurate).

    so that is how it looks now:




    lars
     
  37. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,320
    Can I use Lux alongside Substance Designer PBR substances in Deferred Lighting mode? I know the docs say that it overwrites the specular computation, but so far the highlights on both Lux and Substance objects seem to be ok, but I haven't really spent much time testing. If not, is there a way to export the maps from Substance to match up with Lux and use Lux shaders on them? I'm kind of an idiot at Substance Designer so I don't know how to correctly export specular and metalness maps to make them work in Lux.

    PS - That hair shader looks awesome!
     
  38. niosop2

    niosop2

    Joined:
    Jul 23, 2009
    Posts:
    1,059
    Yes you can, in fact I highly recommend it. Do you have designer or did you just want to use substances? If you have designer you can use the channel Shuffle node to combine the channels to the required layout. There's an SD shader you can use to get results similar to what you'd get in Unity inside the SD 3D view. It's somewhere either earlier in this thread or in the original thread in Showcase. That shader uses the specular workflow, not the metalness one though.

    When it talks about overwriting the specular computation, it does that to work w/ Lux, so using Lux shaders will be fine. It just affects using non-Lux shaders.

    If you don't have designer, I could whip up a substance that would take separate maps and combine them them into a format Lux likes if needed. If you need that, let me know which workflow you would prefer so I know what inputs/outputs to make available.
     
  39. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,320
    Thanks for the quick reply! I do have Designer, though I just got it recently and it still sort of scares me. ;) Specifically I just bought their Indie Pack ( http://www.allegorithmic.com/products/substance-indie-pack ) which has Designer and also includes 30 premade PBR substances. Those were the ones I was wondering if I could use alongside Lux. I don't know how they determine their specularity so I wasn't sure if I could use them out of the box alongside Lux, or if I would need to mess with their specularity maps in Designer.
     
  40. niosop2

    niosop2

    Joined:
    Jul 23, 2009
    Posts:
    1,059
    You'll probably need to mess with them a little bit since using either the metalness or spec workflow in Lux requires packed maps, while (if I recall correctly, not looking at it right now) SD outputs them as separate maps. So you can use the PBR shaders w/ minor modifications, mainly using the channel shuffle node to pack the inputs to the appropriate channels.
     
  41. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    That hair shader looks absolutely beautiful lars, im falling increasingly in love with this thing with every day going by, its growing at a huge rate at superlative quality. I hoped to get to lux-ish stuff today too but everything takes much longer than one expects, but hopefully befire the end of the night i'll have all the relevant terrain maps in place to start trying out the vegetation shaders with RTP when i next wake, and it seems a whole load of fun stuff awaits after that with Lux. Really impressed
     
  42. hd_

    hd_

    Joined:
    Jan 23, 2014
    Posts:
    29
    For anyone interested in working with Lux via Substance Designer 4, I ported the early version of the shader here:
    http://forum.allegorithmic.com/index.php/topic,917.0.html

    I haven't updated it with the new features in Lux, but it will still give you a closer result than the built in shaders. I may get around to it again when I need it, but if someone else wants to do it feel free to !

    As was mentioned, you will likely have to tweak the substances you got with SD4 to match the Lux result, this is due to differences in the shader algorithms/parameters/inputs between various physically based shaders.
     
  43. Beardbotnik

    Beardbotnik

    Joined:
    Jul 27, 2013
    Posts:
    49
    You mention using the hair shader with the likes of Alloy and Skyshop. Do the other PBS shaders you have work with Skyshop?
     
  44. niosop2

    niosop2

    Joined:
    Jul 23, 2009
    Posts:
    1,059
    Yup the cubemaps generated by skyshop work great w/ Lux. I'm assuming the spec on the Skyshop shaders would be a little off if you used those w/ Lux installed though.
     
  45. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,320
    Thank you niosop2 and hd_!
     
  46. Botanika

    Botanika

    Joined:
    Nov 2, 2013
    Posts:
    59
    I re-textured an old model of mine to test Lux shading, and I got to admit I never expected it would work that well, LUX IS AMAZING.



     
  47. Botanika

    Botanika

    Joined:
    Nov 2, 2013
    Posts:
    59

    I highly doubt they would work out of the box, cubemaps in skyshop are convolved in a different manner, Ibl and scene lights wont match.

    you can still capture hdr cubemap probes with Lux, from Skyshop skyboxs.
     
  48. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,250
    How does that compare to this shader? Isn't the Lux one a bit more dull? Or is that just a difference in the models / lighting?

     
  49. niosop2

    niosop2

    Joined:
    Jul 23, 2009
    Posts:
    1,059
    Do they use a different convolution? I was under the impression they were compatible. Could we get confirmation one way or the other from Lars?
     
  50. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    i think lux alters the light prepass shader (only vaguely aware what that is but picked it up while reading things) which affects the specular

    alloy does this too, meaning alloy and lux can kinda break each other, apparently, and im guessing the alteration would change marmosets specular too
     
unityunity