GI Workflow : Iterative vs OnDemand

Hi guys,

I’m very frustrated with a strange behavior of lightmapping in U5beta.
When I switch Iterative to OnDemand workflow, I have 2 different results of baking.
Take a look:

Iterative Workflow:

OnDemand Workflow:

I presume this is a bug.
If not, how can we save an iterative baking?
Because each time we push on the play button and then stop, the iterative workflow starts a new baking, even if nothing has changed in the scene… quite embarrassing.

Here are the lightmaps… The result is different (left window) but the maps seem the sames otherwise (right window).

Iterative:

OnDemand:

Also, if we cannot bake with onDemand in the same way we are baking with iterative, how can we manage static and non-static gameobjects, ex:

I have a lift with a door. With Iterative Workflow, I need to set static as true on all the lift elements to have a uniform lightmapping. Otherwise, if my door is static selected, I cannot open it with a script anymore. Then it has to be set on static false after baking. But then, Iterative Workflow restarts a baking… without the door because it does not have static selected… The only way > OnDemand workflow… but it doesn’t render the lightmap correctly :frowning:

When the Atlas Resolution is 2048 and bigger, I also have noticed a huge, awfully huge, hard drive process (not CPU, which is always at a high level but of course this is normal). It freezed my computer a few times (i7, GeForce GTX590, SATA HD 2Tera, 16G RAM). And the GICache is very huge too, like 30-40giga for a 350mb lightmap. I had to prepare a dedicated hard drive just for one project.

Thanks for your help.

On Demand and Iterative should give the same result. On Demand is taking the exact same code path for the most part, but just puts the results in the Assets folder and patches them slightly differently in the Editor into the scene on scene load.

We just fixed the issue of Directional Lightmaps looking differently in those two workflow modes. The fix will be available to you next week-ish. The workaround until then: select the lightmap/texture with directional information and change import settings to Advanced and then change Encode RGBM to Off.

On Demand is there exactly for that purpose – to allow you to save out results of the Iterative workflow. As I said, they are almost identical for the most part.
Iterative workflow shouldn’t do anything when you exit play mode if it was done baking before entering play mode. Please submit a bug on that with a repro project.

Checking the static toggle that you see at the top right of the inspector marks the objects as static for all the systems in Unity. If you want to move an object you should make sure that it’s not marked Batching Static. You can change that by pressing the arrow pointin down next to Static label. Unchecking a few other flags in there might also make sense, depending on your use case.

Changing Atlas Size should not affect the precompute/bake time. It will only do so in case a single object reached that size and was clamped – then increasing the atlas size will make the object get more texels and the bake will take more time.

Changing Bake Resolution does affect bake times a lot, of course.

Also, please don’t get frustrated. :slight_smile: If something doesn’t work as expected just post here, we’re here to help.

Cheers!

Thanks a lot for this complete explanation Kuba!!
I feel much better :slight_smile:

This topic was the most helpful for me also. I could not get one single scene built in compiled MAC version (it always end up stuck on Enlighten calculation or something). I changed to On-Demand and now it works. With Iterative, it never works while building, only in editor (and then my MacBook Pro ninja starts to burn on fire, lol).
Please, if possible, can any one of you post some links or explain to me the real different between these 2 modes? I saw many topics, but each of them explained different things. What is the best to use in real time light change situations and what is not?
Thanks.