|
1 | 1 | # Screen Space Shadows Renderer Feature
|
2 | 2 |
|
3 |
| -The Screen Space Shadows [Renderer Feature](urp-renderer-feature.md) calculates screen-space shadows for opaque objects affected by the main directional light and draws them in the scene. To render screen-space shadows, URP requires an additional render target. This increases the amount of memory your application requires, but if your project uses forward rendering, screen-space shadows can benefit the runtime resource intensity. This is because if you use screen-space shadows, URP doesn't need to access the cascade shadow maps multiple times. |
4 |
| -<br/>*Screen-space shadows in a sample scene.* |
| 3 | +<br/>*Screen-space shadows in a sample scene.* |
5 | 4 |
|
6 |
| -<br/>*The screen-space shadows texture for the above image.* |
| 5 | +You can add a [Screen Space Shadows Renderer Feature](renderer-feature-screen-space-shadows.md) to a Universal Render Pipeline (URP) renderer. This makes URP use a single render texture to calculate and draw shadows from the main Directional Light, instead of multiple [shadow cascade](https://docs.unity3d.com/Manual/shadow-cascades.html) textures. |
7 | 6 |
|
8 |
| -## Enabling screen-space shadows |
| 7 | +The Screen Space Shadows Renderer Feature doesn't affect how shadows look. |
9 | 8 |
|
10 |
| -To add screen space shadows to your project, [add the Screen Space Shadows Renderer Feature ](urp-renderer-feature-how-to-add.md) to the URP Renderer. |
| 9 | +If your project uses the [Forward Renderer](urp-universal-renderer.md), screen-space shadows might make rendering faster, because the Universal Render Pipeline (URP) doesn't need to access multiple shadow cascade textures. |
11 | 10 |
|
12 |
| -## Viewing screen-space shadows in the Frame Debugger |
| 11 | +Screen-space shadows have the following limitations: |
13 | 12 |
|
14 |
| -After you enable this Renderer Feature, URP renders screen-space shadows in your scene. To distinguish between shadow map shadows and screen-space shadows, you can view the render passes that draws the shadows in the [Frame Debugger](https://docs.unity3d.com/Manual/FrameDebugger.html). |
15 |
| -<br/>*Screen Space Shadows pass in frame debugger.* |
| 13 | +- URP adds a depth prepass so it can sample the depth texture. This might reduce performance on mobile platforms that use tile-based rendering. Refer to [Depth Priming Mode](urp-universal-renderer.md#rendering) for more information about the depth prepass. |
| 14 | +- URP creates a screen-space shadows texture, which uses more memory. |
16 | 15 |
|
17 |
| -You can compare shadows cast on opaque objects from the screen-space shadow texture or the cascade shadow maps. |
18 |
| -<br/>*The Frame Debugger shows the screen-space shadows texture.* |
| 16 | +<br/>*The screen-space shadows texture for the previous image.* |
19 | 17 |
|
20 |
| -<br/>*The Frame Debugger shows shadows from a shadow map.* |
| 18 | +## Enable screen-space shadows |
21 | 19 |
|
22 |
| -## **Requirements and compatibility** |
| 20 | +To add screen-space shadows to your project, add the Screen Space Shadows Renderer Feature. Refer to [Add a renderer feature](urp-renderer-feature-how-to-add.md). |
23 | 21 |
|
24 |
| -This Renderer Feature uses a depth texture and invokes a depth prepass before it draws opaque objects. It calculates the shadows in screen space before the `DrawOpaqueObjects` render pass. URP doesn't calculate or apply screen-space shadows for transparent objects; it uses [shadow maps](Shadows-in-URP.md) for transparent objects instead. *<br/>The Frame Debugger showing that Unity uses shadow maps for transparent objects and screen-space shadows for opaque objects.* |
| 22 | +URP doesn't calculate or draw screen-space shadows for transparent objects. URP uses shadow maps for transparent objects instead. |
| 23 | + |
| 24 | +## View screen-space shadows |
| 25 | + |
| 26 | +Use the [Frame Debugger](https://docs.unity3d.com/Manual/FrameDebugger.html) to view the render passes that draw shadows. Check the following render passes: |
| 27 | + |
| 28 | +- **ScreenSpaceShadows**, which creates the screen-space shadows texture. |
| 29 | +- **MainLightShadow**, which creates shadow map textures. |
| 30 | + |
| 31 | +Check the **DrawOpaqueObjects** render pass to check which shadow texture URP uses to draw shadows on each object. |
| 32 | + |
| 33 | +<br/>*The Frame Debugger with screen-space shadows enabled. The objects in the **DrawOpaqueObjects** render pass use **_ScreenSpaceShadowmapTexture**.* |
| 34 | + |
| 35 | +<br/>*The Frame Debugger with screen-space shadows disabled. The objects in the **DrawOpaqueObjects** render pass use **TempBuffer 398 2048x1024** and **TempBuffer 399 2048x2048**, which are shadow map textures from the **MainLightShadow** render pass.* |
0 commit comments