Dynamic shadows not updated on LoadStreamLvl

Hey there!

I have multiple levels, containing some objects in a room. The room itself is in my persistent level, together with a stationary directional light. All objects are static, the room is dynamic. Now, when I use LoadStreamLevel during the game, it doesn’t immediately update the dynamic shadows cast from the objects to the room. It will only update the shadows when I move over a specific distance from the objects. The same occurs when I unload the level with the objects, the shadows stay in the room until I cross that invisible border.

Any ideas? Is this a bug?

Hi sg_raumgleiter,

When you stream in a static object that would be casting a shadow on a dynamic object (the room’s floor) the engine will recognize this and apply a dynamic shadow once you cross the shadow cascade threshold. If you have have your “dynamic shadow distance stationary light” set to 0 (which is a default setting) it will attempt to use the lightmap (baked shadow doesn’t exist on the floor because it is dynamic) and wont render the shadow until the engine blends from the static shadows to the cascaded shadow map.

If you want to fix this issue change your “dynamic shadow distance stationary light” value to something safe like 2500 or 3000. That will allow you to cover for this area that you want to blend in static shadows vs the cascaded shadow map.

Let me know if that helps,

Ed

Thank you! Works like a charm and solves an other problem as well.

Glad I could help!