Trying to get dynamic lighting to work for my game.

I’m trying to light my game world dynamically using a day-night cycle. I have interior and exterior spaces. My problems happen when trying to light interior spaces. Static lighting is DISABLED and I currently have a movable Directional Light as my sunlight and a skylight. Without the skylight the interior is too dark. With the skylight none of my meshes have shadows. In the picture attached, the light coming through the window is perfect but the shadows of the meshes just dont exist!

What can I do in this situation? Do I need to be using ambient occlusion? Or am I being an idiot?

Thanks for any help in advance.

Hey jakenicolaides,

So this is actually a common workflow question that just requires a bit more knowledge on how your light types work with each other, and how to incorporate Dynamic lighting for an Interior and Exterior level.

The important thing to remember is that Stationary mobility light types can utilize baked static lighting and dynamic shadows through the use of cascaded shadow maps and ray traced distance field shadows.

Lightmass generates distance field shadow maps for stationary lights on static objects during the lighting rebuild. Distance field shadow maps provide very accurate shadow transitions even at low resolutions, and with very little runtime cost. Like lightmaps, distance field shadow maps require uniquely unwrapped UVs on all StaticMeshes using static lighting.

Stationary Lights

Skylights

Your best bet would be to use a Movable skylight and a Stationary Directional Light. After building your lighting, you can control that ambient light values by changing the Skylights intensity and yes, using Distance Field Ambient Occlusion to get your shadowed areas (like your indoor scene) to appear more accurate. It is a balancing act when trying to get the lighting correct for and exterior/interior scene and using features like Auto-Exposure to control that transition will also help.

Check out the below documentation for more helpful tips and ways to improve your lighting to get accurate and believable results.

Lighting Quick Start Guide

Lighting Troubleshooting Guide

Let me know if you have further questions or need additional assistance.

Regards,

Thank you so much for the quick, thorough response.

If the directional light is stationary, I wont be able to rotate the sun and therefore create day cycle effect though no?

You are correct, apologies for overlooking that detail in your original post. Since you are animating a day/night cycle using a Movable directional light, all of your objects will be casting a dynamic shadow. Be careful as that can become quickly performance heavy the more shadow casting you have in the scene.

Also, you can still use the Cascaded Shadow Maps and Ray Traced Distance Field Soft shadows, for your Movable Directional Light. You will want to tweak the settings on a per project basis based on your needs.

For the Skylight, I would also take a look at the tutorial written by one of our tech artists and engineers.

Blending Between Multiple Skylight Cubemaps in Blueprints

The great thing about the skylight cubemap is you can change its intensity at runtime to tweak moving from indoor to outdoor and visa versa. It will give you greater control over your scenes lighting.

Cheers,