Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Lightmapping Extended - advanced lightmapping settings editor

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

  1. mstevenson

    mstevenson

    Joined:
    Sep 24, 2009
    Posts:
    189
    I've created a free editor tool that provides advanced configuration options for Unity's built-in lightmapping system, unlocking hidden features not accessible through Unity's own Lightmapping window.

    Lightmapping Extended includes support for all Beast XML settings that are compatible with Unity, many of which are not included in Unity's own documentation.

    Notable Features:
    • Lightmapping Settings Presets - store project-wide presets that can be applied to multiple scenes
    • Image-Based Lighting - light your scene with a panoramic HDR image.
    • Path Tracer GI - a fast, multi-bounce lighting solution.
    • Monte Carlo GI - a very slow but extremely accurate lighting solution.

    Download for free on the Asset Store

    Full source is also available on GitHub

    Feel free to post any questions and comments in this thread.
     
    Last edited: Jan 2, 2013
  2. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    So this basically eliminates the need to make XML files...

    THIS IS FREAKING AWESOME :)... No more having to create XML files :)...
     
    Last edited: Dec 5, 2012
  3. mstevenson

    mstevenson

    Joined:
    Sep 24, 2009
    Posts:
    189
    Correct, this tool creates and updates an XML configuration file for the current scene. I've also added options not mentioned in Unity's own XML documentation.
     
  4. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    And I also like that it takes Probes into account :)... I made a tutorial involving XML files and this is a real time saver... I am going to do some renders for you if u need a gallery of sorts :)

    And I do hope you put this on the asset store... especially for people like me who use Beast alot
     
    Last edited: Dec 5, 2012
  5. mstevenson

    mstevenson

    Joined:
    Sep 24, 2009
    Posts:
    189
    I've actually neglected to test probes, so please let me know if you run into any issues.

    I'd love a few gallery shots. I'm especially curious what a high quality Monte Carlo bake would look like - I haven't had the patience to do one myself, it's orders of magnitude slower than final gather.
     
  6. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    I haven't run into any issues... and I would add a bake probes option just in case... i am doing a render of my salem level with Some GI first, then PathTracer, and the Monte Carlo... and I will mess around with the second intergrators to make it work. Monte Carlo will take a LONG time to do... especially if the scene is huge. And I will have screencaps showing my settings... is that cool?
     
  7. mstevenson

    mstevenson

    Joined:
    Sep 24, 2009
    Posts:
    189
    Absolutely, thanks!

    I'll add Bake Probes and Bake Selected buttons to match Unity's light mapping window.
     
  8. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    I am glad I have patience for a monte carlo render...also too, I will be posting screen shots from my desktop so you can see my settings... I usually keep it under 1000 when I am testing my scenes... and I fire 100,000 when I am happy with the settings :) Sorry, mentalray spoils me

    I wish I could record how much time the bake took...
     
    Last edited: Dec 5, 2012
  9. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Great!

    I heard about beast supporting distributed rendering on multiple client mashines ("DistriBeast"):

    http://en.wikipedia.org/wiki/Beast_(software)

    "The new Beast was presented at GDC 2010 in San Francisco.[6] The new version of Beast features two entirely new modules called DistriBeast and eRnsT. DistriBeast is an extremely fast and easy to use distribution engine for managing render farms. eRnsT is a real-time visualizer that allows artists to explore and control the lighting set-up without having to run a complete bake."

    Supported?

    If yes, it would perhaps make sense for some of us to switch from Max+VRay to Unity+DistriBeast...
     
    Last edited: Dec 5, 2012
  10. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Awesome! I am looking forward to see it in Asset Store.
     
  11. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    Here are some tests that I was doing with the newer exposed settings... The first screenshot is with PathTracer as a primary integrator... honestyly, I would never use this setting as a primary since it looks kinda off... in this scene, I am also using the skylight in the environment settings. I would use PT as a secondary integrator on lower settings.

    $BeastLightmapping_0000_Path%20Tracer.jpg

    The next one is Final Gather, and the results are predictable... even on lower settings I am getting very good results... I would definitely use this as a primary integrator with IBL enabled. This scene doesn't have IBL.

    $BeastLightmapping_0001_FG.jpg

    I am still waiting on the Monte Carlo version of this scene... I will post that when it finishes
     
  12. mstevenson

    mstevenson

    Joined:
    Sep 24, 2009
    Posts:
    189
    DistriBeast is not currently supported. My tool is co-opting Unity's embedded Beast tool by setting up a config file and calling the appropriate Unity editor methods to kick off the bake. Unity hasn't licensed DistriBeast, so it's currently inaccessible from the editor API.

    The Beast engine is actually a separate executable that Unity runs after converting the current scene to a Beast-compatible format. It's conceivable that this call could be intercepted and redirected to DistriBeast, perhaps by swapping the Beast executable with a script that accepts Unity's command-line arguments. I may investigate this after polishing the current feature set.
     
  13. mstevenson

    mstevenson

    Joined:
    Sep 24, 2009
    Posts:
    189
    Interesting... the path tracer render does look pretty strange. I'd seen it recommended to use Final Gather with Path Tracer as a secondary integrator specifically for environments that require a lot of bounce. I'm not certain if this is simply for speed, or if there is improved quality by combining them.

    If you set Final Gather / Path Tracer to be the primary / secondary integrators respectively, it will enable a few additional settings at the bottom of the Global Illumination tab that control how the two solutions are blended together.
     
    Last edited: Dec 5, 2012
  14. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    That is correct... I will test this out on a daytime level, using IBL... I strongly recommend not using PathTracer as a primary... The Path Tracer as a secondary sometimes adds a bit more bounce, but sometimes it is not a necessity unless you tweak the secondary integrator to a lower setting. Still waiting on a monte carlo render...
     
  15. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    And here is a monte carlo render... took SO LONG with only 2048 samples... I recommend using this and FG as a second integrator... notice in this shot there is some residual sampling noise... you will need a CRAP load of samples and a good nights rest to get this looking great... I love Monte Carlo rendering... will post more images of my Atlantis level with a combo.

    In FG, it keeps the shadows... in Monte Carlo, it is a full out lighting solution...

    EDIT: Final Gather at a Primary Integrator and Monte Carlo as a secondary

    $Monte-Carlo-Render.jpg
     
    Last edited: Dec 5, 2012
  16. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,521
    Could you make an option for image based lighting to use the skybox of the current scene? or does this need to be HDR?
     
  17. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    When you use IBL, you are using the HDR mapping... another way to do it, is to make a physical box around your level, but this doesn't have the same effect... The HDR maps are easy to acquire since they are available online in Lat-Long format...
     
  18. sipon

    sipon

    Joined:
    Feb 8, 2009
    Posts:
    143
    Tks a lot for sharing !
    Never used beast XML so much but now all is clear and so user friendly.
    Definitly adopted :)
     
  19. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Sounds promising!
    Looking forward to it.
     
  20. ronan-thibaudau

    ronan-thibaudau

    Joined:
    Jun 29, 2012
    Posts:
    1,722
    as someone who has no clue about lightmapping, what is a "primary" and "secondary" integrator?
     
  21. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    AFAIK, the integrators in Beast are "methods" that it will use to render the lightmaps in the scene ... first, Beast will render the main pass such as Final Gather (which I strong recommended using as a primary integrator, since it will render quite nicely and it is sometimes fast depending on how you optimise the scene. Once that pass has gone through, the secondary integrator will be rendered additively on top of the FG. In my case, I am using Monte Carlo as a secondary intergrator, especially since Monte Carlo is EXTREMELY expensive anyway on it's own, and you would need A LOT of rays to get a clean result. But if you want quality (and you have the patience of a cat waiting for the mouse to move), it is worth the wait. I would save this step for when the level is signed off.

    In the screenshot below, this is the forge that is in my game level and I wanted to utilize Beast's powerful rendering to simulate the superhot coals of the furnace that is used to forge weapons. With Final Gather and Monte Carlo combined, I was able to get a nice beautiful lighting setup... even though the level is not textured. On top of the GI, I am also using IBL for the lighting as well... I had it set to skylight initially, but I felt comfortable with IBL since it looks more natural and easy to control especially for outdoor levels that require it. I have also used the IBL Lighting Option which is EXPENSIVE AS HELL too... anyway, enough of my rambling, here is the screenshot of the forge

    $Beast%20Forge%20Rendering.jpg
     
    yezzer likes this.
  22. ronan-thibaudau

    ronan-thibaudau

    Joined:
    Jun 29, 2012
    Posts:
    1,722
    Ok so if i get this right, both passes get combines so this allows combinations like (expensive algorithm at low quality + inexpensive algorithm at high quality = good combination)?
    Is there any reason to keep the combination instead of going single pass best algorithm max quality for a final build for exemple? Any nice aestetics from blending a lesser algo?
     
  23. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    I just do it by choice... you can use just one... like FG alone is sufficient. But I wanted to show an example of a Primary and Secondary Integrator. When I am done with a level, I lightmap the S*** out of it with a high ray count... with good textures, no one will notice the noise too much... This also looks AMAZING with a character next to it with light probes
     
  24. mstevenson

    mstevenson

    Joined:
    Sep 24, 2009
    Posts:
    189
    I've just added a set of transmissive shaders to the GitHub repository. Once installed, you can find them in the material shader menu under Transparent/Transmissive.

    The "Transmissive Color" property defines which colors of light will pass through the object, producing colored shadows. This will only show up in bakes - it's not respected by Unity's real-time shadows.
     
  25. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    Yay! I will test this out after my FG/MCGI render... it's on hour number 4
     
  26. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    Hmm... i wonder if there is a way to just bake down the IBL... it seems that you can't do IBL without GI.
     
  27. mstevenson

    mstevenson

    Joined:
    Sep 24, 2009
    Posts:
    189
    From what I understand, IBL essentially creates a skybox that the GI samples from. So, for example, when final gather looks outward from each sample point to determine the total average lighting contribution, it includes the HDR skybox in what it's able to see. For other GI solutions the skybox might emit rays, like an emissive material.

    I've also seen IBL implemented as a shader that displays a cubemap as diffuse lighting instead of reflection.
     
  28. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    I did some tests today too... and in my night time scene, I didn't need any environment lighting, so I turned it off and used a complete GI solution... I just wish I could the render offline so it would render quicker...I'm using a hex core CPU so it should be quick, especially since I use FG/MCGI to render my scenes. And it is the most realistic setup I've ever done in Unity. And even in that screenshot, it looks fantastic...

    Is Beast 64bit?
     
  29. mstevenson

    mstevenson

    Joined:
    Sep 24, 2009
    Posts:
    189
    On OS X it looks like the Beast executable is compiled for both 32 and 64 bit.
     
  30. mstevenson

    mstevenson

    Joined:
    Sep 24, 2009
    Posts:
    189
    Does anyone know of any good resources for free HDR light probe images in lat-long format?
     
  31. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
  32. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
  33. DanTreble

    DanTreble

    Joined:
    Aug 31, 2010
    Posts:
    590
    Wow, great work
     
  34. Venged

    Venged

    Joined:
    Oct 24, 2010
    Posts:
    500
    Will This work with Unity 4 Free?
     
  35. Toasttify

    Toasttify

    Joined:
    Mar 27, 2012
    Posts:
    143
    This is amazing, super simple to setup and tons of options without having to edit the xml file, thank you, thank you!
     
  36. mstevenson

    mstevenson

    Joined:
    Sep 24, 2009
    Posts:
    189
  37. mstevenson

    mstevenson

    Joined:
    Sep 24, 2009
    Posts:
    189
    No, the additional features rely on global illumination which is disabled in the free version of Unity.
     
  38. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Any news on this?
     
  39. mstevenson

    mstevenson

    Joined:
    Sep 24, 2009
    Posts:
    189
    I'd like to get the current feature set finished, debugged, and on the Asset Store before I get too sidetracked with additional functionality. I have no knowledge of nor access to DistriBeast right now, so it will be a while before I'm able to get to this.
     
  40. ronan-thibaudau

    ronan-thibaudau

    Joined:
    Jun 29, 2012
    Posts:
    1,722
    Any ETA on the asset store release? Really would like to get this with support everything and without grabing the source from a repo.
     
  41. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    I love how much easier this is use... kinda wish Monte Carlo and IBL Lighting were a bit faster... :/
     
  42. thellama

    thellama

    Joined:
    Mar 25, 2010
    Posts:
    360
    @mstevenson: Thanks for this awesome release it's been working great for me!

    @ronan.thibaudau: He released it for free, just download and use it. If you need some kind of support just post here.
     
  43. ronan-thibaudau

    ronan-thibaudau

    Joined:
    Jun 29, 2012
    Posts:
    1,722
    I know that, but since he mentioned asset store i expected it would be paid there, which is fine by me. I'm not into beta testing and if it's not ready for the asset store it's not for me yet either.
     
  44. thellama

    thellama

    Joined:
    Mar 25, 2010
    Posts:
    360
    Well I encourage others to download and help test and provide feedback. If only a few people are testing it, it will take longer to get into your hands as an official release.
     
  45. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    I have been testing Rigorously... I will post new screenshots shortly
     
  46. mstevenson

    mstevenson

    Joined:
    Sep 24, 2009
    Posts:
    189
    Thanks, everyone. To clarify, this tool will be released for free on the Asset Store and will continue to include the full source.
     
  47. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    Sweet! And I just saw the new update that allow the user to edit the HDR maps... very nice touch, especially since I will be using this feature quite alot. I will also update my Beast tutorials using this new interface..
     
  48. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Question, does this work with Unity 3.5x?
     
  49. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
  50. fallingbrickwork

    fallingbrickwork

    Joined:
    Mar 16, 2009
    Posts:
    1,072
    Looks really great. Grabbing it now; can't wait to take it for a spin. Keep up the good work.

    - Matt.