Hello! I’m trying to bake the light maps on 6 large terrains and it’s giving me an out of VRAM error (I have 24gb). I know that I could reduce baked texture resolution but that’s out of the question form my use case. Also I have made a test in a different scene with 350 baked lightmap textures at max resolution (4096) and it does it without issue.
So I imagine that this is a terrain geometry issue.
However if I only bake 1 terrain Lightmap at a time I can bake. The thing is, I can’t, because baking it one by one removes the lightmaps of the previous ones.
Is there a way to bake the terrains lightmaps individually and then combining them? I suspect I would have to subdivide the terrains to do this but the deleting of the lightmaps still stands.
The issue likely isn’t the amount of lightmaps, but the amount of polygons in the scene. We don’t have many solutions for dealing with this, but there are some:
You can split the scene into several smaller scenes, for example with 1 terrain each, and bake each scene separately in isolation.
You might also be able to lower the terrain resolution before baking, then up it again after baking.
Finally you can try using the CPU lightmapper if you have more RAM than VRAM. It’ll be a lot slower to bake, though.
Thanks for answering!
If I split it into different scenes, how can I then recombine the terrain again? (I’m doing an open world game and the entire map needs to be working at the same time in realtime as different events are occurring all over the place). I’ve found a plugin that allows me to bake the light maps to prefabs and then spawn the prefabs in realtime with the light maps attached.
However I’m also using the new Unity’s Adaptive Probe Volumes. Do you have an idea of how I could bake them separetely and recombine them? If I try to do it right now with the terrains it gives an error UnifiedRayTracingException: Can’t allocate a GraphicsBuffer bigger than 2GB).
That sounds like a great idea thank you!! In the meantime I’ve found a way to bake everything in one scene. I had to do 2 comprises though:
Reduced the height map texture of all 6 terrains from 4096 to 1024.
Subdivided the terrains by 4 (9 tiles from 1), so now I have 54 terrains (They are 30km2 in total). This was needed to make the Adaptive Probe Volumes be able to bake and not get the “UnifiedRayTracingException: Can’t allocate a GraphicsBuffer bigger than 2GB” error.
I’ll keep the Additive Scenes in mind though, as they may come in handy for other stuff. Thanks again!!
(If anyone reads this in the future for context: I’m baking on an M4 Pro Mac mini 2024 with 24 GB of Unified Memory and 512 GB of SSD. Mac OS Sequoia).