Skip to content

Commit 8279bf2

Browse files
Richard-HortonEvergreen
authored andcommitted
URP Docs: Restructure and Refresh Camera Section
Addresses the work and issues from [DOCG-991](https://jira.unity3d.com/browse/DOCG-991) Restructures the ToC for the Camera Docs in URP Updates pages to be closer to the standards of the Unity Style Guide Aligns the Camera Docs with the Unity Docs content model Adds additional pages to the Camera Docs section The following PR will be added to this one before merging with trunk: - #44235
1 parent 426d57f commit 8279bf2

16 files changed

+227
-136
lines changed
Loading

Packages/com.unity.render-pipelines.universal/Documentation~/TableOfContents.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,18 @@
6363
* [Reflection probes](lighting/reflection-probes.md)
6464
* [Lens Flare asset](shared/lens-flare/lens-flare-asset.md)
6565
* [Cameras](cameras.md)
66-
* [The Universal Additional Camera Data component](universal-additional-camera-data.md)
67-
* [Render Type](camera-types-and-render-type.md)
68-
* [Working with multiple cameras](cameras-multiple.md)
69-
* [Camera Stacking](camera-stacking.md)
70-
* [Rendering from multiple Cameras to the same render target](rendering-to-the-same-render-target.md)
71-
* [Rendering to a Render Texture](rendering-to-a-render-texture.md)
72-
* [Clearing, rendering order and overdraw](cameras-advanced.md)
66+
* [Cameras in URP](cameras/camera-differences-in-urp.md)
67+
* [Understand camera render order](cameras-advanced.md)
68+
* [Camera render types](camera-types-and-render-type.md)
69+
* [Anti-aliasing in URP](anti-aliasing.md)
7370
* [Motion vectors](features/motion-vectors.md)
74-
* [Anti-aliasing](anti-aliasing.md)
75-
* [Camera component reference](camera-component-reference.md)
76-
71+
* [Use multiple cameras](cameras-multiple.md)
72+
* [Set up a camera stack](camera-stacking.md)
73+
* [Set up split-screen rendering](rendering-to-the-same-render-target.md)
74+
* [Apply different post processing effects to separate cameras](cameras/apply-different-post-proc-to-cameras.md)
75+
* [Render a camera's output to a Render Texture](rendering-to-a-render-texture.md)
76+
* [Customize a camera](universal-additional-camera-data.md)
77+
* [Camera component properties](camera-component-reference.md)
7778
* [Post-processing](integration-with-post-processing.md)
7879
* [How to configure](integration-with-post-processing.md#post-proc-how-to)
7980
* [HDR Output](post-processing/hdr-output.md)

Packages/com.unity.render-pipelines.universal/Documentation~/anti-aliasing.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,5 @@ To enable MSAA:
6161

6262
For more information on the available settings, refer to the [MSAA setings in the URP Asset](universalrp-asset.md#quality).
6363

64-
> **Note**: On mobile platforms that don't support the [StoreAndResolve](https://docs.unity3d.com/ScriptReference/Rendering.RenderBufferStoreAction.StoreAndResolve.html) store action, if **Opaque Texture** is selected in the **URP Asset**, Unity ignores the **MSAA** property at runtime (as if **MSAA** is set to **Disabled**).
64+
> [!NOTE]
65+
> On mobile platforms that don't support the [StoreAndResolve](https://docs.unity3d.com/ScriptReference/Rendering.RenderBufferStoreAction.StoreAndResolve.html) store action, if **Opaque Texture** is selected in the **URP Asset**, Unity ignores the **MSAA** property at runtime (as if **MSAA** is set to **Disabled**).

Packages/com.unity.render-pipelines.universal/Documentation~/camera-component-reference.md

Lines changed: 74 additions & 58 deletions
Large diffs are not rendered by default.

Packages/com.unity.render-pipelines.universal/Documentation~/camera-stacking.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# Camera Stacking
1+
# Set up a camera stack
2+
23
In the Universal Render Pipeline (URP), you use Camera Stacking to layer the output of multiple Cameras and create a single combined output. Camera Stacking allows you to create effects such as a 3D model in a 2D UI, or the cockpit of a vehicle.
34

45
![Camera Stacking in URP](Images/camera-stacking-example.png)
@@ -10,6 +11,7 @@ A Camera Stack consists of a [Base Camera](camera-types-and-render-type.md#base-
1011
For examples of how to use Camera Stacking, refer to the [Camera Stacking samples in URP Package Samples](package-sample-urp-package-samples.md#camera-stacking).
1112

1213
<a name="adding-a-camera-to-a-camera-stack"></a>
14+
1315
## Adding a Camera to a Camera Stack
1416

1517
![Adding a Camera to a Camera Stack](Images/camera-stack-add-camera.png)
@@ -23,7 +25,7 @@ The Overlay Camera is now part of the Base Camera's Camera Stack. Unity renders
2325

2426
You can add a Camera to a Camera Stack in a script by directly manipulating the `cameraStack` property of the Base Camera's [Universal Additional Camera Data](xref:UnityEngine.Rendering.Universal.UniversalAdditionalCameraData) component, like this:
2527

26-
```
28+
```c#
2729
var cameraData = camera.GetUniversalAdditionalCameraData();
2830
cameraData.cameraStack.Add(myOverlayCamera);
2931
```
@@ -40,7 +42,7 @@ The Overlay Camera remains in the scene, but is no longer part of the Camera Sta
4042

4143
You can remove a Camera from a Camera Stack in a script by directly manipulating the `cameraStack` property of the Base Camera's [Universal Additional Camera Data](xref:UnityEngine.Rendering.Universal.UniversalAdditionalCameraData) component, like this:
4244

43-
```
45+
```c#
4446
var cameraData = camera.GetUniversalAdditionalCameraData();
4547
cameraData.cameraStack.Remove(myOverlayCamera);
4648
```
@@ -71,7 +73,7 @@ The Overlay Camera is now rendering in both Camera Stacks.
7173

7274
You can also add a Camera to a Camera Stack in a script by directly manipulating the `cameraStack` property of the Base Camera's [Universal Additional Camera Data](xref:UnityEngine.Rendering.Universal.UniversalAdditionalCameraData) component, like this:
7375

74-
```
76+
```c#
7577
var cameraData = camera.GetUniversalAdditionalCameraData();
7678
cameraData.cameraStack.Add(myOverlayCamera);
7779
```

Packages/com.unity.render-pipelines.universal/Documentation~/camera-types-and-render-type.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Render Type
1+
# Camera render types
22

33
There are two types of Camera in the Universal Render Pipeline (URP):
44

@@ -21,12 +21,14 @@ To change the type of a Camera in the Unity Editor:
2121

2222
You can change a Camera’s type in a script, by setting the `renderType` property of the Camera's [Universal Additional Camera Data](xref:UnityEngine.Rendering.Universal.UniversalAdditionalCameraData) component, like this:
2323

24-
```
24+
```c#
2525
var cameraData = camera.GetUniversalAdditionalCameraData();
2626
cameraData.renderType = CameraRenderType.Base;
2727
```
2828

29-
## <a name="base-camera"></a>Base Camera
29+
<a name="base-camera"></a>
30+
31+
## Base Camera
3032

3133
Base Camera is the default type of Camera in URP. A Base Camera is a general purpose Camera that renders to a given render target.
3234

@@ -46,7 +48,8 @@ An Overlay Camera is a Camera that renders its view on top of another Camera's o
4648

4749
You must use Overlay Cameras in conjunction with one or more Base Cameras using the [Camera Stacking](camera-stacking.md) system. You cannot use Overlay Cameras on their own. An Overlay Camera that is not part of a Camera Stack does not perform any steps of its render loop, and is known as an orphan Camera.
4850

49-
> **Note**: In this version of URP, Overlay Cameras and Camera Stacking are supported only when using the Universal Renderer.
51+
> [!NOTE]
52+
> In this version of URP, Overlay Cameras and Camera Stacking are supported only when using the Universal Renderer.
5053
5154
When you have an active Overlay Camera in your scene, this icon appears next to the Camera Gizmo in the Scene view:
5255

Packages/com.unity.render-pipelines.universal/Documentation~/cameras-advanced.md

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1-
# Clearing, rendering order and overdraw
1+
# Understand camera render order
22

3-
<a name="clearing"></a>
4-
## Clearing
3+
This page describes when a Universal Render Pipeline (URP) camera performs the following operations:
4+
5+
* [Clearing the color and depth buffers](#clearing)
6+
* [Base Camera](#base-camera)
7+
* [Overlay Camera](#overlay-camera)
8+
* [Culling and rendering](#camera-culling-and-rendering-order)
9+
* [Rendering order optimizations.](#rendering-order-optimizations)
10+
* [Render requests](#render-requests)
11+
12+
## Clearing the color and depth buffers
513

614
In the Universal Render Pipeline (URP), Camera clearing behavior depends on the Camera's [Render Type](camera-types-and-render-type.md).
715

@@ -17,7 +25,7 @@ Note that the contents of the uninitialized color buffer vary by platform. On so
1725

1826
A Base Camera always clears its depth buffer at the start of each render loop.
1927

20-
## Overlay Camera
28+
### Overlay Camera
2129

2230
#### Color buffer
2331

@@ -29,9 +37,7 @@ At the start of its render loop, an Overlay Camera receives a depth buffer conta
2937

3038
When **Clear Depth** is set to true, the Overlay Camera clears the depth buffer and draws its view to the color buffer on top of any existing color data. When **Clear Depth** is set to false, the Overlay Camera tests against the depth buffer before drawing its view to the color buffer.
3139

32-
<a name="rendering-order"></a>
33-
34-
## Camera culling and rendering order
40+
## Culling and rendering
3541

3642
If your URP scene contains multiple Cameras, Unity performs their culling and rendering operations in a predictable order.
3743

@@ -56,13 +62,22 @@ Once per frame, Unity performs the following operations:
5662

5763
Unity can render an Overlay Camera’s view multiple times during a frame - either because the Overlay Camera appears in more than one Camera Stack, or because the Overlay Camera appears in the same Camera Stack more than once. When this happens, Unity does not reuse any element of the culling or rendering operation. The operations are repeated in full, in the order detailed above.
5864

59-
> **Note**: In this version of URP, Overlay Cameras and Camera Stacking are supported only when using the Universal Renderer. Overlay Cameras will not perform any part of their rendering loop if using the 2D Renderer.
65+
> [!NOTE]
66+
> In this version of URP, Overlay Cameras and Camera Stacking are supported only when using the Universal Renderer. Overlay Cameras will not perform any part of their rendering loop if using the 2D Renderer.
6067
61-
<a name="overdraw"></a>
62-
## Overdraw
68+
## Rendering order optimizations
6369

6470
URP performs several optimizations within a Camera, including rendering order optimizations to reduce overdraw. However, when you use a Camera Stack, you effectively define the order in which those Cameras are rendered. You must therefore be careful not to order the Cameras in a way that causes excessive overdraw.
6571

6672
When multiple Cameras in a Camera Stack render to the same render target, Unity draws each pixel in the render target for each Camera in the Camera Stack. Additionally, if more than one Base Camera or Camera Stack renders to the same area of the same render target, Unity draws any pixels in the overlapping area again, as many times as required by each Base Camera or Camera Stack.
6773

6874
You can use Unity's [Frame Debugger](https://docs.unity3d.com/Manual/FrameDebugger.html), or platform-specific frame capture and debugging tools, to understand where excessive overdraw occurs in your scene. You can then optimize your Camera Stacks accordingly.
75+
76+
## Render requests
77+
78+
You can use a render request in a C# script to trigger a camera to render to a render texture, outside the URP rendering loop. You can use two types of render request in URP, which do the following:
79+
80+
* [RenderPipeline.StandardRequest](xref:Rendering.RenderPipeline.StandardRequest) renders the output of a full stack of cameras.
81+
* [UniversalRenderPipeline.SingleCameraRequest](https://docs.unity3d.com/Packages/[email protected]/api/UnityEngine.Rendering.Universal.UniversalRenderPipeline.SingleCameraRequest.html) renders the output of a single camera.
82+
83+
For more information on how to use render requests, refer to [Render Requests](https://docs.unity3d.com/Packages/[email protected]/manual/User-Render-Requests.html).
Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
# Working with multiple cameras
1+
# Use multiple cameras
22

3-
In the Universal Render Pipeline (URP), you can work with multiple Cameras to:
3+
In the Universal Render Pipeline (URP), you can use multiple cameras to work with multiple camera outputs and targets, as well as different output resolutions and post-processing effects.
44

5-
* [Stack Cameras](camera-stacking.md) to layer the outputs of multiple Cameras into a single combined output. Camera Stacking allows you to create effects such as 3D models in a 2D UI, or the cockpit of a vehicle.
6-
* [Render multiple Base Cameras or Camera Stacks to the same render target](rendering-to-the-same-render-target.md). This allows you to create effects such as split screen rendering.
7-
* [Render a Base Camera or Camera Stack to a Render Texture](rendering-to-a-render-texture.md). Rendering to a Render Texture allows you to create effects such as CCTV monitors.
5+
> [!NOTE]
6+
> If you use multiple cameras, it might make rendering slower. An active camera adds extra calls to the rendering loop even if it renders nothing.
87
9-
![Camera Stacking in URP](Images/camera-stacking-example.png)
8+
![An example of the effect camera stacking can produce in URP](Images/camera-stacking-example.png)<br/>*An example of the effect camera stacking can produce in URP.*
109

1110
You can combine these ways of working for more complex effects. For example, you can define two Camera Stacks, and then set each of those to Camera Stacks that render to a different area of the same render target.
1211

13-
For information on Camera rendering order when working with multiple Cameras, refer to [Rendering order and overdraw](cameras-advanced.md).
12+
For information on Camera rendering order when working with multiple Cameras, refer to [Understand camera render order](cameras-advanced.md).
13+
14+
| Page | Description |
15+
|-|-|
16+
| [Set up a camera stack](camera-stacking.md)| Stack cameras to layer the outputs of multiple cameras into a single combined output. Camera stacking allows you to create effects such as 3D models in a 2D UI, or the cockpit of a vehicle.|
17+
| [Set up split-screen rendering](rendering-to-the-same-render-target.md) | Render multiple camera outputs to a single render target to create effects such as split screen rendering. |
18+
| [Render a camera's output to a Render Texture](rendering-to-a-render-texture.md) | Render to a Render Texture to create effects such as in-game CCTV monitors. |

Packages/com.unity.render-pipelines.universal/Documentation~/cameras.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
A Camera in Unity works like a camera in the real world: it captures a view of objects in 3-dimensional space and flattens that view to display it on a 2-dimensional surface.
44

5-
Cameras in the Universal Render Pipeline (URP) are based on Unity's standard Camera functionality, but with some significant differences. The most notable ways in which Cameras in URP differ from standard Unity Cameras are:
6-
7-
* The [Universal Additional Camera Data](universal-additional-camera-data.md) component, which extends the Camera component's functionality and allows URP to store additional Camera-related data
8-
* The [Render Type](camera-types-and-render-type.md) setting, which defines the two types of Camera in URP: Base and Overlay
9-
* The [Camera Stacking](camera-stacking.md) system, which allows you to layer the output of multiple Cameras into a single combined output
10-
* The [Volume](Volumes.md) system, which allows you to apply [post-processing effects](integration-with-post-processing.md) to a Camera based on a given Transform's position within your scene
11-
* The [Camera component](camera-component-reference.md), which exposes URP-specific properties in the Inspector
12-
13-
For a general introduction to how Cameras work in Unity, and examples of common Camera workflows, refer to the [Unity Manual section on Cameras](https://docs.unity3d.com/Manual/CamerasOverview.html).
5+
| Page | Description |
6+
|-|-|
7+
| [Cameras in URP](/cameras/camera-differences-in-urp.md)|Understand the differences between Unity's built-in camera and the URP camera.|
8+
| [Understand camera render order](cameras-advanced.md) | Understand the order in which URP clears camera buffers and performs culling and rendering operations. |
9+
| [Camera render types](camera-types-and-render-type.md) | Understand the difference between the Base and Overlay camera types. |
10+
| [Anti-aliasing in URP](anti-aliasing.md) | Apply anti-aliasing effects to a camera. |
11+
| [Use multiple cameras](cameras-multiple.md)| Set up and use more than one camera in a scene to use in a camera stack, a split screen effect, post-processing, or output to a render texture.|
12+
| [Customize a camera](universal-additional-camera-data.md)| Use the Universal Additional Camera Data component to customise a camera's behavior.|
13+
| [Camera component properties](camera-component-reference.md)| Understand how each camera property works in URP.|

0 commit comments

Comments
 (0)