Baking light into prefabs

Probably not a 5.x specific question, but anyway…

Can I build prefabs of rooms and baked their lighting, then put them into any scene later with other rooms that have been separately baked?

You can’t lightmap prefabs using Unity’s built in lightmapper. You can only lightmap them once they’re in the scene (and then the lightmap data is tied to the scene, not the prefab)

It’s not possible currently, but it’s been hinted at that you’ll one day be able to additively load scenes with the accompanying lightmaps. So… someday… you’ll kinda be able to… maybe?

That sounds like a sloppy solution. I suppose this feature simply doesn’t exist in the workflow for now (no problem) but it would be nice to have some more control over the baking to make things more flexible, not to mention more efficient if you don’t need an entire level mapped and could use the same mapping per prefab. On my wishlist for sure.

You can always create secondary UVs and bake the light in an external program.

Or better yet - since your prefabs would all have the same baked light, just bake it into the diffuse texture so you only need one texture (unless you reuse or tile the original diffuse texture for various non-identical objects).

We’ve seen the feature request for baking lightmaps per prefab before and we’ll see what can be done in 5.x. No promises though, as some settings are inherently tied to a scene and need to be fetched from somewhere when the bake is done just for one prefab.

Anyway, we hear you. :slight_smile:

That said, working with baked data in multiple scenes loaded additively will be our focus fairly soon.

1 Like

Thanks for the update, and looking into it.