Download

Rotating lightmaps?

I’m trying to create a system to procedurally generate random levels by arranging and connecting pre-made rooms/ levels.
Currently I am using level streaming to accomplish this – each ‘room’ is stored as a separate level, and after the map layout is generated, instances of the needed levels are created and streamed in at the appropriate transforms.

Ultimately, I would love to be able to use static lighting, but I’ve run into difficulties.

When streaming in levels with baked lighting, I can translate the levels just find, but rotation results in bizarre behavior that breaks the lightmap. In particular, large yaw rotations remove the lighting from any walls, while leaving floors and ceilings intact.

Static lighting breaking when rotating objects makes sense under normal conditions, but in this case I am rotating the entire scene – the lightmaps should still be valid at this new orientation.

I have a poor work around (create multiple pre-rotated versions of each room, and stream in the appropriate one depending on the desired rotation), but that has a lot of problems.

Is there a better method I could use to get my desired results? Or failing that, could anyone point me in the right direction for the renderer code I should look at if I want to modify lightmaps to accept rotations?

Sorry I am writing this for a selfish reason but can you at least shoe the line that “rotates” the lightmap ? Are you using FRotator ?

I am also trying to rotate a component attached to a character you see, maybe we can help each other ?

Thanks :slight_smile: