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
    which of the 3 suggestions worked?
    ;-)
     
  2. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    you probably use a hdr cubemap but have not checked "is hdr" in the set up lux script or vice versa...
     
  3. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    All 3 except for the exp 2 fog, though it does look good but not the same as before. But that's fine because it may be even better than before.
     
  4. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    Removed a few non Lux shaders and a few scripts from my project. Now the same scene that took 4 hrs to build took 2 minutes. I wish there was a facepalm emoticon;). So the unedited Lux shaders do not slow down the build time for me at all.
     
    Eric2241 likes this.
  5. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    Which scripts, maybe it's a unity wide thing?
     
  6. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,123
    I have a question. I haven't looked much into your forum posts. Just kinda stumbled upon lux a second ago. Was wondering how you would accomplish a day and night cycle even though it seems like u would have to bake the reflections.
     
  7. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    well, you could blend the diffuse and specular cubemaps by script: e.g. using 6 diffuse and 6 specular cubemaps.
     
  8. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,123
    Does lux include a method for blending them?
     
  9. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Uhh...someone already did that, he post it in this thread couple page back. Maybe @larsbertram1 can integrate it..
     
  10. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    It was just a few Custom Shader Forge shaders and a few scripts from the community. Though I do not remember which ones. So no Unity scripts were removed.
     
  11. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    Ah, so it's probably not a unity wide problem.
     
  12. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    No but if you are having this problem you should probably backup your project try to find what is causing it.
     
  13. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    Yeah, backups are always a good idea.
     
  14. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    Can I suggest a feature if its not already implemented? Well here it is. The ability to use crook torrence (sorry for any spelling mistakes) on some objects ie: terrain, and blinn phong on others.
     
  15. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    you can already do so by commenting the #pragma multi_compiles and uncommenting the //#defines
    ;-)
    p.s.: that will only work in forward rendering. deferred rendering only knows one single lighting function though.

    lars
     
  16. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    Awesome!
     
  17. kryptopath2

    kryptopath2

    Joined:
    Jul 19, 2013
    Posts:
    104
    hi,
    i just tried your terrainshaders and get the following error:

    NullReferenceException: Object reference not set to an instance of an object
    LuxTerrainControl.Update () (at Assets/Lux/Lux Shader/Terrain/Scripts/LuxTerrainControl.cs:38)

    i am just an artist ;) how can i fix it?
     
  18. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    I get this problem when I use the Ambient Light on the setup Lux terrain script. Using a Lux terrain material on the terrain and it looks great. This error still fills up the console though. Using the latest version of Lux.
     
  19. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hmm, i do not get any errors or warnings – but i have cleaned up the terrain script anyway.
    it is available at the repo.

    lars
     
  20. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    Cool. Will try it out when I get back on my computer.
     
  21. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    Is it the custom ambient lighting that frostbite23 showed us, or the Unity default?
     
  22. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    It is the Lux IBL diffuse ambient. The Lux terrain script uses the cubemaps in the setup Lux script. Not dynamic but looks awesome.
     
  23. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    Oh yeah I saw that. It looks pretty nice.
     
  24. kryptopath2

    kryptopath2

    Joined:
    Jul 19, 2013
    Posts:
    104
    hmm.. when i switch to deferred the normalmap has no effect, the textures are flat. (terrain)

    oh, just tried the terrain releif pack and i have the same problems. no normal-effect in deferred..
     
    Last edited: Aug 24, 2014
  25. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    The last image I showed about the anisotropic hair shader weren't convicing since I hadn't find a way to properly draw the anisotrpic map (still hasn't). I use the map from the unify's anisotropic shader to make result apparent.

    1. This is a check of validity with the anistropic variant against the regular variant using a single color map to mimic the regular anistropic input.


    2. Here is the shader with a proper hair specular composite map


    3. Here is a test to emulate glitter (basically noise) without problematic specular aliasing.


    3. The afro hair shader (failed) attempt use in the previous post.


    Notice IBL is disabled (in code)
     
  26. x_african_warrior_x

    x_african_warrior_x

    Joined:
    Jun 24, 2014
    Posts:
    80
    hi lars, i keep getting an error as i try to build. check attaached files
     

    Attached Files:

  27. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    Looks like you are using the Asset Store version. The Asset Store is very slow about accepting updates so Lars has the constantly updated GitHub version.

     
    x_african_warrior_x likes this.
  28. joeee19

    joeee19

    Joined:
    Jul 14, 2012
    Posts:
    56
    great asset.
    can work terrain shader on mobile(Latest iOS device)?

    please include mobile shader's
     
  29. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    I've had Lux's regular shaders running on a HTC One and a Samsung Galaxy S3 in reasonably dense scenes (in this regard I mean the image was entirely filled with Lux-shaded IBL-lit and reflective objects and they performed perfectly well), and this was rendering stereoscopically for mobile VR, so at least for well performing mobile devices Lux seems fine
     
  30. joeee19

    joeee19

    Joined:
    Jul 14, 2012
    Posts:
    56
    Do you have can be used in mobile (I use iOS) The terrain shader?
    I become pink is absolutely terrain.
    open Lux_TestScene_Terrain(demo scene file) → build settings → switch platform to iOS → terrain is pink ...
    Setting is leaking?
    Is a screen shot.

    http://imgur.com/XgvDrN2
     
  31. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    Either missing a material, or a shader. Or a shader with compile errors. That can result in a pink terrain.
     
  32. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    Hey lars. I know it would be a crazy complex shader but would combining a detail shader with a wetness shader work? Puddles Bumped Specular Detail. Even the title is complexo_O. Love the rain on my rocks but need some extra detail in there too.
     
  33. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hi there,
    that should work i think.
    (in fact the vertex blend shader is even more complex).
    you will have enough texture samplers to do so.
    but you will run out of texture interpolators (vertex function).
    so you will have to use the same uvs for the main and the detail textures and simply multiply those uvs for the detail texture look up by a factor (which you should add to the shader properties).

    lars
     
  34. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    Cool will try it out soon. I installed the latest Lux and I still get that error.
    I think it is just something with the project. Some miscommunication going on. It is not hurting anything so I will just leave it alone.
     
  35. joeee19

    joeee19

    Joined:
    Jul 14, 2012
    Posts:
    56
    lux "terrain" shader support mobile?
     
  36. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    No I do not believe that lux works on mobile phones.

    Do you speak Chinese by any chance?
     
  37. joeee19

    joeee19

    Joined:
    Jul 14, 2012
    Posts:
    56
    Thank you for your reply.
    That's unfortunate.
    I do not speak only Japanese.
     
  38. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    lux has not been developed with mobile devices in mind – but it runs on certain ones (most likely pretty modern ones).

    lars
     
  39. Eric2241

    Eric2241

    Joined:
    Dec 2, 2012
    Posts:
    642
    Oh ok.
     
  40. bluemoon

    bluemoon

    Joined:
    Dec 14, 2012
    Posts:
    85
    Ok I'm sure I must be missing something but how do you import hdr images for hdr cubemaps?
     
  41. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Import hdr panorama as a supported 32bit format in unity, texture import -> advanced import texture type, choose your cubemap of choice in 'Generate cubemap' dropdown. I would, without an alternative known to me, possibly lower the res and have Lux's cubemap processor convolve it, or grab it via a Lux probe and Lux convolve that. Both of those may be silly and I can be corrected but thats how i might do it
     
  42. joeee19

    joeee19

    Joined:
    Jul 14, 2012
    Posts:
    56
    terrain shader too?
    how?
    when switched project ios, my terrain became pink.

    I testing iPhone5s
     
  43. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    i have not tested it myself. so please search this thread.
    lars
     
  44. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    @joeee19: try turning off Graphics Emulation, if it's on, that might fix it.
     
  45. bluemoon

    bluemoon

    Joined:
    Dec 14, 2012
    Posts:
    85
    Thanks I looked all over for that info.
     
  46. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    @Baldinoboy: this error:
    Should have the cause properly nailed down once you get into optimizing performance, because I have found a constantly recurring NullReferenceException increases main thread time.

    @larsbertram1: mind if I try and solve the error above? I might be able to fix it. :)
     
  47. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    not at all ;-)
     
  48. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    Hey Lars. I am getting this problem with a terrain I made in L3DT. I am, of course, using the Lux terrain shader on it.

    The colormap was not fitting correctly and I found a comment somewhere to put a minus in the texture's y tile number. That worked great. From afar


    But when the detail fades in the colormap returns to it's incorrect fit on the terrain. Up close


    Do not know what to do if there even is something to do. Thanks for reading.
     
  49. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hi there,
    In case you generate your terrain maps (like height map, splat map, color map and global normal map) outside of unity, you have to import the terrain normal and color map just as they are, splat map and height map have to be flipped on the y axis.

    lars
     
  50. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    Man lars you are the best. It worked perfectly. Thanks