I’m lightmapping a fairly large terrain (4000x4000) with a lightmap size set to 4096. There’s about 17 lightmaps produced as a result. The maps are computed correctly, but when importing them from Beast at the end of the run, Unity crashes. As a result, the new lightmaps aren’t imported, even though they are there and correct, and the whole operation is just a waste of time.
Mac OS X, 4 GB RAM (at no point does Unity or Beast run out of memory), Unity Pro 3.3.
Questions:
I’ve read somewhere that there used to be a problem with terrain lightmaps of size 4096x4096. Does this bug still persist?
Any idea why Unity crashes?
Why doesn’t Unity import the lightmaps?
Is there a way of importing them manually, so I don’t have to go through the lengthy build repeatedly?
Memory allocation in Unity when importing a lot of large textures needs to be improved and it looks like you’re running into one of it’s issues.
We’ll have it fixed, but in the meantime there are some workarounds you could try, apart from the obvious baking fewer/lower res lightmaps:
After Unity finishes the bake and crashes, restart it. The lightmaps should be in your project folder, but they won’t be imported and scene information about which lightmap goes where will be lost. This can be fixed with some manual work, though. First try forcing Unity to import those lightmaps one by one. Then open the lightmapping window, go to the Maps pane, assign lightmaps to the slots. Finally select each of your terrains, go to the Object pane in the lightmapping window and input lightmap index corresponding to the slot number where you assigned the lightmap for this terrain. (for objects that aren’t terrains this might be more tricky, as you would have to guess lightmap scale and offset as well)
After you restart Unity, you can also try forcing it to import lightmaps at lowest resolution possible. After import is complete, bake the scene again. When bake finishes, Unity will attempt to import the lightmaps with your settings (assuming every new lightmap is overwriting an old lightmap imported in low res), which hopefully should succeed and atlasing info will get updated on all scene objects as well. Then you can save the scene and one by one reimport the lightmaps in the full resolution.
For what it’s worth, I’m having this problem too. I baked an architectural vis@200texels, which completed creating 42 1024x1024 lightmaps, none of which Unity managed to import :(. (I have a 2GB E4500 machine running XP32 with Unity Free 3.3)
@robert Reviewing your workarounds, number 1 is not feasible as I have too many objects in my scene to realign lightmaps to. Which leaves me with option 2. But, unfortunately, I don’t quite understand the procedure you’ve described, sorry. In particular:
“try forcing it to import lightmaps at lowest resolution possible” import the completed lightmaps? at “lowest resolution possible”, what does this mean?
“bake the scene again” - with the same settings as the first bake? necessary to generate the correct number of slots (42)? (have I got 5hours to risk on a workaround?!!)
Could you/someone else more knowledgeable than I please explain ?
Will this issue be fixed in the next release? That would be nice .
I have a similar problem in 3.5f05 too
I try to bake a lightmap for a terrain only ( 2048 terrain and lightmap resolution ). It does all the calculations and when it’s done and about to create/import the lightmaps nothing happens. In the log I can see this:
Lightmapping done
Error: Beast crashed!
Refresh, detecting if any assets need to be imported or removed … 5.488633 seconds (Nothing changed)
It worked a few weeks back with the same terrain. I don’t know what changed.
Can we get an answer to this problem and an update from UT. This issue has made baking lightmaps impossible for our project. Yes, our scene is quite dense but not even a quarter finished. 3.3 → 3.5 and still not fixed.
with 3.5.0f5 seems when I light map anything past 50 texels, 1000 final gather rays, .5 skylight intensity 1 bounce, and AO at .3 and setting high with directional lightmaps, it blue screens my PC. i can usually manage to do it if i go really low, but what could be the issue here?? I am using 2 directional lights, one for near real time lighting, and second for lightmapping. any clues? memory leak that is crashing my PC? i have a 3.7ghz quad core, 560 GTX SC 2GB and 8GB of DDR3 and 1.6TB of harddrive space. and heat is not an issue. what gives, this is incredibly crippling to my ability to complete a job.
oh yeah and terrain lightmap is set to 1024
Hi,I have similar problem in Unity 3.5.Yeah it crashes when it tries to import lightmap.Other problems are it bakes only whenthere is net connection and swiftshader 2.but sometime(really really really rare) works without any of the above.And my terrain textures look blur(even after swiftshader2) i have used same textures and same tile size as that of bootcamp (to test).But The bootcamp textures look perfect (with swift shader 2) where as mine it’s still blur(with swift shader2 but perfect with swiftshader 3).