Using RayTraced Distance Field Shadows

Choose your OS:

RTDFBanner.png

When you're developing your games, you will find that there are situations where dynamic lighting is the best choice for your levels, like those with long view distances or ones where you have a large open world. In instances like this, precomputed lighting can be inefficient or too demanding on the target system's resources. Ray Traced Distance Field Shadows, also referred to simply as Distance Field Shadows, enables you to shadow at farther distances than traditional Cascaded Shadow Maps (CSM) with a Directional Light .

In this guide, you'll learn how to enable Distance Field Shadowing for different Light Types ; Directional, Point, and Spot Lights.

Steps

This feature requires that Generate Mesh Distance Fields be enabled in your Project Settings in the Rendering section.

  1. Start by navigating to the Modes window, then in the Lights section, select and drag a Directional, Spot, or Point Light into the main viewport.

    AddLightType.png

    To enable Distance Field Shadows on any Light component, the process is the same. The additional sections of this guide will cover specific properties for these light types.

  2. With the Light selected, navigate over to its Details panel and set its Mobility to Movable or Stationary.

    TransformMobility.png

  3. In the Details panel under Distance Field Shadows, set RayTraced Distance Field Shadows to enabled.

    DirectionalLightDFSettings.png

    PointSpotLightSettingsDF.png

    Directional Light

    Spot/Point Light

    If this option is grayed out, make sure that you've first enabled the option for Generate Mesh Distance Fields in the Project Settings, and then check to make sure that the light's Mobility is set to Movable or Stationary.

  4. Distance Field Shadows will now be enabled for your lights that have this setting enabled.

    Cascaded Shadow Maps Only

    Cascaded Shadow Maps | and | Distance Field Shadows

    In this test level for Fortnite, CSM Dynamic Shadow Distance is 4500 units from the camera and when Distance Field Shadowing is enabled, they handle any shadowing beyond the CSM Shadow Distance. When using only CSM shadowing, you can see the light leaking under the columns of the Court House or at farther distances objects aren't appropriately shadowed.

    When using a Directional Light, it can be helpful to set the Dynamic Shadow Distance Moveable Light slider to 0. This will disable CSM shadows so that you will only see the Distance Field Shadow of a mesh. This is also useful for testing your scene and diagnosing any potential Distance Field issues in addition to using the visualization mode for Mesh Distance Fields that you can enable in the main viewport by going to Show > Visualize > Mesh Distance Fields.

Additional Light Settings

Use the Distance Field ReferenceNEW! to learn about settings specific to Distance Field Shadowing for Directional lights and Point/Spot Lights . These settings enable you to have artistic control over your scene, like controlling the softness of shadows, controlling farthest distance any shadow can cast, and global adjustments to remove any self-shadowing artifacts.

Tags