Use Cascaded Shadows

Enabling Dynamic Cascaded Shadow Maps

To use Dynamic Cascaded Shadow maps in your UE4 mobile project, you will need to perform the following steps.

  1. Open up the Project Settings and then go to the Engine > Rendering > Mobile section and make sure that Enable Combined Static and CSM Shadowing is enabled.

    Click for full image.

  1. CSM will only work if you have a Directional Light in your scene. If you do not have one, add one now and make sure it is selected. Then under the Transform section ensure that the Mobility setting has been set to Stationary.

    Click for full image.

  2. With the Directional Light still selected, go to the Details panel and locate the Cascaded Shadows Maps section and adjust the following properties on your Directional Light.

    Click for full image.

    • Dynamic Shadow Distance Stationary Light: 2,000

    • Num Dynamic Shadows Cascades: 1

    • Insert Shadows For Movable Objects: False

    The above settings are only suggestions so feel free to change and experiment with the values to find ones that will best fit your project.

  3. Inside of you project's level select any Static Meshes you want to receive CSM and in the Details panel under the Mobile section, enable the Receive Combined Static and CSM Shadows from Stationary Lights option.

    Click for full image.

    The following video demonstrates what the Receive Combined Static and CSM Shadows from Stationary Lights option does. In this video the Receive Combined Static and CSM Shadows from Stationary Lights is turned on for the Static Mesh that makes up the floor but not on the Static Mesh that makes up the stairs. Notice how when the player is on the floor they have a shadow but not when they are on the stairs. This is because the floor has the Receive Combined Static and CSM Shadows from Stationary Lights option enabled while the stairs do not.

  4. From the Main Toolbar, change the Play Mode to Mobile Preview and press the Play button to launch the level.

    Click for full image.

    If you do not see the Mobile Preview window being displayed, make sure to check that it did not launch behind the Unreal Editor window.

  5. Once your level successfully launches, position your character in a location that has static shadows and when you go in and out of the shadow, your character's Dynamic Shadows should now blend seamlessly with any baked shadows in the level like in the image below.

    Click for full image.

    If you want shadows from Static Meshes placed in the environment to cast shadows on the character, you will need to change the Mobility settings on the Static Mesh from Static to Movable.

Tags