Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Lighting Modes - out of memory - bake selected?

Discussion in '5.6 Beta' started by CodeBison, Dec 22, 2016.

  1. CodeBison

    CodeBison

    Joined:
    Feb 1, 2014
    Posts:
    242
    The new lighting modes look great, and are very promising from the results I've seen in the little test scenes I've put together. I'm having trouble baking my first real scene though. I keep running out of memory and having Unity crash. From what I've read, the solution to this sort of thing for large scenes in the past has been to use "Bake Selected" and bake your scene in chunks. This doesn't seem to be an option with the new lighting modes, however (unless the button has just been moved and I've missed it). Is there a way to do something like the old "Bake Selected" option? Or if not, is there another way to overcome memory limitations with the new system?

    Thanks!
     
  2. smcclelland

    smcclelland

    Unity Technologies

    Joined:
    Dec 19, 2016
    Posts:
    126
    Bake Selected was only available in the Unity 4.x builds but has not been brought forward into 5.x unfortunately. If possible could you file a bug and attach the scenes you're getting the crash with and provide us with any other details? Stuff like amount of system memory, cache size, etc. Thanks!
     
  3. kemalakay

    kemalakay

    Unity Technologies

    Joined:
    Jul 12, 2016
    Posts:
    224
    Hey @CodeBison

    As Shawn said, we would appreciate if you can share more details. For instance, can you specify which platform you are using?

    Thanks!
     
  4. CodeBison

    CodeBison

    Joined:
    Feb 1, 2014
    Posts:
    242
    Ah, cache settings! I'd forgotten about those since I haven't done any baked lighting since my initial tinkering with 5.0. I had my cache size set to max 10GB. I've moved this to another drive and increased the limit. I'll let you know how it goes.

    In case it's helpful, here are some details about my project and config:
    • Dev platform: Windows x64
    • Target: Windows x64
    • System RAM: 16GB
    • GI Cache: 10GB (now changed to 200)
    Lighting Config:
    • Dynamic Lighting: Disabled
    • Stationary Lighting: Enabled
    • Mode: Distance Shadowmask (remainder of Lighting settings at defaults
    Scene details:
    • Stationary lights: 179
    • Static meshes: 2964
    Out of curiosity, what's the criteria for which lighting mode gets set on lights by default? Most of my lights ended up Stationary, bot some were Dynamic even though they were set static.

    Thanks!
     
  5. CodeBison

    CodeBison

    Joined:
    Feb 1, 2014
    Posts:
    242
    Increasing cache size made no difference. My cache folder is only 1.7GB, but my system still runs out of RAM while baking and Unity crashes.

    I'll try and pull out the elements of my scene into a repro project so I can post a meaningful bug.
     
  6. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,427
    I'm also getting run out of memory when baking
     
  7. smcclelland

    smcclelland

    Unity Technologies

    Joined:
    Dec 19, 2016
    Posts:
    126
    @CodeBison, @rea - if both of you could zip up the scenes, submit a bug and let me know the bug # I'll take a look into it with the team to find out what's going on. Thanks!
     
  8. kemalakay

    kemalakay

    Unity Technologies

    Joined:
    Jul 12, 2016
    Posts:
    224
    @CodeBison, @rea - Are you using any custom shaders in your projects or only standard shader? If you're using surface shader, they should be upgraded automatically but this is not the case if you created your custom shaders using traditional vertex/fragment shader approach. So when you are available, it would really be appreciated if you can provide a reproducible project.
     
  9. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,427
    i would like to, but i cannot repro the problem anymore :s
     
  10. kemalakay

    kemalakay

    Unity Technologies

    Joined:
    Jul 12, 2016
    Posts:
    224
    Well, that's good news. For future reference, it's worth mentioning here that sometimes you have to delete Library folder from your project while upgrading. This may also fix some of the issues you encounter.

    Thanks!
     
unityunity