Search Unity

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

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

  1. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    you are welcome ;-)
     
  2. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    thanks ;-)
     
  3. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    Hey lars

    I am wondering what controls the detail normal map in the terrain shader? On some splats it is there but on others there is no detail normal map.
     
  4. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    you simply add the detail normals like you would do when using the regular terrain shader (bumped specular) in the painting tab.
     
  5. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    I mean the detail normal map in the actual Lux material. Right under FresnelStrength.
     
  6. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    lux does not offer any fresnel strength parameter...
     
  7. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    I am not asking correctly.



    I am wondering about the Detail Normal Map below the Terrain Normal Map. It works on most of my terrains but on some it only shows the normal on certain splats.
     
  8. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    ups, could not remember many details about the terrain shader, sorry.
    as far as the "detail normal map" is concerned: this is a normal that get mixed with the normal of splat texture 3 (splat color blue). all other detail splats are nor effected.

    so: showing up the "detail normal map" only on certain splats is correct.

    does that help you?

    lars
     
  9. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    Oh okay. Thanks. Is there a way to get it to work on the other splats?
     
  10. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    well, you would have to edit the shader.
    find (line 228):
    o.Normal = lerp(o.Normal, normal1, splat_control.b);
    and tweak it to your likings like:
    o.Normal = lerp(o.Normal, normal1, splat_control.b + splat_control.a );

    that would fade in the detail normal for splat 3 and splat 4.
    it does not really make sense to blend it on any splat: grass might look pretty weird e.g.
    but if you have 2 different rock textures you might go the way described above.

    lars
     
  11. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    Thank you. I am going to use a weaker normal map and lower the tiling of it. Will look decent and hide any repeating texture pattern. Thanks again
     
  12. Project-Mysh

    Project-Mysh

    Joined:
    Nov 3, 2013
    Posts:
    223
    Sry about that, I mean, your computer.... Im testing it on my laptop and its working fine. Anyway here you have an screenshot comparison ( I wanted to show it in the web player cause its how i want to publish my assests on the store):

    Lux:
    Lux1.jpg

    Custom shader in Shader Forge:
    Lux2.jpg

    How are the first impresions? As I said before, in comparison Lux shader looks more realistic, but Shader Forge custom is more impressive. Lux is using Metalness shader and both are in Deferred.

    P.D: Both are using the same probes. The blur was aplied later.
     
  13. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hi there,
    it looks that shader forge adds more ambient reflection... but on the other hand i can’t really tell:
    shadows are different (so the directional light will be differrent) and may be even some things more.
    best would be to put them to the same scene and capture them side by side.

    lars
     
  14. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    p.s. why do you use the lux metalness shader?
    isn’t shader forger using specular refelectivity like skyshop?

    lars
     
  15. Project-Mysh

    Project-Mysh

    Joined:
    Nov 3, 2013
    Posts:
    223
    Thanks Lars for all of your feedback,

    Im Using Metalness shader casue my plans are to include Metalness and Specular Reflectivity workflow on the assets and actually only Lux have it ( but maybe in Unity 5...). Anyways I switched to specular reflectivity as you said.

    P.D: using the latest version of GitHub and unity 4.5.2f1.

    P.D2: Another bug i found: changing BlinnPhong or CookTorrence is not working in Deferred rendedring.

    Comparison:

    Custom shader forge:
    Lux1.jpg

    LUX:
    Lux2.jpg

    I think there is more spec detail in the custom shader at the center of the wheel, but the quality level its ok in both. There is one last question, can I use LUX in my asset packages to bring a demo scene? (ofc I will use LUX logo on all images using Lux shaders)
     
    Last edited: Sep 21, 2014
  16. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hi there,
    cook torrance and blinn phong SHOULD work in deferred – at least they do for me.
    AO works for me too. you have to make sure, that ao is in the alpha channel though.
    metalness is used by jove 2 and alloy as far as i know.
    and of course you can include lux in your package.

    lars
     
  17. Project-Mysh

    Project-Mysh

    Joined:
    Nov 3, 2013
    Posts:
    223
    Hi Lars,

    Have you get view dependent roughness working on lux shaders? I was trying to fake it with a fresnel, but it's very hard. I think depth it's involved, but i dont know.
    rsz_screen_shot_2013-03-27_at_184510.jpg
     
  18. PartyD0nut

    PartyD0nut

    Joined:
    Mar 24, 2014
    Posts:
    17
    I've got a question about the enviroment probes. Is there a way to create multiple spheres and have them auto assign to object's in a certain range? Because at the moment when i create one sphere it automatically assigns to the setup lux script, but when i create a second one it simply replaces the previous one. From what i gathered from Sébastien Lagarde presentation and ue4.0, you would use the probes to sample multiple area's instead of having one generic sphere for your whole scene.
     
  19. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hi there,
    in order to achieve local probes you will have to assign local cubemaps to the given materials. those overwrite the global assigned cubemaps.
    please have a look at the lux environment probe script (that you would need to create box projected probes anyway).
    and a few pages back in this thread someone published a script that automatiocally assigns local probes based on distance. however: no blending between probes so far...

    lars
     
  20. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    i think it is based on the view direction rather than depth (just like its name says...).
    but i have not given it a try so far.

    lars
     
  21. x_african_warrior_x

    x_african_warrior_x

    Joined:
    Jun 24, 2014
    Posts:
    80
    thx lars
    Unity 2014-11-03 05-23-29-24.jpg Unity 2014-11-05 00-37-57-23.jpg Unity 2014-11-03 04-10-26-40.jpg
     

    Attached Files:

    Last edited: Nov 24, 2014
    Eric2241 and Baldinoboy like this.
  22. PartyD0nut

    PartyD0nut

    Joined:
    Mar 24, 2014
    Posts:
    17
    Thanks for the quick-reply, however the method as you described would assign the cubemaps to the material as a whole not just to the object that's closest to the probe? If so that would cause some inconsistencies because say for example a tile-able asset used in multiple scene's with the same material would then inherit the first reflection cube from scene a, and would look out of place in scene b. The only way around this i suppose is adding the reflection cubes to the objects on run time, but that would cause the second problem of every material becoming it's own instance and breaking static batching?

    And i was aware of the cubemap assign script, i was wondering however for simple reflection probes.
     
  23. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    you are absolutely right: local cubemaps and static batching or shared materials are a "problem".
    so if you want to assign a local cubemap you should instantiate (or duplicate...) the material.
    when using tileable-assets i would recommend to create different texture atlases combining some of the assets based on their position and the need for local cubemaps.
    nevertheless: local cubemaps will raise the number of drawcalls.

    lars
     
  24. PartyD0nut

    PartyD0nut

    Joined:
    Mar 24, 2014
    Posts:
    17
    Guess texture atlases would be the most viable solution considering we were planning on that anyway. Got another small question are you planning on creating area lights, or is that something that unity won't allow? Cause point light reflections look kind of funky haha.

    Again thanks for all the work and keeping up with everyone, can't be said enough.
     
  25. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    right now i do not have plans to integrate area lights as uniyt does not allow to store any information about the "size" right now.
    there are other packages which calculate area lights as post effect.
    and other that do it somehow – at least as feature preview ;-)
     
  26. PartyD0nut

    PartyD0nut

    Joined:
    Mar 24, 2014
    Posts:
    17
    Hmm bummer figured as much nothing we can do about that, thanks anyway. And I suppose you're talking about the GI system from the Livenda guys :p?
     
  27. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    yes – and about the unite presentation of shader forge...
     
  28. PartyD0nut

    PartyD0nut

    Joined:
    Mar 24, 2014
    Posts:
    17
    Yeah he actually had a youtube video at the start showcasing a spherical shaped light, so apparently hes had it for a while. And i'm seconding the view dependent roughness, though i have no idea how it's done. Maybe depending on the viewing angle blend the roughness with a gray color? Don't know how that holds up with different materials though.

    Nonetheless if i find anything i'll be sure to share :).
     
  29. HemiMG

    HemiMG

    Joined:
    Jan 17, 2014
    Posts:
    911
    I just downloaded Lux from the Github, but there doesn't seem to be a demo scene for the wetness shader. Or a demo scene for anything for that matter. The one on the asset store has the demo scene, but it doesn't have the wetness shader. Am I missing something somewhere? The asset store package was much larger than the Git download. So I feel like there's something else I should be grabbing from somewhere.
     
  30. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hi there,
    you are right, there is no real demo scene for the wetness shaders in the repo but just some demo assets:
    Lux / Demos / 02 Lux Wetness Assets /
    this folder contains textures and a fbx file with vertex colors.
    problems setting it up?

    lars
     
  31. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Might want to include some wetness sample scene, since it's bit confusing to setup
     
    hopeful and x_african_warrior_x like this.
  32. p87

    p87

    Joined:
    Jun 6, 2013
    Posts:
    318
    what are the capabilities of the terrain shader? any examples, screenshots, docs anywhere?
     
  33. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    p87 likes this.
  34. XRA

    XRA

    Joined:
    Aug 26, 2010
    Posts:
    265
    are there any tricks to getting Box Projection working?
    I went through the steps of adding the LuxEnvProbe to a game object, set the bounds/scale.. assigned my mesh renderers to it with the box projection shader. also have setupLux on an object as well. It looks like i'm just getting a specular blob that moves with me (beneath the camera)
     
  35. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    as far as i can say: no tricks are needed as it just works.
    i suppose that you have downloaded the latest version from github?

    lars
     
  36. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Thanks lars for Lux terrain :)
    It looks gorgeous in Unity Free (this is an oldest Lux version test on examples below)


    Lux + FxLab bloom


    Tree foliage


    The last version has no examples at all :(
    Could it be possible to adapt last version to the terrain and PBS demos scenes ?
    Also could it be possible to have some complete human example with all textures for the shaders ? (i didn't find how to make human shader skin to work , some texture example would help)

    Thanks.
     
    Last edited: Oct 6, 2014
    Baldinoboy likes this.
  37. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Trying Lux - PBS with Quxiel model. Ligthing with a physcially based sky and 1 directional light .

    Note: The model is from Quixel
     

    Attached Files:

    Last edited: Dec 1, 2014
    Baldinoboy likes this.
  38. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    The metal effect is not very pronounced and looks more like traditionnal metal representation using diffuse and specular maps as this is the shader you use also .
     
    Last edited: Oct 6, 2014
  39. scuglik

    scuglik

    Joined:
    Jan 17, 2013
    Posts:
    2
    Hi guys and thank you lars for amazing shaders.
    I have one question. I try to make some scene at underground garage and when I use lux shader I get noisy and grainy specularity. I am begginer in PBR texturing and maybe I do something wrong, but I cant solve this issue by myself.

    Problem appears when I disable IBL specular cubemap in material. When i set cubemap or let cubemap empty, shader is ok. I am using deferred lighting without direct3d 11. Lux hdr_scale is 0. And not every pc has this problem.

    Is it ok to use direct3d 11 option in builder? Because it solve problem but I guess it will make new problems.
    Thank you for any advice.
     
  40. larsbertram1

    larsbertram1

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

    that might be a driver problem... so nothing i can solve, sorry.
    just choose a way that works for you,

    lars
     
  41. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    I figured out that I didn't do the Probes correctly from previous post. Here is the remake version.
    No Tonemapping needed.

    Note: The model is from Quixel

    [Edit] I try to build a Webplayer, but Unity was hanging at "Building assets for scene 0" process .
    Can't build the Webplayer at the moment. I'm using Mac and Unity hangs with "UnityShaderCompiler" in Active Monitor)
     

    Attached Files:

    Last edited: Dec 1, 2014
  42. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hi there,
    exporting a built usually takes some time (about 30 – 45 min) as unity has to compile all shader variants.
    you can get around this by editing the shader code:
    - comment: #pragma multi_compile ...
    - uncomment: #define ...
    please have a look at the docs for further details.

    lars
     
  43. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    I see, didn't expect it takes about 30 – 45 min to build. Thanks for the tips.
    Love your Lux Physically Based Shaders a lot :)
     
  44. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    thanks!
    and 30 - 45 min used to be the regular import time – just before unity 4.3 brought the new shader compiler that only compiles the currently needed versions.
     
  45. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    @lars:
    Will you make some new demos for the last version on Git ?
     
  46. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    may be...
     
  47. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I meaned mainly for the skin shader as it didn't worked as there wasn't textures and materials setup; and if you can just copy back the old terrain exemple demo with tree and grass to the latest version. Thanks.
     
  48. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hi there,
    i have added a demo head (.obj) and the related textures to the github repo next to a short description.
    so it should not be a problem to get the skin shader to work.

    unfortunately i can’t add complete scenes or setups to the repo as it is just a collection of files: not a unity project.

    lars
     
  49. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    If you enable meta files then you can have complete scenes and setups. If you don't want to clog the main repo with meta files, you could always have a separate repo for examples.
     
  50. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    thanks for the hint. i will have a look into it.