Search Unity

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

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

  1. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    Just a little problem I have:

    So far I modify the shader whenever I want to use custom made map with (A) into a new texture map ... or when I want to add more maps that takes two channel (per pixel anisotropic hair) and pack them within normal (reconstructing the lost basis in shader)

    Despite my best effort I was never able to find a (free) program that allow me to edit the (A) and packed it with (RGB) map (does not works with photoshop cs2), they either cut away anything (RGB) that is transparent in (A) or do weird optimization, or it's the (A) map that is totally wonky.

    Is someone have a recommended program and workflow to have that damn cool seamless and complete (RGBA) texture?
     
  2. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    I use GIMP and can insert, modify, edit, whatever including the alpha channel just fine. Is a little tricky to get used to but once you do it is a really powerful program. Let me know if you have specific questions and I will try my best to help.
     
    EddieLopes and hopeful like this.
  3. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    What texture format did you use?
     
  4. TheGraficalOne

    TheGraficalOne

    Joined:
    Feb 14, 2014
    Posts:
    50
    Hello, if anyone can help me I would greatly appreciate it. I just installed Unity 4.6.1. I also installed Lux from github and extracted the zip into my assets folder with no errors.
    My problem is whenever I try to configure a material with the Lux shaders the object turns pink and I get error similar to this,
    (Shader error in 'Lux/Bumped Specular Metalness': failed to open source file: 'LuxCore/LuxLightingDirect.cginc' at line 40).

    This seems to be the case no matter the shader I use .
     
  5. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    @Baldinoboy
    Thanks I have installed it, I'lll give it a try soon.

    I'll also try to do experiment with porting Lux to vertex based lighting soon, for anyone interested.
     
    zyzyx likes this.
  6. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    check if you have downloaded the "LuxCore/LuxLightingDirect.cginc" and placed it into the correct folder.
    check the gihub repo if not.
     
  7. TheGraficalOne

    TheGraficalOne

    Joined:
    Feb 14, 2014
    Posts:
    50
    Thanks for the reply. I already tried this and all the shaders still gave the error. Thankfully I found an odd solution!

    After after exhausting myself trying to figure out what was wrong with the .cginc file, I decided to locate the part of the shader's code that gave me the error and cut it . After this the shader worked with no problem. So I decided to re-paste the part giving me the errors and isolate the problem, but strangely, there were none.

    My solution was simply to select, and cut the( #include "../LuxCore/LuxLightingDirect.cginc"), then save and re-paste it in all the shader scripts that I needed!

    Don't know how it worked,but I haven't got another error since.

    On a side note, thanks giving us a free PBR shading framework! Every thing looks so much better!

    Now I just need to to learn how to make my own PBR shading textures :(
     
  8. Arkham

    Arkham

    Joined:
    Dec 16, 2013
    Posts:
    9
    Got a question about cubemap mipmaps.
    I've been trying to get my own cubemaps to have mips, but nothing I've tried works. (I have the MipMaps checkbox checked in the Inspector and all that.) Based on the advice to someone else from earlier in this thread, I thought I'd give the Lux Cubemapper a shot. While it appears to properly convolve the diffuse cubemap, I can't tell that it's doing anything to the specular map.

    In particular, the results in the project browser do not look like the results from the cubemaps included with Lux, which actually have an expandable display of the contained mipmap levels. Those you can see here:

    lux_cubemap_mip.JPG
    These specular cubemaps (one HDR, one LDR) included with Lux are the only ones that properly vary their sharpness/bluriness the way I'd expect; any other cubemap I've tried to use, including the one that I ran through the Lux Cubemapper, have details that looks way too sharp (causing most surfaces to look more perfectly reflective than they should). And in the project browser, they look like any other cubemap would (no expandable display showing the mip levels). This makes me think that my own cubemap either does not have mipmaps, or the Lux shaders are not detecting the mipmaps somehow because of how they're implemented.

    Can I get some clarification on how these cubemaps included with Lux were generated, so I can get my own cubemap working like these?
     
  9. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    when using the lux cubemapper you have to convolve the specular reflection probe after capturing.
    this just works fine as far as i can say.
     
  10. tynew

    tynew

    Joined:
    Sep 25, 2013
    Posts:
    122
    What kind of sun values is everyone using? Is it okay to tamper with the sun as well as the IBL diff and spec values to be other than 1? We had to put our sun value to about 2.0 to look okay during day time.
     
    Last edited: Feb 26, 2015
  11. Arkham

    Arkham

    Joined:
    Dec 16, 2013
    Posts:
    9
    But what if I want to simply convolve/mip an existing cubemap (into the format/implementation pictured above)? Is capturing the scene within Unity into a cubemap necessary somehow?
     
  12. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Umm you can do that btw (as long as the cubemapper not changed), just put the cubemap manually into the cubemaps slot in the LuxProbe inspector and convolve the cubemap.
     
  13. Arkham

    Arkham

    Joined:
    Dec 16, 2013
    Posts:
    9
    Yes, that's what I mentioned I did before. But the problem I'm having is, that method does not appear to add mipmaps to the convolved cubemap, which is what I need. The screenshot I posted previously shows what the free cubemaps included with Lux look like; I'm trying to figure out how to get that mipmap setup to work with my own otherwise already-existing-but-mipless cubemap.
     
  14. Alabatross

    Alabatross

    Joined:
    Dec 15, 2012
    Posts:
    223
    So I noticed today that lux seems to break SSAO in u5

    here is the scene with nothing but a camera with the SSAOPro plugin (from asset store), plane, cube, and directional light:


    And here it is with setup lux added and the materials changed to a lux material


    it seems inverted

    other settings im using are linear, dx11, and deferred rendering
     
  15. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    hi there,
    first: why would you use lux with unity 5?
    second: ssao relies on the depth buffer. and lux uses it’s own depth passes (needed in unity 4 / open gl / dx9).
    i guess the plugin does not support custom "render types".
     
  16. Alabatross

    Alabatross

    Joined:
    Dec 15, 2012
    Posts:
    223
    We need a way to override cubemap reflections on a material basis rather than a mesh basis, so we need to continue using lux. Unity 5 does not support this I believe
     
  17. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    what is about using the anchor overwrite property?
     
  18. Alabatross

    Alabatross

    Joined:
    Dec 15, 2012
    Posts:
    223
    From what I can tell you set that in the mesh renderer slot, so it affects the entire object rather than each material. Am I mistaken?

    so if we have a wall that needs to stay a single mesh (for destruction), the inner faces need one cubemap and the outer faces need another.
     
  19. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
  20. Alabatross

    Alabatross

    Joined:
    Dec 15, 2012
    Posts:
    223
    Is it possible you can fix this conflict for atleast bumped specular metalness, as that's our primary material
     
  21. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    which conflict?
     
  22. Alabatross

    Alabatross

    Joined:
    Dec 15, 2012
    Posts:
    223
    between the depth pass of lux and SSAO
     
  23. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    you may try a "regular" depth pass by editing the shader.
    or may look for any "Camera-DepthNormalTexture.shader" and "Camera-DepthTexture.shader". are there any others than the ones from the lux package in your project? in this case you might have to merge those.

    lars
     
  24. Alabatross

    Alabatross

    Joined:
    Dec 15, 2012
    Posts:
    223
    I just did a search for "Camera-depth" in my project and the only two I have are the lux shaders
     
  25. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    ups, i just had a look into the "Lux/Bumped Specular" shader: there is no own depth pass defined.
    it uses: Tags { "RenderType"="Opaque" } – so it should be absolutely ok...

    i have no idea what else might cause your problems, sorry.
     
  26. Alabatross

    Alabatross

    Joined:
    Dec 15, 2012
    Posts:
    223
    Weird, I just noticed this inverted AO glitch only happens in the editor, not in any of our builds. A lux shader in the scene does cause it to happen though

    I guess it's fine then, thanks for the help!
     
  27. altrouge

    altrouge

    Joined:
    Mar 6, 2015
    Posts:
    1
    Hello. I am new to the LUX shader and is now playing with the demo scene. I find that in default SetupLux.cs, it is disabled that one can get real-time feedback on the effect of shader when tuning parameters in play-mode. I wonder whether it will be harmful if I enable it? Thanks for help.
     
  28. Deleted User

    Deleted User

    Guest

    Tried Using the Lux/Human/Skin RC3 in Unity 5 and ended up with the following errors:

    ScreenHunter_202 Mar. 29 12.05.png ScreenHunter_203 Mar. 29 12.06.png

    There was no basic install document with it, so I just copied the master folder to Assets folder. Is there anything besides that I need to do?

    I'm also currently unable to re-select the BRDF texture. I've set it to Clamp, and bypass sRGB sampling.
     
    Last edited by a moderator: Mar 29, 2015
  29. wdw89

    wdw89

    Joined:
    Mar 28, 2015
    Posts:
    4
    Hello, I want to use your hair shader and notice the shader uses alpha test. Then I try to modify it to use both alpha test and alpha blend. But I just start to learn shader so I don't know is there any bugs or side effects. Can you take a look at it? Thanks. I upload the hair shader and models which from your lux 2.0 package.
    I use //***** in the shader to indicate my modification.
    The image is captured in unity 4.5.
    lux hair.jpg
    And I try your Lux 2.0 hair shader in unity 5. The material shows pink color. I hope you can fix it :)
     

    Attached Files:

  30. wdw89

    wdw89

    Joined:
    Mar 28, 2015
    Posts:
    4
    Hello, I found an alpha order problem with my modified hair shader when there is transparent object intersect with the hair :(
    So I think alpha to mask (alpha to coverage) should be better method to solve the alpha order problem.
     
  31. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    right now you can only do alpha testing.
     
  32. Korno

    Korno

    Joined:
    Oct 26, 2014
    Posts:
    518
    Just a quick question, How well does this play with Unities PBR Standard Shader Does Lux completely replace it or can they work together?
     
  33. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    I love Lux, but it looks like the fresnel/specular doesn't quite carry over to Unity 5 with the correct intensity. Spose I'll move onto the Standard shader as well, but I really miss having all the extra control of everything with Lux. Thanks again for the great plugin!
     
  34. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    i would not recommend to use lux with unity 5.
    however you will find shaders bringing lux features to unity 5 here:
    https://github.com/larsbertram69/Lux_2.0

    (will have to update the repo though)
     
  35. Alabatross

    Alabatross

    Joined:
    Dec 15, 2012
    Posts:
    223
    It's a shame we're considering dropping lux too, was perfect in Unity 4. Loved the control. We've been trying to make it work, but the killer was finally finding out U5 point light shadows don't work in Unity 5 with lux

    Lars would it be possible for you to make a quick edit to Unity's standard PBR shader to have an override slot for diffuse/specular cubemaps like lux? Once that's out of the way we can start playing with other things including lux 2.0
     
    Last edited: Apr 6, 2015
  36. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    I have moved to the standard shader. Will probably use the wet shaders and will definitely use the snow shaders when doing a fitting project. One thing I do really miss from Lux is the terrain shader. A colormap, normalmap, and detail normal makes the terrain look like a terrain and not a muddy mess. Especially when using textures setup to be PB. No detail slot or anything with the standard terrain shader. Works but does not look great. Not sure if a terrain shader is going to get into Lux 2.0 but it would be amazing.
     
    nxrighthere likes this.
  37. neroziros

    neroziros

    Joined:
    Aug 25, 2012
    Posts:
    129
    Hi there!

    Thank you for such amazing asset. I was playing with it and a question came up: is it possible to have localized puddles with it? I mean, I was using a lux material with the terrain and noticed that as the water level rose the puddles appeared all over it. I´d like the localized puddles effect to be able to emulate rain

    Cheers and thanks again for this asset,
    José
     
  38. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    would be possible, yes.
     
  39. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    lars, can you elaborate more about how it would be done? For my project, I need to know where the puddles are or to control their placement / formation in some way.
     
  40. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    well, that is up to you... sorry.
     
  41. Botanika

    Botanika

    Joined:
    Nov 2, 2013
    Posts:
    60
    Lux wetness shaders use 2 vertex color channel (the blue and the green iirc), one of them controls the puddles placement.
     
    Exeneva likes this.
  42. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,079
    What happened with your PBR skin shader for Unity5? :(
     
  43. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    it has evolved!

    Bildschirmfoto 2015-04-18 um 03.14.25.png

    Bildschirmfoto 2015-04-18 um 03.28.31.png

    Bildschirmfoto 2015-04-18 um 03.34.27.png
     
    Last edited: Apr 18, 2015
  44. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
  45. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    This looks better to me than the UL skin. But I look forward to the response from Lars. :)
     
  46. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,900
    i do not know the shader in unity labs.
     
  47. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,079
  48. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,079
    Why you would not recommend to use lux with unity 5? :eek:
     
  49. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Maybe he meant Lux 1.0....the old version....not 2.0
     
    ksam2 likes this.
  50. rebit

    rebit

    Joined:
    Nov 13, 2014
    Posts:
    133
    Hello i looked at github and the last commit was 8 months ago. Lux Shaders still in development ?
    regards.