Search Unity

Lightmapping Extended - advanced lightmapping settings editor

Discussion in 'Assets and Asset Store' started by mstevenson, Dec 5, 2012.

  1. krassi

    krassi

    Joined:
    Nov 6, 2012
    Posts:
    19
    hi there! well first off all your beast-extension is awesome!.. i did not have the time to test it fully, but it feals now more like vray or a real renderer and not just 10 options and thats it ;)

    i also found some nice hdri panoramas , mostly austrian outdoor on openfootage.net

    im doing usually vray rendering stuff in 3dsmax and i hope i can tweak more with your extension

    seeya, daniel
     
  2. mstevenson

    mstevenson

    Joined:
    Sep 24, 2009
    Posts:
    189
    Yep, it should work the same in 3.5 and 4.0.
     
  3. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Are there any more options for Beast? And how does this work with reflections?
     
  4. mstevenson

    mstevenson

    Joined:
    Sep 24, 2009
    Posts:
    189
    Beast does have a few minor options that I didn't include because they have no apparent effect in Unity. These are still included in the code, I've just commented them out until they become available:
    • Tile Scheme - Different ways for Beast to distribute tiles over the image plane.
    • Tile Size - A smaller tile gives better ray tracing coherence.
    • Background Color - The color of the lightmap image background, used to hide seams by more closely matching the light color.
    • Edge Dilation - Expands the lightmap with the number of pixels specified to avoid black borders.
    • Premultiply - If this box is checked the alpha channel value is pre multiplied into the color channel of the pixel.
    • Premultiply Threshold - This is the alpha threshold for pixels to be considered opaque enough to be 'un multiplied' when using premultiply alpha.

    When Unity converts its materials to a Beast-compatible format, it seems to use the specular intensity of the material as the amount of light reflected from the surface.
     
  5. mstevenson

    mstevenson

    Joined:
    Sep 24, 2009
    Posts:
    189
    I've added support for configuration presets. Grab the latest code here:

    https://github.com/mstevenson/Lightmapping-Extended

    The presets UI at the top of the LM Extended editor window will allow you to create, delete, and overwrite preset config files.

    Preset files are stored in Lightmapping Extended/Presets any may be checked into source control. Presets are available per-project rather than per-scene, making them easier to re-use throughout large projects. You may also organize presets into folders for easier navigation in the Presets selection menu.
     
  6. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Swweet... now the only thing really missing is Bake Selected and Bake Probes... is that already in code?
     
  7. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    As of Unity 4, there also appears to be a 64bit executable for Beast on Windows.
     
  8. mstevenson

    mstevenson

    Joined:
    Sep 24, 2009
    Posts:
    189
    I just finished reverse engineering Unity's bake selection dropdown button and have pushed it to the repository.
     
  9. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
  10. mstevenson

    mstevenson

    Joined:
    Sep 24, 2009
    Posts:
    189
    And with that, I think it's feature complete!

    I'll hold off a bit for additional testing and feature requests to make sure there's nothing major I've missed, then I'll submit a v1.0 to the Asset Store.

    You can download a zip file of the release candidate here:
    https://github.com/mstevenson/Lightmapping-Extended/tags
     
    Last edited: Dec 19, 2012
  11. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I think this is pretty much the complete Beast setup... :) and I will test the hell out of this...
     
  12. mstevenson

    mstevenson

    Joined:
    Sep 24, 2009
    Posts:
    189
  13. Thomas-Pasieka

    Thomas-Pasieka

    Joined:
    Sep 19, 2005
    Posts:
    2,174
    This is brilliant mstevenson! I was waiting for UT to expose some more features/options for way too long! Great to see you exposing these features. Had a little playtime with it. Created this scene today and saw this thread (which I haven't noticed before!) so I had to test it out right away. Thanks again! Loving it so far!

    Thomas P.

    PS: This was just a test render using the standard settings in High Quality (there are a few issues I know...)
     

    Attached Files:

  14. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    This is very impressive... how long were the render times?
     
  15. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Sweet deal man... this is getting better and better... You, sir, are the Beast Master...
     
  16. mstevenson

    mstevenson

    Joined:
    Sep 24, 2009
    Posts:
    189
    Looking very nice, even with default settings!

    As I was building this tool, I saw quite a few references in Autodesk's documentation to the suppression of white haloes. I assume this is referring to the bright seams shown in your image at geometry intersections. I'm very curious to know if anyone can figure out how to effectively solve this problem with the available settings.
     
  17. jessica1986

    jessica1986

    Joined:
    Feb 7, 2012
    Posts:
    621
    Can anyone guide me How can i achieve best results using this tool..

     
  18. Thomas-Pasieka

    Thomas-Pasieka

    Joined:
    Sep 19, 2005
    Posts:
    2,174
    In the past I added some "padding" when I saw haloes or white edges at such intersections and that worked pretty good in most cases. However, am I missing something? I don't see a padding option anywhere in the settings.
    I used 2000 rays with an Intensity of 1.25 and 4 Bounces and a bit of AO as well. No secondary Integrator used here just Primary "Final Gather" method.

    In the video you can clearly see the white fringe/edge/splotch/halo/whatever ;)

    Video: CLICK TO PLAY


    Mind you, the video has compression artifacts.
     
  19. Thomas-Pasieka

    Thomas-Pasieka

    Joined:
    Sep 19, 2005
    Posts:
    2,174
    Here is a new rendering with higher settings. A tad brighter now as it needed a bit more bounce light.
     

    Attached Files:

  20. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467

    The reason for spotty renders is because your ray count is too low
     
  21. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    This is beautiful man... in my project, it is my mission to show that Unity can do the impressive graphics too... as for the white halo, I usually use blockers under the objects... such as in my Salem level, the light leaks thru, so I use blocker objects
     
  22. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,260
    Thanks for this, looks like I have something else to play around with :p

    Anyone have any presets they don't mind sharing?
     
  23. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I can try and make a few but they are specific to my in game levels :)
     
  24. mstevenson

    mstevenson

    Joined:
    Sep 24, 2009
    Posts:
    189
    "Padding" seems to be handled outside of the lightmapper, possibly as a pre-processing step before Unity submits the bake to Beast. This setting can still be changed in Unity's built-in lightmapping window even when an XML config file is present.

    I found a suggestion in the Beast docs for reducing halos - it says to lower the "gradient threshold":
     
  25. Thomas-Pasieka

    Thomas-Pasieka

    Joined:
    Sep 19, 2005
    Posts:
    2,174
    Hmm I tried everything but just can't get rid of those artifacts (light leaks) at the intersections. I gave it padding, fiddled with second uv set settings, changed rays and resolution to higher numbers. Gradient Treshold is set to 0. Artifacts are still pretty visible. Will have to do some more research on this problem.
     
  26. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Isn't the "padding" option is in the Bake tab on the old lightmapping Window, just below the "resolution" option.
    But speaking about light leaks, there is an option to reduce the lightleaking in the Path Tracer integrator isn't?
     
    Last edited: Dec 28, 2012
  27. Thomas-Pasieka

    Thomas-Pasieka

    Joined:
    Sep 19, 2005
    Posts:
    2,174
    Yes it is and I am using it (the padding). Gradient Treshold is also set to 0 as stated before. Light leaks are still present however and I am not really sure to get avoid them at this point. Only thing I can do is to get rid of them manually in Photoshop (not really the best solution now is it).
     
  28. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574

    In Unity's own doc, did you check :

    "Check Visibility and Light Leakage reduction are expensive operations and should only be used to remedy actual light leakage problems. These settings will only help if the light leakage is caused by the Global Illumination calculations. A very common light leakage situation occurs with a wall as a single plane with no thickness. The light leaking through in that situation does not come from GI."

    So, maybe give your walls a thickness? There is also another solution which I saw a lot back in the early days of GI in CG - which is to put a "cage" around your mesh so rays will be forced to bounce back. This is due to the low photon accuracy (or lack of photons) in the early GI engines.
     
  29. mstevenson

    mstevenson

    Joined:
    Sep 24, 2009
    Posts:
    189
  30. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    Thanks! looks great. Cant wait to give it a go.>
     
  31. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Awesome sauce!!!! :D
    Going to give it a go very soon.
     
  32. Temporaro

    Temporaro

    Joined:
    Dec 21, 2012
    Posts:
    27
    I can't test this right now but does this support normal maps influencing the lightmap bake? I'm not talking about directional lightmaps but having the normal of an object affecting the lightmap shadows.
     
  33. mstevenson

    mstevenson

    Joined:
    Sep 24, 2009
    Posts:
    189
    I didn't see any reference to this in the Beast docs, so unless this behavior is already supported by Unity's lightmapping then I doubt it is supported.
     
  34. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    404
    Thanks ever so much for this mstevenson!

    I am trying to get coloured shadows working in the standard Cornell box, but think I must be doing something wrong :(

    I duplicated the Cornell White Material and renamed it - changed the colour to green and set the shader to Trasparent/Transmissive/Diffuse. Then for the Transmissive colour and for the Base there are only Texture slots, no colour selections? - so not sure what I am meant to do here to get green shadows.

    Anyway after applying to object 5, the small cube in the front, it appears transparent green, but the shadows are still the same.

    Could you possibly shed some light on what I am doing wrong?

    Sorry if this is a noob question.

    Nalin
     
  35. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Just out of curiousity, where do you get those BEAST docs? I wouldn't mind take a peek myself.....
     
  36. Temporaro

    Temporaro

    Joined:
    Dec 21, 2012
    Posts:
    27
    Unity 4 supports this, so it shouldn't be a problem.



     
  37. rahuxx

    rahuxx

    Joined:
    May 8, 2009
    Posts:
    537
    sorry if out of the topic, but can any one help me know how can I use HDR for reflection?
    I want to make a reflective material for an object and want to use HDR as a reflection.
    thanks in advance
    rahuxx
     
  38. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Find 6 sided HDR (lat-long format) like some listed in this thread
    eg.
    http://dativ.at/lightprobes/
    https://www.moofe.com/#/free

    Then chop it up in Photoshop into individual images then follow :

    http://docs.unity3d.com/Documentation/Components/class-Cubemap.html
     
  39. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Yup, you will need 6 separate images for the cubemap...and to use the IBL in Beast, the HDR must be like this: $Witte_JEPSON_bigHDR_LatLong_600.jpg

    This is lat-long.
     
  40. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Last edited: Jan 6, 2013
  41. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574






    I just came across a thread that someone found a solution to this light leak problem as well :



    http://forum.unity3d.com/threads/13...sing-single-sided-planes-for-geometry-any-fix

    So basically, its like I thought, Beast is still fairly inaccurate. I think Beast don't like single sided geometry, so you either create a cage to collect the remaining photons and force it to bounce back, or using yahodahan's method - setting back-sides lightmap scale to 0 so it blocks light and don't receive any - essentially it collects all errand photons like a blackhole.
     
    Last edited: Jan 6, 2013
  42. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    :p
     
  43. mstevenson

    mstevenson

    Joined:
    Sep 24, 2009
    Posts:
    189
    The transmissive property can only be defined using a texture, so to create a solid green transmission you would need to provide a solid green texture. You can think of it like a transparency map where each of the three color channels defines a separate transparency value for each color of light.
     
  44. mstevenson

    mstevenson

    Joined:
    Sep 24, 2009
    Posts:
    189
  45. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
  46. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    404
    Many thanks for this.

    I will have a play and see if I can get coloured shadows up and running :)

    N
     
  47. ersaurabh101

    ersaurabh101

    Joined:
    Oct 8, 2010
    Posts:
    412
    hii,

    i am evaluating , i copied the lightmap extended folder, added 4 cubes in my scene, marked them static and baked...but they are not taking effect

    see the image, what can be the reason ?? i am there is no result at all
     
    Last edited: Jan 10, 2013
  48. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    What kind of materials are you using...?
     
  49. Metakid

    Metakid

    Joined:
    Nov 24, 2012
    Posts:
    36
    It doesn't look like you have any lights in your scene...
     
  50. Thomas-Pasieka

    Thomas-Pasieka

    Joined:
    Sep 19, 2005
    Posts:
    2,174
    ersaurabh101 - it looks like you are trying to use emissive material. Did you make sure to use the proper shader for that?