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

Light transport problem with large objects

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

  1. erana79

    erana79

    Joined:
    Jun 26, 2013
    Posts:
    61
    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:

    FlightOfOne likes this.
  2. erana79

    erana79

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

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    445
    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:
    61
    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:
    265
    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

    Moderator

    Joined:
    Jan 13, 2009
    Posts:
    416
    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.
     
    Marfalcon likes this.
  9. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    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).
     
  10. FarNiche

    FarNiche

    Joined:
    Jul 24, 2014
    Posts:
    15
    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

    Joined:
    Apr 12, 2012
    Posts:
    252
    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:
    18
    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:
    518
    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:
    15
    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:
    1,366
    @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:
    150
    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
  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. PolyMad

    PolyMad

    Joined:
    Mar 19, 2009
    Posts:
    2,350
    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:
    498
    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. PolyMad

    PolyMad

    Joined:
    Mar 19, 2009
    Posts:
    2,350
    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.
     
    ArachnidAnimal likes this.
  23. Tudor

    Tudor

    Joined:
    Sep 27, 2012
    Posts:
    150
    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. PolyMad

    PolyMad

    Joined:
    Mar 19, 2009
    Posts:
    2,350
    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:
    109
    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:
    109
    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.
     
  29. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,501
    I'm using the latest 5.6.3p2 and making an open scene! It contains several big plane meshes scaled by 8.
    1. How can I exclude my one particular mesh to be excluded from the Light map process? @DantaliaN How do I turn off Lighting just for one particular big game object?

    2. How can I lower the lightmap resolution of that particular mesh?
      Solution: Look to the manual at this link
      https://unity3d.com/learn/tutorials/topics/graphics/fine-tuning-lightmap-parameters

    3. @Kuba The lightmap can subdivide the big mesh for me automatically?
     
    Last edited: Nov 17, 2017
  30. Gmjjr

    Gmjjr

    Joined:
    Nov 21, 2017
    Posts:
    3
    If anyone is still having problems with this, here's how I fixed it.
    go to Window > Lighting > settings
    then scroll down until you see Lightmapping Settings
    after that change indirect resolution to 0.1
    Hopefully this helps :)

    PS. I'm using unity 5.6.3p4
     
    Last edited: Dec 29, 2017
    browne11 and CGChoco like this.
  31. CGChoco

    CGChoco

    Joined:
    Jan 30, 2014
    Posts:
    35
    Thanks Solved it Unity 2018
     
  32. FirstTimeCreator

    FirstTimeCreator

    Joined:
    Sep 28, 2016
    Posts:
    768
    world streamer is pointless you can float origin and never leave 0,0,0 and go in any direction in infinity with the scene distance from origin being limited by like 99,999,999 million + meters.

    All your doing is adding layers of complexity with that which is completely unnecessary when the engine is already capable.
     
  33. tromic

    tromic

    Joined:
    Jun 10, 2013
    Posts:
    4
    Sorry for the late bump on this, but.... You have to change the light settings for every scene in your build. I was, for quite a while, under the impression that they were global settings and I kept getting the same stall at 7/11. Disabled the baking for all the scenes in my app and now it builds in 10 mins. Thanks to all who pitched in on this!