Search Unity

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

Discussion in 'Global Illumination' started by mike215x, Mar 14, 2019 at 6:45 PM.

  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:
    184
    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.