Version: 2022.3
Language : English
Configuring shadows
Shadow Cascades

Shadow Distance

Use the Shadow Distance property to determine the distance from the CameraA component which creates an image of a particular viewpoint in your scene. The output is either drawn to the screen or captured as a texture. More info
See in Glossary
up to which Unity renders real-time shadows.

Shadows from GameObjectsThe fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info
See in Glossary
become less noticeable the farther the GameObjects are from the Camera. This is both because the shadows appear smaller on the screen, and because distant GameObjects are usually not the focus of attention. You can take advantage of this effect by disabling real-time shadow rendering for distant GameObjects. This saves on wasted rendering operations, and can improve runtime performance. Additionally, the SceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary
often looks better without distant shadows.

If the current Camera Far Plane is closer than the Shadow Distance, Unity uses the Camera Far Plane instead of the Shadow Distance.

To disguise missing shadows beyond the Shadow Distance, you can use visual effects such as fog.

Setting the Shadow Distance

In the Built-in Render PipelineA series of operations that take the contents of a Scene, and displays them on a screen. Unity lets you choose from pre-built render pipelines, or write your own. More info
See in Glossary
, set the Shadow Distance property in your Project’s Quality Settings.

In the Universal Render Pipeline (URP), set the Shadow Distance property in the Universal Render Pipeline Asset.

In the High Definition Render Pipeline (HDRP), set the Shadow Distance property for each Volume.

Reduce flickering shadows

Shadows might flicker if they’re far away from the camera. Refer to Understanding the View Frustum for more information.

If shadows are closer to the camera than the world space origin, enable camera-relative culling. Unity uses the camera as the relative position for shadow calculations instead of the world space origin, which reduces flickering.

To enable camera-relative culling, follow these steps:

  1. Go to Project Settings > Graphics > Culling Settings > Camera-Relative Culling.
  2. Enable Shadows.

Shadow Distance and Shadowmask Lighting Mode

If your Scene uses the Shadowmask Lighting Mode, Unity renders shadows from Mixed LightsLight components whose Mode property is set to Mixed. Some calculations for Mixed Lights are performed in advance, and some calculations for Mixed Lights are performed at runtime. The behavior of all Mixed Lights in a Scene is determined by the Scene’s Lighting Mode. More info
See in Glossary
beyond the Shadow Distance, using either Light ProbesLight probes store information about how light passes through space in your scene. A collection of light probes arranged within a given space can improve lighting on moving objects and static LOD scenery within that space. More info
See in Glossary
or a shadow mask Texture. You can configure how Unity renders shadows beyond the Shadow Distance.

Configuring shadows
Shadow Cascades
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961