Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

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

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

  1. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    -It was a mesh with 3 non-box projected shaders, and 1 box projected
    -It ran fine on a Mac, but not Windows.
    -I was trying out Botanika's modified set-up scripts
     
  2. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    @squared55: Maybe Botanika's scripts have bugs... But other than this, I have no idea. Could also be a Windows DirectX problem. (Seriously Microsoft!?)
     
  3. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,856
    and such a simple setup ruined the framrate? that sounds crazy as it should even run fluidly on iphone...
    but as fuzzy has written: please try to deactivate the env probe script and export your scene again.
    the box projected shader might not be set up correctly but if it runs better on windows you would have found the problem.

    the original demo scene + box projection + original script runs fine on windows as afar as i can say.

    lars
     
  4. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,524
    Do not know if it was mentioned yet but I noticed a problem when enabling AO. Within shadow distance the objects with AO enabled do not receive fog.

    Here is a screenshot
    $Lux_AO_bug.jpg
     
  5. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,856
    what da f...,
    i have nerver noticed that.
    which shader do the objects use?
    and have you tried to switch to dx11?

    lars
     
  6. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,524
    Lux Bumped Specular

    I have not tried Dx11. My card does not work great in Dx11 mode so I never use it. Will try it now.

    Edit- I enabled Dx11 and the problem went away. So it is a Dx9 problem.
     
    Last edited: May 22, 2014
  7. larsbertram1

    larsbertram1

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

    i have just tested it with dx9 and dx11 – the problem only occurs if you use dx9, ao and forward rendering.
    and i am not sure if i should make the shader more complex to handle this case or not.
    but i will have a look into it.

    lars
     
  8. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,856
    so here comes a quick work around for dx9 and forward lighting.

    edit the shader (the one you want to use ambient occlusion with).
    in "struct Input" comment or delete the following lines:
    Code (csharp):
    1.  
    2. #ifdef LUX_AO_ON
    3.   float2 uv_AO;
    4. #endif
    5.  
    then find:
    Code (csharp):
    1.  
    2. #include "LuxCore/LuxLightingAmbient.cginc"
    3.  
    and replace it with:
    Code (csharp):
    1.  
    2. #define uv_AO uv_MainTex
    3. #include "LuxCore/LuxLightingAmbient.cginc"
    4.  
    lars
     
  9. cadviz

    cadviz

    Joined:
    Jan 17, 2012
    Posts:
    28
    Hi everybody...
    First...
    Many thanks to "larsbertram1" for the nice shader framework... and thanks to all nice guys sharing us their experiments
    Second...
    I am working on an exterior scene, using Marmoset skyshop for lighting...
    I had tried the "Lux Bumped Specular" shader... What had happened is All the objects were reflecting only the HDR panorama used by Skyshop... ignoring to reflect the environment's objects [It is also a skyshop issue ]..!!:(... Same issue Even I used the "Candela SSRR"
    My question is...
    Is there any easy way to achieve real- time reflection with the Lux Shaders...?
    OR, I have to use the "Lux Box Projection Workflow" posted by Botanika, as a must...
    http://forum.unity3d.com/threads/235027-Lux-an-open-source-physically-based-shading-framework
    /page22?p=1621781&viewfull=1#post1621781

    Best Regards
     
    Last edited: May 25, 2014
  10. larsbertram1

    larsbertram1

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

    Lux only supports reflections based on cubemaps – so if you want those to be real time you would have to capture (ok) and convolve (not possible right now) a reflection cubemap in real time.
    you could skip convolving the cubemap if you use it only with materials that have 100% smoothness and are fully reflective.

    but what is about candela? ssrr should just work fine – although i do not know how candela samples information about roughness/smoothness.

    lars
     
  11. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    News : compile must faster with Unity 4.5.x. :D
     
  12. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    @ZJP: I heard about this too. pitty 4.5 isn't out...
     
  13. niosop2

    niosop2

    Joined:
    Jul 23, 2009
    Posts:
    1,059
  14. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    It's out?! OHH YEA!
     
  15. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    :p
     
  16. ludiares

    ludiares

    Joined:
    Jul 14, 2011
    Posts:
    242
  17. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,856
    anybody uses cubemaps nowadays (which are supported by the gpu btw), so i see no point in changing this – especially if i think about keeping lux "compatible" with upcoming unity 5.
    lars
     
  18. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    Haven't been here in awhile :p

    I turned off the cubemaps for lux, because it's not real time, so materials looked weird at night. Btw, is there a way to translate between various cubemaps smoothly? That way i could have various cubemaps for different times of the day and still translate smoothly between them.

    Anyway, here's a gif showing Lux shader on the weapon ( Lux is also used on the terrain with RTP ), along with SE Natural Bloom.
    $lux_bloom.gif (1.84 MB)
     
    Last edited: May 28, 2014
  19. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Aha! Been following No Heroes on and off. I wondered if you guy(s) were going to implement PBR :)
    Is there screen space motion blur too (Amplify Motion)? That plus PBR would push it way into AAA land IMHO.
     
  20. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    Thanks. (btw, it's only me making the game :) )
    No i'm not using any motion blur right now.
     
    Last edited: May 29, 2014
  21. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,524
    The standard shader is going to have to be really epic to take me away from Lux.:D

    Have been following No Heroes since the first vid. Awesome job.

    I am also wondering about a transition. Lowering the HDR is all I could think of.:?

    Is there a way to disable or enable the ambient lighting on all materials without going to every material?
     
    Last edited: May 29, 2014
  22. larsbertram1

    larsbertram1

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

    blending between cubemaps
    personally i would prefer to do it by script and not within the shader because it should be much faster to do it once for all 6 faces of a cubemap than doing it for any pixel on screen any frame.
    so one would have to write a little script that would let you assign 6 (or 8) diffuse and 6 (or 8) specular cubemaps.
    according to the given time, the script would pick 2 of those and blend them into one, then pushes that new one to the lux setup script.
    it would also have to handle all localized and material bound cubemaps.
    bleding diffuse cubemaps just work fine. when blending specular cubemaps especially high mip levels (sharp reflections) might look pretty weird as you will get 2 shadows and 2 specular highlights.
    and alternativ would be to choose the way skyshops goes: enabling sky rotation and adding camera exposure. but that would not fix the problem for high reflective surfaces either. so if you need dynamic reflections i do not see any other possibility but using real time reflections like ssrr.

    lars
     
  23. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    gave lux a tried a I love it :) hard to choose between skyshop and this :O
    Heres my first model with lux :)

    old render as well btw, missing some normal map details
     
    Last edited: Jun 1, 2014
    Botanika likes this.
  24. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,856
    hi tiny man,

    make sure that you get the latest version from github.

    lars
     
  25. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    May I ask the differences are? is it just like a couple of tweaks etc.
     
  26. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,444
    Nice looking gun, though for future renders, DO NOT use black backgrounds to showcase renders :)
     
  27. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    Thanks for the advice, with my final render I'll add some colour (did not think about it and still new to the whole business being 16).
    Another question referring to lux, in the upcoming marmoset you have local cube maps to update your IBL would that maybe be in lux for the future?
    ;)
     
  28. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,444
    That's cool Tiny Man. I started 3D seriously when I was 16... keep it up. And use a value like 31,31,31 in RGB. I have my Unity viewport set up like Maya.
     
  29. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Hm, hey Tiny Man could you post thumbnails of your maps?
     
  30. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Yesterday I worked on a sort of "material library" of sorts. Got some metals done. In order: Gun metal, Grungy Iron, Brushed Steel, and Metal Paint (there's also a block of wood in the background... meh.)

     
    Botanika likes this.
  31. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,785
    Wow...hey guys...it's been a while since the last time i posted in this thread, So i got some free time and decide to play around with Lux in RobotLab Scene, and it was interesting....especially the difference between BP and CT...
    And for the first time i prefer BP, i loved the contrast looks of it's specular :p

    CT


    BP
     
    cadviz and Botanika like this.
  32. TechnicalArtist

    TechnicalArtist

    Joined:
    Jul 9, 2012
    Posts:
    736
    nice
     
  33. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    I just found out lux will use marmoset IBL if you add their skyobject thing a ma bob, so does that mean when they have local cubemap blending it will work with lux?
     
  34. Botanika

    Botanika

    Joined:
    Nov 2, 2013
    Posts:
    60
    Very nice first model, materials could use a little bit more contrast.(Plastic and Metals look kinda similar), but very good start.


    Local Cubemaps are already supported by Lux, however, blending them for moving gameobjects is not .
     
    Last edited: Jun 4, 2014
  35. VicToMeyeZR

    VicToMeyeZR

    Joined:
    Jun 3, 2012
    Posts:
    427
    I have a dumb question..

    In your metalness shader for bumped diffuesd, you have a place for Metalness(R) AO(G) Sepc(b) Rough(A) How is it possible to create a file that has those only on those channels. Red Green Blue is for Red Green Blue.. How do you load say Gold into only R channel> or an AO map into the G channel? I am very confused (and probably dumb)
     
  36. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,856
    hi there,
    you have to use photoshop (or gimp) to create such combined textures.
    each texture like metalness, ambient occlusion, spec and roughness is just a 8 bit grayscale texture so they fit perfectly to the rbga channels of the texture.

    so if you use the metalness workflow gold would have some kind of yellow (use the look up table to get the correct color value) in the diffuse texture. the metalness mask would be white where there is gold.
    you will have to get familiar with editing just the desired color channel in your image editor software.

    lars
     
  37. VicToMeyeZR

    VicToMeyeZR

    Joined:
    Jun 3, 2012
    Posts:
    427
    I use Photoshop CC with the nDO and dDo plugins as well as the swatch for Photoshop. I guess their swatch isn't complete, because it only has specific colors, no grey scale for anything else

    My main problem is, how do you put a grey scale image on a Green channel.? I tried, and it wont copy over to the channel.. or any other color fro that fact. Photoshop doesn't seem to allow anything specific to be put on any one channel, except the Alpha channel
     
  38. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,856
    hi there,
    personally i do not have any problems copying any grayscale image to just a specified channel:
    - copy your grayscale texture to the clipboard
    - open the channel window
    - select the desired color channel
    - paste your grayscale texture
    - done
     
  39. VicToMeyeZR

    VicToMeyeZR

    Joined:
    Jun 3, 2012
    Posts:
    427
    I guess you know more than me. If I try to copy anything, photoshop puts anything new into the RGB channel, which overwrites all RGB channels..
     
  40. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    You have to open the Channels and select the channel you want to paste into (Red, Green, Blue, or Alpha)
     
  41. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,524
    For the people who use GIMP and have this problem here is a link.

    http://gimpforums.com/thread-how-do-you-move-rgb-chanels-from-one-image-to-another

    I asked this question and they gave me a great answer.
     
  42. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Some more of my work with Lux. :)



     
    Last edited: Jun 10, 2014
    SememeS likes this.
  43. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Sharing my results here using LUX for the UMA new race.
    You might recognize the eyes =)
     
  44. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    is it possible to make lux work with shaderforge shaders thx
     
  45. SememeS

    SememeS

    Joined:
    Nov 27, 2012
    Posts:
    127
    Hey everyone!

    First. @larsbertram1 Thanks for Lux. Seriously, it's just simply amazing.

    Btw for those who don't know Quixel suite is out! and Beta is free(even commercially) till september 8

    now to business.

    I was testing Quixel to Lux today and got very very very nice results :)
    Everything came out as should. I'm going to be using this combination from now on.

    So started with a very simple mesh in blender to test. I wanted to use hard surfaces.
    Baked; Color Coordinates, Object Normals, Tangent Normals, and Ambient Occlusion



    Next was in Quixel, with those baked maps you can work the Quixel Magic



    and finally to Unity with Lux shaders. I'm using specifically> Bumped Specular MaterialTest so I can have access to both specular and roughness map separately before combining them







    Can't wait to make more complex materials/meshes with Lux and Quixel

    :D
     
    Last edited: Jun 12, 2014
  46. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    WOOOO Quixel!
     
  47. SememeS

    SememeS

    Joined:
    Nov 27, 2012
    Posts:
    127
    :D thats what I screamed this morning!

    It works so nicely with Lux
     
  48. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    I'm no artist, but I preordered an indie team license - I plan to hire an artist, and I'll probably hand it over to them if they don't already have a freelance license :)
     
  49. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    I had myn preordered like a month ago, finally i can use it (and use it adter the beta ends), too bad i got exams for the next 6 days -_-
     
  50. SememeS

    SememeS

    Joined:
    Nov 27, 2012
    Posts:
    127
    @PhobicGunner They'll be very happy with the BFG you'll be handing them ;)

    @Tiny Man 6 more days and you'll be in texturing/pbr heaven