Skip to content

Commit c693b76

Browse files
markg-unityEvergreen
authored andcommitted
DOCG-1025 Improvements to screen space shadows page, and add link from shadows page
Improvements to screen space shadows page, and add link from shadows page We have another ticket to improve shadow pages and structure (https://jira.unity3d.com/browse/DOCG-1026), so this is just a small ticket to tidy up the page, make mobile performance clearer, and link from the main shadows page. Jira ticket: https://jira.unity3d.com/browse/DOCG-1025
1 parent c397b69 commit c693b76

File tree

2 files changed

+28
-13
lines changed

2 files changed

+28
-13
lines changed

Packages/com.unity.render-pipelines.universal/Documentation~/Shadows-in-URP.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
The Universal Render Pipeline’s [Lights](light-component.md) can cast shadows from one GameObject onto another. They emphasize the position and scale of GameObjects, which adds a degree of depth and realism to a scene that could otherwise look flat.
44

5+
URP uses [shadow maps](https://docs.unity3d.com/Manual/shadow-mapping.html) and [shadow cascades](https://docs.unity3d.com/Manual/shadow-cascades.html).
6+
7+
You can add a [Screen Space Shadows Renderer Feature](renderer-feature-screen-space-shadows.md) so the Universal Render Pipeline (URP) uses a single render texture to calculate and draw shadows from the main Directional Light, instead of multiple shadow cascade textures.
8+
59
## Shadow map resolution
610

711
The resolution of a Light’s shadow map determines the size of its shadow maps. The larger the shadow map, the more precise the shadows can be, and the better the Universal Render Pipeline can capture small details in the shadow casting geometry. Rendering shadow maps at higher resolutions make them look sharper.
Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,35 @@
11
# Screen Space Shadows Renderer Feature
22

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-
![Show screen space shadows](Images/ssshadows/ssshadows-result.png)<br/>*Screen-space shadows in a sample scene.*
3+
![Screen-space shadows](Images/ssshadows/ssshadows-result.png)<br/>*Screen-space shadows in a sample scene.*
54

6-
![Show screen space shadows texture](Images/ssshadows/ssshadows-shadow-texture.png)<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.
76

8-
## Enabling screen-space shadows
7+
The Screen Space Shadows Renderer Feature doesn't affect how shadows look.
98

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.
1110

12-
## Viewing screen-space shadows in the Frame Debugger
11+
Screen-space shadows have the following limitations:
1312

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-
![Show main light shadows in frame debugger](Images/ssshadows/ssshadows-framedebugger.png)<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.
1615

17-
You can compare shadows cast on opaque objects from the screen-space shadow texture or the cascade shadow maps.
18-
![Cast Shadows using screen space shadow stexture](Images/ssshadows/ssshadows-cast-shadow-using-screenspace.png)<br/>*The Frame Debugger shows the screen-space shadows texture.*
16+
![Screen-space shadows texture](Images/ssshadows/ssshadows-shadow-texture.png)<br/>*The screen-space shadows texture for the previous image.*
1917

20-
![Cast shadows using cascade shadowmaps](Images/ssshadows/ssshadows-cast-shadow-using-cascades.png)<br/>*The Frame Debugger shows shadows from a shadow map.*
18+
## Enable screen-space shadows
2119

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).
2321

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. ![Won't cast shadows on transparent from screen space shadow texture](Images/ssshadows/ssshadows-cast-shadow-totransparent.png)*<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+
![Shadows using the screen-space shadows texture](Images/ssshadows/ssshadows-cast-shadow-using-screenspace.png)<br/>*The Frame Debugger with screen-space shadows enabled. The objects in the **DrawOpaqueObjects** render pass use **_ScreenSpaceShadowmapTexture**.*
34+
35+
![Shadows using shadow maps](Images/ssshadows/ssshadows-cast-shadow-using-cascades.png)<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

Comments
 (0)