Baking Lightmaps for different Object states

Hello!

I have some CAD-Files/Machines which by interaction can be opened up and closed. Is there a way to bake Lightmaps for both states?

For now I built some pretty complex setup in Houdini which allows me to bake both states into a single map, but externaly baked AO and shadows just a workaround and good practice I guess…
​​​​​​​
FIrst I was thinking to bake the to objects separately in UE and merging them later.

But doing it like this, both objects would miss some shadows and AO.
To explain what I mean: imagine a house with a big roof and the roof could be hidden to look inside. If I would bake the house and roof separately to assemble them later, both objects would lack some AO and shadows they would cast onto each other.

The other way would be to use two completely different (open/closed) meshes/versions and switching them via blueprints, but I am not sure if that’s a good approach in terms of memory…

Some recommended looking into lightmap scenarios, but I did not fully understand how they are actually supposed to work and if they the right way.

Would be great if somebody could point me into the right directidirection.

​​​​​​​Thanks Felix

The direction you’re looking for are Sublevels.

Just let the engine handle it by making the objects movable and using dynamic lighting.

Aside form that, if you had to leverage the engine for whatever reason.
single empty level with just light and object posed as needed…
Bake.
Access lightmaps and export the generated file.

Repeat with different pose.

Now you have the 2 textures to use. You can lerp between them in the material as the object is opened/closed which will give you a somewhat wierd effect - however it can work. Depends on what the object is really.

Also, AO has nothing to do with the enviroment (lack or presence of a roof).
An AO map is just how an object is “most likely” to be lit.

Basically it’s a way to make corners/crevices darker than they would otherwise be without using the AO map.
re-read up.

Thx for your reply. Dynamic lighting won’t be an option since I am building for Mobile/Oculus Quest and dynamic shadows would be to heavy.

Can you explain a little more how exactly the lightmap export would work? Does this mean I would have to set the maps up as part of the shader in each material or is there another a special way to feed them back into the “lightmap slot”?

Just because you are building for VR doesn’t mean you can’t use dynamic lighting.