Search Unity

  1. Engage, network and learn at Unite Austin 2017, Oct 3 - 5. Get your ticket today!
    Dismiss Notice
  2. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  3. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  4. Unity 2017.1 is now released.
    Dismiss Notice
  5. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice
  6. Unity 2017.2 beta is now available for download.
    Dismiss Notice

Light transport problem with large objects

Discussion in 'Global Illumination' started by erana79, Mar 13, 2015.

  1. erana79

    erana79

    Joined:
    Jun 26, 2013
    Posts:
    62
    Hello everyone!

    I have a problem with baking lightmaps for large objects in my scene.
    Changing the lightmap scale of the renderer doesn't help. When setting everything to "baked" and building my lightmaps, the process gets stuck at "7/11 Light Transport 1 job".

    I'm not even sure if anything happens from there on. It takes forever and my iMac starts to heat up.

    I attached a small test project with only one object.
    Maybe someone can help me out here?

    thanks in advance!
     

    Attached Files:

  2. erana79

    erana79

    Joined:
    Jun 26, 2013
    Posts:
    62
    One thing: If i scale down the object in the scene to e.g. XYZ=0.1 then the baking process works
     
  3. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    128
    Got this slow lightmapping problem then one huge mesh (floor ~50x20m) affect (with his GI) many smaller meshes - compile time is insane slow (4+ hrs on 4.7Ghz Core i5 2500K). After splitting this large mesh in 26 parts - lightmap compile time drops to 15-17 minutes. Bad way to work, but that's all i've got to speed up this process....
     
  4. erana79

    erana79

    Joined:
    Jun 26, 2013
    Posts:
    62
    Yes, i've noticed the same thing. If i split up the big object into smaller ones it works.
    There are visible artifacts though.
    I'm gonna have a lot of big object (along with smaller ones) in my scene, so splitting up every big object is gonna be an insane amount of work.
     
  5. XRA

    XRA

    Joined:
    Aug 26, 2010
    Posts:
    105
    same issue... medium level, big meshes.. what would be finished in 15-20 mins with Beast seems to be going on forever with Enlighten (as in 10 hours later and not finished, says 7/11 Light Transport)
     
  6. Same for me, splitting it up speeds up the baking but increases the draw-calls, this GI thing would be pretty nice if it didn't take so much to bake, plus it often has artifacts when its done
     
  7. Berkut

    Berkut

    Joined:
    Aug 22, 2012
    Posts:
    1
    There's no need to split the object (unless you have got a poor shadow resolution).
    To reduce the time process for huge objects you should create a specific Lightmap parameter for it. To do that:
    . On the Project panel: -> create -> Lightmap Parameters.
    . Rename the Parameter
    . Set the Resolution to 0.01 on inspector.
    . On the Lighting Panel with the object selected -> on Object tab -> Select your parameter in Advance Parameters
    . Build

    Cya!
     
  8. Kuba

    Kuba

    Unity Technologies

    Joined:
    Jan 13, 2009
    Posts:
    373
    Generally Enlighten doesn't really like huge meshes (as in: a single mesh that occupies a lot of texels) and indeed the Light Transport stage seems to suffer the most these days. Splitting up meshes into smaller parts (so that parts of the original geometry can just be culled when not in the view frustum) is a good idea not only for the GPU, but also for the parallelization of the precompute stage.

    That said, please submit bug reports when you see precompute times that are unreasonably slow. We would especially appreciate projects where a scene has all the geometry as one mesh and another one where geometry has been split into mutiple meshes and the precompute is noticeably faster.
     
  9. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    2,546
    Thats a kind of info that belongs into the manual!
    Trying to light map a 700 by 800 unit flat plane takes ages that way without splitting it up.
    I hope Unity and Enlighten find a nice way that the user do not have to do she splitting itself (manual splitting on unity terrain is not possible that way).
     
    garrett3d likes this.
  10. FarNiche

    FarNiche

    Joined:
    Jul 24, 2014
    Posts:
    5
    Thanks. My i7-CPU was running at 93% @~138F degrees. I just put an end to that with your suggestion. My map is 7500x750x7500, it's an all outdoors terrain, so with Windows>Lighting>Lightmaps, 0 - non-directional lightmaps(No Lightmaps) stopped the: Create Geometry/Layout Systems/Clustering/Visibility/Light Transport process completely.
     
  11. drizzitx

    drizzitx

    Joined:
    Mar 22, 2015
    Posts:
    1
    Berkut can you plz explain this with more detail? Or someone who understood how to implement this?
    I succeeded in adding "Lightmap Parameters" where the scene is kept (which I hope is what was implied here) but I didn't find how to implement this setting on the actual lighting of the map, also couldn't rename it either.
    At least I found the "continues baking" option in the advanced lighting option and unchecked it , now the cpu load which was computing 53 assets all the time has stopped and cpu is happy.

    Where to find the advanced lighting option:
    1. On main unity window
    2. Click window menu (It's the drop down menu before help on unity 5.01)
    3. Choose "Lighting"
    4. On the new window that pops up - at the window bottom you'll see "Continues baking" check box
     
  12. SpiriTx

    SpiriTx

    Graphics QA Unity Technologies

    Joined:
    Apr 12, 2012
    Posts:
    251
    It's in the object tab of Lighting window. Select the mesh and change the parameter to the desired one

    1.png
     
  13. DantaliaN

    DantaliaN

    Joined:
    Oct 7, 2012
    Posts:
    12
    Change "Scale in lightmap" or turn it off in Lighting for big object and all be finish.
     
  14. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    502
    Change it to what?

    How?

    I have a large terrain. I don't know how to break it up into smaller chunks as suggested. Can you even break up a large terrain.

    At this point I have no idea how to continue. Things just halt at 7/11.

    Could somebody please provide some newbie friendly advice for me?
     
  15. FarNiche

    FarNiche

    Joined:
    Jul 24, 2014
    Posts:
    5
    I picked up, World Steamer, at the Asset Store but I haven't really worked with it yet. I have one huge Island map, and have produced an OUT OF MEMORY ERROR, somehow. On a PC, looking at the crash in Task Manger it was using up more than 100,000 MB dump. That said, I don't use the fancy lighting yet, too tricky, all real time, heavy on the GPU/CPU but I'm still working with the basics. Build crash, build crash, save once save often and always keep a backup of previous work. That's my best noob advice. Just hammer and tongs a bunch of small projects until a couple of things start making sense. Every bodies games are different genres, different platforms, different audiences. So take lots of notes, start a blog, make some videos, and build a ton of half baked games. See what you like to build, and what you can build and go from there. That's about as friendly as it gets. Take a jump over to http://www.onegameamonth.com/ It's not all Unity, but it's a bunch of indies making what they can with what they have. Take care, Scott.
     
  16. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    882
    @Tinjaw Decrease the scale in lightmap if you want to lower the resolution for that specific object without assigning a Lightmap Parameters object.

     
  17. craigp123

    craigp123

    Joined:
    Oct 21, 2015
    Posts:
    1
    I found that if you go into Window>Lighting>Objects>Terrain and turn terrain static off, it fixes the problem, however the lighting will go a little bit weird but you could simply re tweak it again.Another solution i've seen people mentioning is making sure there are no plane meshes over the scale of 16,16,16 because for some reason that can also crash it. Baked lighting can also be a big issue so if possible change them to real time. :) hope this helps!
     
  18. Tudor

    Tudor

    Joined:
    Sep 27, 2012
    Posts:
    63
    Exqueeze me, but may we understand why that is? Why is Enlighten (STILL) so severely scale bound? Share with us the thought process and alleviate the mountain of frustration. Just think "what would Valve do?".

    Should we just take that as Unity's current tech only being able to bake small scenes and being unusable in open world scenarios?
    If you make a "large" mesh's scale in lightmap 0.001, it can either not be enough for usable shadows, either it will still be too large and take forever or not finish baking at all, so, unusable.

    If you don't explain yourselves, and also don't solve it, then I'm just going to think "well id tech 5 has Megatexture for any and all geometry, what do you have? Cute pretty realtime GI for small stuff?". Sorry for the venting, had to do it.
     
    Last edited: Mar 10, 2016
    lliviu, krides and Vel_1828 like this.
  19. acemary

    acemary

    Joined:
    Oct 26, 2015
    Posts:
    2
    Progressive light transport simulations aspire a physically-based, consistent rendering to obtain visually appealing illumination effects, depth and realism. Thereby, the handling of large scenes is a difficult problem, as in typical scene subdivision approaches the parallel processing requires frequent synchronization due to the bouncing of light throughout the scene. In practice, however, only few object parts noticeably contribute to the radiance observable in the image, whereas large areas play only a minor role. Web Designing Training in Chennai :) | PHP Training in Chennai :)
     
  20. megmaltese

    megmaltese

    Joined:
    Mar 19, 2009
    Posts:
    1,940
    I'm having the same problem as the thread starter.
    So after one year, we are still at the same point?
    That's pretty bad, if you ask me.

    And as Tudor wrote, the whole purpose of GI is to have a realistic ENVIRONMENT, read: LARGE MESHES.
    You know, GI is launched to light ENTIRE MAPS, and of course you do not build entire maps out of small parts, as you would raise the number of drawcalls to impossible levels.

    If I knew this, I would have stuck with Unity4, of which I own a license.
    I think you should fall back and reintroduce Beast, if you can't make this thing work, and I'm pretty sure EVERYBODY in the community will agree with this, put apart people that make small games with small maps, probably only for mobile games.
     
    lliviu likes this.
  21. bart_the_13th

    bart_the_13th

    Joined:
    Jan 16, 2012
    Posts:
    220
    I usually scale down the whole world, bake the lightmap and scale it up back to get it work...
    The problem is you have to readjust all the light(especially point light) distance...
    I only use directional light atm so no problem yet
     
  22. megmaltese

    megmaltese

    Joined:
    Mar 19, 2009
    Posts:
    1,940
    I don't think that's anything you can do for a serious project. Too much can go wrong, it's tedious, it's time taking, but I'm glad it's ok for you. I fall back to Unity 4.
     
    TTTTTa likes this.
  23. Tudor

    Tudor

    Joined:
    Sep 27, 2012
    Posts:
    63
    Actually, they are working on a progressive path tracing baking system. They said there's a GDC talk from this spring, but I can't find it anywhere (all google gives me is this from 2014).

    What's baffling to me is how they knew pathtracing was the normal thing to do, but they went with this enlighten geometry clustering bollocks instead, and chose to struggle with it for over a year.

    They should have stuck with beast for all non-realtime baking, and focused 100% of their development on the path tracing.
    Since they will stick with the existing Enlighten Realtime GI for the realtime part (because that's actually amazing, it works, and can't be done with raytracing for now), and switch just the baked part with path tracing.

    They said somewhere on the forums that they plan to release some version of the pathtracer this summer. Though in Unity time, this might mean it's only going to become usable in another year...
     
  24. megmaltese

    megmaltese

    Joined:
    Mar 19, 2009
    Posts:
    1,940
    Thank you! I decided to strip GI from my project, as it's not necessary and I can reach good look without it, but I can hear the screams of the studios trying to achieve anything with this system... there seem to be a managerial issue here, as well as a programmers incapacity to reach the objective. No offense intended, I think it's clear there are some problems, and the problems are protracting for years.
     
  25. lliviu

    lliviu

    Joined:
    Aug 3, 2013
    Posts:
    7
    so sad that this is still an issue
     
  26. flipperipper

    flipperipper

    Joined:
    Jun 15, 2017
    Posts:
    1
    still got it and I have tried everything here.

    Thanks heven for 7/11
     
  27. kloogens

    kloogens

    Joined:
    Jul 1, 2015
    Posts:
    65
    Even with my monster rig, I had tons of problems with light baking in 5.6.0.
    I sliced my object into smaller piece using 3dsmax.(ugh)
    Still had issues , and baking still took forever. Made many attempts with different settings and still couldn't complete without tons of errors.

    I upgraded to 5.6.2 and so far it work without any errors. I did bake on "Very Low" , so I'll try it with higher settings and see what happens.The baking process itself was much faster, so hopefully my next edit won't be several hours from now.


    Edit: Okay after another day for testing what I discovered isn't making much sense to me.
    Upgraded to 5.6.2.f1
    Cleared the GI Cache.
    I sliced one big object into a bunch of small pieces.
    Created a new project imported the sliced up object.
    Set all the pieces of the sliced up object to "Static"
    No Other assets imported.
    Baked the scene with the default settings with exception to changing the Light Map Parameters drop down to Very Low Resolution.
    Bakes fast and with no errors.. That's good.

    However....

    It doesn't work when I.
    Open my original project (very big).
    Create a new scene.
    Clear the GI Cache.
    Add that exact same sliced up object to the blank scene.
    Set all pieces to "Static"
    Import settings for that object are the same between the two projects.
    The light bake settings are the same between the two projects.
    Fails with 'Baking Resources' job failed with error code: 3 ('Failed reading Bake Input System file.').

    Only differences I can think of.
    Original project has been migrated over several versions of Unity vs the new project was just created in the latest version 5.6.2.f1
    Some asset in the original project is somehow interfering with the light baking. Perhaps the Alloy shader frame work which the original project is using but not the new one. Either way I can't spend days working on this , so any suggestion are greatly appreciated.
     
    Last edited: Jun 28, 2017
  28. kloogens

    kloogens

    Joined:
    Jul 1, 2015
    Posts:
    65
    I feel your pain. What version are you using? I just upgraded to 5.6.2 and my scene baked for the first time without errors.