Search Unity

Question Baked lighting takes days for 256 terrain tiles - but like 2 min for 16..?

Discussion in 'Global Illumination' started by joeysipos, Sep 9, 2022.

  1. joeysipos

    joeysipos

    Joined:
    Jul 28, 2015
    Posts:
    41
    So I have a map consisting of 256 terrain tiles. I did a test baked lighting test on 1 terrain tile and got it down to bake at like 2 seconds or less. I assumed ok 1 tile at 2 seconds I should be able to do 256 in less then 5 min. But no, enable all 256 terrains and the Global Illumination time goes to like days... 16 tiles takes about 2 min. 32 takes about 5 min. 64 takes about 30 min. it seems to be like exponential...

    I was thinking maybe I could do 16 tiles at a time, but no, each time I hit bake lighting it resets them all and does them all again... Is there like a way to fix this? Or I could save the baked lighting data from 16 at a time so I can incrementally bake them quickly?
     
  2. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    How large are the tiles? I suspect that doubling the amount of tiles will increase bake times in a quadratic fashion (4x).
    You could bake sets of tiles in separate scenes, and then load them additively.
    If you happen to have a small reproducible project for this, consider reporting a bug.
     
  3. joeysipos

    joeysipos

    Joined:
    Jul 28, 2015
    Posts:
    41
    Hi kristijonas, do you know if the terrains would auto connect if I blocked them up in separate scenes and then loaded them on the fly? Also out of curiosity, when you load and unload scenes does the memory get loaded then destroyed. This could actually help with some memory issues I have with mobile platforms.
     
  4. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    My understanding is that they should reconnect, but I might be wrong. This is a good question to ask in the World Building subforum.

    Unity should release memory when GameObjects are unloaded. If you happen to notice that it's not the case, please report a bug.