Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Lightmaps always bake but UNity says it's out of memory to store them

Discussion in 'Global Illumination' started by mike215x, Mar 14, 2019.

  1. mike215x

    mike215x

    Joined:
    May 2, 2018
    Posts:
    3
    Hello, I've been having a problem with the Unity lightmap baking. It bakes the lightmaps, at least I'm pretty sure it does because everything looks good, but it doesn't completely finish, it goes to "1/1 Write Lighting Data" step and then just continually has these errors

    Failed to reserve memory for scene-based lightmaps.

    Integrate failed on Write Lighting Data job.

    It seems to have all the memory and hard drive space it would need, the GI cache is set to something like 128GB

    I have to hit the cancel button on the lightmap bake to stop Unity constantly trying to copy these exr and png files somewhere. It looks like it's trying to copy these files somewhere, can I just do that manually somehow?

    So it'll look good in the editor until I try to leave and come back or make a build, then it looks like crap, everything is blue and red and not lit at all.

    Any ideas? This project has been used across several Unity Versions, is there a way to clear out lightmap data that might clear this up? I've already tried deleting the whole library folder and having unity rebuild the project but no matter what or if I'm using enlightien or progressive lightmaps i get the same thing.
     
  2. mike215x

    mike215x

    Joined:
    May 2, 2018
    Posts:
    3
    I've seriously been trying to figure this out for days now and I've tried so many things and Unity versions but I keep getting the same result, it works but it refuses to complete the last step and it essentially does not work at all because of that

    https://photos.app.goo.gl/RCRU69QM9NLhko9Y6

    this is really frustrating, since there's no indication what the problem is I just have to try everything to see if anything works
     
  3. mike215x

    mike215x

    Joined:
    May 2, 2018
    Posts:
    3
    I might be close to tracking down the issue. I can get it to work right with certain things disabled, what makes it really tough to figure out is you can't just disable stuff to make the error stop, you have to disable the objects and restart unity then try to rebuild the lightmaps, that made it hard to figure out.
     
  4. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    Hey! Judging from your screenshot, it seems that you have both realtime GI and GPU lightmapper enabled. Do you really need to use both? If the lighting in your scene is going to be mostly static (that means no dynamic time of day, etc.) then you'd be better off using progressive lightmapper only.

    What I would suggest to do now, is disabling realtime GI, and switch to CPU progressive lightmapper. Disable light probes and reflection probes in the scene, and try rebaking. If the bake succeeds, then re-enable probes, and rebake again. We've had some issues in the past with the GPU lightmapper which prevented the scene from baking if light probes were present. It has now been fixed in the latest 2019.2 alpha.
     
  5. Thee_Mr_J

    Thee_Mr_J

    Joined:
    Feb 13, 2018
    Posts:
    2
    I also have this issue, im using unity 2019.8.1. For me it occurs when creating a new scene then ADDING a new scene (Multi scene editing). Then do any baking with the Progressive CPU lightmapper. You will then see the errors spamming in the console. Saving the added scene first will prevent this but I would rather not. Also using the enlighten lightmapper will not yield these errors. Could this be a bug? Thank you.
     
    Last edited: Aug 7, 2019
  6. rasmusn

    rasmusn

    Unity Technologies

    Joined:
    Nov 23, 2017
    Posts:
    103
    Yeah, this sounds like a bug. We would be thankful if you would be so kind and report it. You can do this from Unity's menu: Help > Report a Bug. More info about bug reporting.
     
  7. Thee_Mr_J

    Thee_Mr_J

    Joined:
    Feb 13, 2018
    Posts:
    2
    Thanks rasmusn, I have submitted a bug report for this.
     
    rasmusn likes this.
  8. Lightning_A

    Lightning_A

    Joined:
    Nov 30, 2018
    Posts:
    7
    I had this issue too, but I fixed it by clearing my GI Cache
     
  9. JohnPontoco

    JohnPontoco

    Joined:
    Dec 23, 2013
    Posts:
    298
    I'm still seeing this error, but clearing the GI cache does not fix it. Unity 2020.2.1f1
     
    laurentlavigne likes this.
  10. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,473
    still getting this error in 2022.LTS
     
  11. caden3ds

    caden3ds

    Joined:
    May 17, 2017
    Posts:
    51
    Same