How can I manage lightmap baking per level?

Hi,

I’m trying to wrap my head around some possible future problems in a project. This is regarding baking the lightmaps for the huge maps.

I will most likely use level streaming volumes to optimize runtime performance, but here’s the question - can I somehow bake lighting per level, while keeping it consistent with surrounding levels? Sounds confusing, I know, but imagine you have adjacent city blocks full of architecture and props, is there any way to bake block A separately, while making sure that any shadows it casts on block B are respected? Baking all levels is an option, of course, but I’m worried to potentially get to the level of detail that my machine just won’t be able to bake.

Thanks for any ideas!

Hi BrickTop,

This post I recently helped another dev with may be of help: https://answers.unrealengine.com/questions/132986/lighting-streamed-levels-located-at-the-same-place.html

In that link I provided a test project that may help with some of the information I’m about to share.

can I somehow bake lighting per level,
while keeping it consistent with
surrounding levels? Sounds confusing,
I know, but imagine you have adjacent
city blocks full of architecture and
props, is there any way to bake block
A separately, while making sure that
any shadows it casts on block B are
respected?

Yes and possibly no, Yes you can bake lighting per level so long as these are individual levels and not part of the persistent level. Anything in the persistent level will be baked and visible to all other levels.

I say no, because for instance, when you build lighting for these levels and they are directly adjacent to each other you will need the levels to be visible at the same time lighting is baked otherwise it will not cast shadow information onto the adjacent level.

In my example project, The user wanted to have two levels occupy the same space and have different lighting and lightmaps for each. I set up three levels.
1 - My persistent base level that holds all other levels and only has my player start and a mesh to stand on
2 - Map 1 - that will be my day map
3 - Map 2 - that will be my dusk map

The theory is the same here even though I’m occupying the same space. If I had these set beside each other, when I bake lighting I’ll need both of those levels to be visible for shadow information to be baked onto the other level assets. If it’s not,the shadows will not be present.

The only way around this is to put the objects you want to cast in all levels below the persistent in your persistent level when you build lighting.

I hope this makes sense and hasn’t been too confusing. Let me know otherwise and I’ll see if I can better explain.

Thanks!

Hi ,

Thanks for your detailed answer. Basically, it is how I suspected it to be :slight_smile: Well, then it looks like the only way would be to bake all of them at once, will have to optimize as much as I can. I guess bigger developers would just setup render farm with few machines for lightmap calculations and never have to worry about that.

Cheers!