Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Bake Enlighten faster? settings, multithreaded question, etc

Discussion in 'Unity 5 Pre-order Beta' started by p87, Nov 15, 2014.

  1. p87

    p87

    Joined:
    Jun 6, 2013
    Posts:
    318
    Enlighten takes forever to bake (using i7 2600k cpu, plenty ram, GI cache is on SSD, etc) and i'm going kinda crazy. Let's say I was to get one of those 6 core / 12 thread, or 8 core / 16 thread CPUs from intel... is enlighten going to be able to take full advantage of all the processing power? Building a new machine is NP, just want to make sure it's actually going to speed it up.

    It seems like some parts of the enlighten bake are parallelized, like the JobProcess.exe sometimes fires up a few separate processes, but it never seems to completely max out my current CPU. Is there any way to just tell enlighten to bake like crazy and use 100% CPU?

    What kind of settings could i use for development purposes in the Enlighten bake to speed things up? Any settings I can lower that would significantly speed it up just for testing in the editor and rapid iteration? It basically can't keep up with just placing things in the scene. I am waiting all the time. It feels like even when I put a small object in the scene it will rebake the entire scene.
     
    Last edited: Nov 20, 2014
  2. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    We are not going 100% on all CPUs, as we want the system to feel responsive while baking. If we use as much CPU as possible, the machine will be unusable for development while the bake is in progress.

    The parallelized baking is able to go as wide as the number of CPU cores in your machine, so the more cores the better. If you have a small scene with only a few systems (have a look at the GI - Systems scene view mode), there might not be enough work to saturate all the CPUs. If you are at the very end of a stage (Light Transport is a stage), you could see lower CPU utilization if there is fewer jobs left to solve that the number of CPUs. We have wait for the last job to complete before we can advance to the next stage and go wide again.
    Some of the quick steps are not parallelized, like the Tetrahedralization of light probes, but this step should not take too long anyway.

    If you lower realtime and baked resolution it will finish computing faster.
     
    Sungold and p87 like this.
  3. p87

    p87

    Joined:
    Jun 6, 2013
    Posts:
    318
    Good to know, thanks for the info and tips on realtime/bake resolution.
     
    Last edited: Nov 20, 2014
  4. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    I've made the same experiences, gi baking really takes such a long time even on a new I7 cpu that its unusable for me right now (large outdoor archvis). Hopefully its algorithms will be heavily optimized soon.
     
  5. p87

    p87

    Joined:
    Jun 6, 2013
    Posts:
    318
    Yeah.. I'm using terrains and it takes forever. I would get a new machine but then it'll probably be like 15 minutes instead of 30... still way too long.

    From my experience, the editor is laggy when it's baking (even though it's not using 100% CPU). So personally I would love if there was a setting where I can devote 100% CPU to the bake so I can get it over with faster.
     
  6. daisySa

    daisySa

    Joined:
    Dec 29, 2011
    Posts:
    341
    Are there any other ways we can reduce the baking time? I've set realtime and baked resolution to 1, and it still doesn't finish baking when left overnight (3.4 GHz quad core i7, 32 GB).
     
  7. Roni92

    Roni92

    Joined:
    Nov 29, 2013
    Posts:
    225
    You can choose how much of CPU is used for GI from what I see. Or is it only for precompute?
     
  8. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    @Roni92 The Realtime GI -> CPU Usage is how much CPU is devoted to GI when your game is running. Not related to baking.

    @daisyDynamics it sounds like you have a terrain or another very large object in your scene. A resolution of 1 can still be a lot if your level is spanning several kilometers. You can assign a lower resolution to specific objects by assigning custom LightmapParameters to it. Go to Assets -> Create -> LightmapParameters or select on of the defaults in the Lighting -> Object tab.
     
    Journeythedev and FVANtom like this.
  9. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    I did some further testing and here are my tips:

    1.In SceneWindow set the little rollout on the top left from "Textured" to something with "GI-" so that the Lightmap resolution is displayed like a checker map. This pattern will only appear when you once have baked your objects (bug to me: the resolution should be un/visible by click).

    2.Ensure that the pattern is more or less rough.
    Think about that each checker square means one pixel in the lightmap.
    The more dense the pattern looks, the more accurate the result will be, but the longer will be the rendertime, too.

    You can adjust the density of the resolution in different ways:
    - Open Lighting Window (Scene) and look at the Realtime GI section, adjust Realtime Resolution
    - Open Lighting Window (Scene) and look at the General GI section, adjust Default Parameters
    - You can override these settings per object in the Lighting Window (Object)
    - If the pattern is still too narrow, make a new preset with a lower reolution
     
    Last edited: Dec 9, 2014
    p87 likes this.
  10. daisySa

    daisySa

    Joined:
    Dec 29, 2011
    Posts:
    341
    @KEngelstoft Thanks, the terrain seems to be causing the issue even though it's set to VeryLowResolution. If I disable static light mapping on the terrain, it completes the light mapping very quickly.

    @Cascho01 Thanks, changing the defaults under General GI to low res makes a big difference.

    Thanks guys, that's been really helpful.
     
    Last edited: Dec 9, 2014