Skip to content

Commit 4386ae7

Browse files
markg-unityEvergreen
authored andcommitted
DOCG-7425 Add HDRP render graph docs
1 parent 64faf1f commit 4386ae7

11 files changed

+266
-8
lines changed
75 KB
Loading
1.45 KB
Loading
1.41 KB
Loading
1.68 KB
Loading

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,11 @@
244244
* [Use the Rendering Debugger](use-the-rendering-debugger.md)
245245
* [Add controls to the Rendering Debugger](add-controls-to-the-rendering-debugger.md)
246246
* [Rendering and post-processing](rendering-and-post-processing.md)
247-
* [Execution order reference](rendering-execution-order.md)
247+
* [Render passes](render-passes-landing.md)
248+
* [Render graph system](render-graph-introduction.md)
249+
* [Analyze the render graph](render-graph-view.md)
250+
* [Render Graph Viewer reference](render-graph-viewer-reference.md)
251+
* [Execution order reference](rendering-execution-order.md)
248252
* [Understand post-processing](Post-Processing-Main.md)
249253
* [Anti-aliasing](Anti-Aliasing.md)
250254
* [Dynamic resolution](Dynamic-Resolution.md)
@@ -310,7 +314,6 @@
310314
* [Understand custom pass variables](AOVs.md)
311315
* [Manage a custom pass without a GameObject](Global-Custom-Pass-API.md)
312316
* [Injection points](Custom-Pass-Injection-Points.md)
313-
* [Customize the High Definition Render Pipeline (HDRP)](render-graph.md)
314317
* [Test and debug rendering and post-processing](rendering-troubleshoot.md)
315318
* [Troubleshoot a custom pass](Custom-Pass-Troubleshooting.md)
316319
* [Troubleshoot a custom post-processing effect](rendering-troubleshoot-custom-post-processes.md)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Render graph system in HDRP
2+
3+
The render graph system is a set of APIs from the [Core Scriptable Render Pipeline (SRP) package](https://docs.unity3d.com/Packages/com.unity.render-pipelines.core@latest). The High Definition Render Pipeline (HDRP) uses these APIs to create the render passes in the render pipeline.
4+
5+
The render graph system automatically optimizes the graph to minimize the number of render passes, and the memory and bandwidth the render passes use.
6+
7+
**Note:** Unlike in the Universal Render Pipeline (URP), you can't use the render graph system to write custom render passes in HDRP. Use [Custom Passes](Custom-Pass.md) instead.
8+
9+
## How the render graph system optimizes rendering
10+
11+
The render graph system does the following to optimize rendering:
12+
13+
- Avoids allocating resources the frame doesn’t use.
14+
- Removes render passes if the final frame doesn’t use their output.
15+
- Optimizes GPU memory, for example by reusing allocated memory if a texture has the same properties as an earlier texture.
16+
- Automatically synchronizes the compute and graphics GPU command queues, if compute shaders are used.
17+
18+
On mobile platforms that use tile-based deferred rendering (TBDR), the render graph system can also merge multiple render passes into a single native render pass. A native render pass keeps textures in tile memory, rather than copying textures from the GPU to the CPU. As a result, HDRP uses less memory bandwidth and rendering time.
19+
20+
To check how the render graph system optimizes rendering, refer to [Analyze the render graph](render-graph-view.md)
21+
22+
## Additional resources
23+
24+
- [Optimizing draw calls](reduce-draw-calls-landing-hdrp.md)
25+
- [Reduce rendering work on the CPU](reduce-rendering-work-on-cpu.md)
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
uid: hdrp-render-graph-view
3+
---
4+
# Analyze the render graph in HDRP
5+
6+
To analyze the render graph in HDRP, use the **Render Graph Viewer** window.
7+
8+
The render graph is the optimized sequence of render passes the High Definition Render Pipeline (HDRP) steps through each frame. The Render Graph Viewer displays both built-in render passes and any [custom passes](Custom-Pass.md) you create.
9+
10+
For more information about the **Render Graph Viewer** window, refer to [Render Graph Viewer window reference](render-graph-viewer-reference.md).
11+
12+
## Open the Render Graph Viewer window
13+
14+
Go to **Window** > **Analysis** > **Render Graph Viewer**.
15+
16+
The **Render Graph Viewer** window displays the render graph for the active camera by default. To select another camera, use the dropdown in the toolbar.
17+
18+
<a name="built-project"></a>
19+
## View the render graph for a build
20+
21+
To connect the Render Graph Viewer window to a build, enable **Development Build** in the **Build Profiles** window when you build the project. If you build for WebGL or Universal Windows Platform (UWP), enable both **Development Build** and **Autoconnect Profiler**.
22+
23+
After you build your project, follow these steps:
24+
25+
1. Run your built project.
26+
2. In the **Render Graph Viewer** window, select the **Target Selection** dropdown. The dropdown is set to **Editor** by default.
27+
3. In the **Local** section, select your build.
28+
29+
Your build appears in the **Local** section only if the build is running.
30+
31+
## Example: Check how HDRP uses a resource
32+
33+
You can use the resource access blocks next to a resource name to check how the render passes use the resource.
34+
35+
![Render Graph Viewer example](Images/render-graph-viewer-hdrp.png)
36+
37+
In this example, the **Ambient Occlusion** texture goes through the following stages:
38+
39+
1. During the first 19 render passes between **Set Global Sky Texture** and **Temporal Denoise GTAO**, the texture doesn't exist. The resource assess blocks are dotted lines.
40+
41+
2. The **Upsample GTAO** render pass creates the texture, and has write-only access to it. The resource access block is red.
42+
43+
3. The next four render passes don't have access to the texture. The resource access blocks are gray.
44+
45+
4. The **Deferred Lighting** render pass has read-only access to the texture. The resource access block is green.
46+
47+
6. The **Forward (+ Emissive) Opaque** render pass has read-only access to the texture. The resource access block is green.
48+
49+
7. Unity destroys the texture, because it's no longer needed. The resource access blocks are blank.
50+
51+
## Check how HDRP optimized a render pass
52+
53+
To check the details of a render pass, for example to find out why it's not a native render pass or a merged pass, do either of the following:
54+
55+
- Select the render pass name to display the details in the Pass List.
56+
- Below the render pass name, hover your cursor over the gray, blue, or flashing blue resource access overview block.
57+
58+
For more information about displaying details of a render pass, refer to [Render Graph Viewer window reference](render-graph-viewer-reference.md).
59+
60+
## Additional resources
61+
62+
- [Optimizing draw calls](reduce-draw-calls-landing-hdrp.md)
63+
- [Reduce rendering work on the CPU](reduce-rendering-work-on-cpu.md)
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
---
2+
uid: hdrp-render-graph-viewer-reference
3+
---
4+
5+
# Render Graph Viewer window reference for HDRP
6+
7+
The **Render Graph Viewer** window displays the [render graph](render-graph-introduction.md) for the current scene in the High Definition Render Pipeline (HDRP).
8+
9+
For more information about the **Render Graph Viewer** window, refer to [Analyze a render graph](render-graph-view.md).
10+
11+
## Toolbar
12+
13+
|**Control**|**Description**|
14+
|-|-|
15+
|**Refresh**|Selects whether to update the window automatically. The options are: <ul><li>**Auto Update**: Updates the window automatically.</li><li>**Pause**: Doesn't update the window automatically.</li></ul>|
16+
|**Target Selection**|Selects which project the window connects to. For more information, refer to [View the render graph for a built project](render-graph-view.md#built-project). The options are:<ul><li>**Editor**: Connects to the project in the Unity Editor.</li><li>**Local**: Connects to a built project on the same device. </li><li>**Remote**: Connects to a built project on a different device.<li></li>**Direct Connection**: Connects to an application through an IP address.</li></ul>|
17+
|**Camera**|Selects the camera to display the rendering loop for.|
18+
|**Pass Filter**|Selects which render passes to display. For more information, refer to [Pass Filter dropdown](#pass-filter-property).|
19+
|**Resource Filter**|Selects which resources to display. For more information, refer to [Resource Filter dropdown](#resource-filter-property).|
20+
|**View Options**|Selects whether to display how the render pass stores and loads the resource in the main window.|
21+
22+
<a name="pass-filter-property"></a>
23+
### Pass Filter dropdown
24+
25+
|**Control**|**Description**|
26+
|-|-|
27+
|**Culled Passes**|Displays render passes that HDRP hasn't included in the render graph because they have no effect on the final image.|
28+
|**Raster Passes**|Displays only raster render passes created using `renderGraph.AddRasterRenderPass`.|
29+
|**Unsafe Passes**|Displays only render passes that use the `AddUnsafePass` API to use `CommandBuffer` interface APIs such as `SetRenderTarget`.|
30+
|**Compute Passes**|Displays only compute render passes created using `renderGraph.AddComputePass`.|
31+
32+
<a name="resource-filter-property"></a>
33+
### Resource Filter dropdown
34+
35+
|**Control**|**Description**|
36+
|-|-|
37+
|**Imported Resources**|Displays only resources imported into the render graph using `ImportTexure`.|
38+
|**Textures**|Displays only textures.|
39+
|**Buffers**|Displays only buffers.|
40+
|**Acceleration Structures**|Displays only acceleration structures used in compute render passes.|
41+
42+
## Main window
43+
44+
The main window is a timeline graph that displays the render passes in the render graph. It displays the following:
45+
46+
- On the left, the list of resources the render passes use, in the order HDRP creates them.
47+
- At the top, the list of render passes, in the order HDRP executes them.
48+
49+
At the point where a render pass and a texture meet on the graph, a resource access block displays how the render pass uses the resource. The access block uses the following icons and colors:
50+
51+
|**Access block icon or color**|**Description**|
52+
|-|-|
53+
|Dotted lines|The resource hasn't been created yet.|
54+
|Green|The render pass has read-only access to the resource. The render pass can read the resource.|
55+
|Red|The render pass has write-only access to the resource. The render pass can write to the resource.|
56+
|Green and red|The render pass has read-write access to the resource. The render pass can read from or write to the resource.|
57+
|Gray|The render pass can't access the resource.|
58+
|Globe icon|The render pass sets the texture as a global resource. If the globe icon has a gray background, the resource was imported into the render graph as a `TextureHandle` object, and the pass uses the `SetGlobalTextureAfterPass` API.|
59+
|**F**|The render pass can read the resource from on-chip GPU memory.|
60+
|Blank|The resource has been deallocated in memory, so it no longer exists.|
61+
62+
If you enable **View Options** > **Load Store Actions**, the access block displays triangles that represent how the render pass loads the resource (top-left) and stores the resource (bottom-right). The triangles use the following colors:
63+
64+
|**Triangle color**|**Load or store action**|
65+
|-|-|
66+
|Blue|Clear|
67+
|Green|Load|
68+
|Red|Store|
69+
|Gray|Don't Care|
70+
71+
Select an access block to display the resource in the Resource List and the render pass in the Pass Inspector List.
72+
73+
### Render passes
74+
75+
|**Control**|**Description**|
76+
|-|-|
77+
|Render pass name|The name of the render pass. This name is set in the `AddRasterRenderPass` or `AddComputePass` method.|
78+
|Merge bar|If HDRP merged this pass with other passes, the Render Graph Viewer displays a blue bar below the merged passes.|
79+
|Resource access overview bar|When you select a render pass name, the resource access overview bar displays information about the pass you selected and related passes. Hover your cursor over an overview block for more information. Select an overview block to open the C# file for the render pass.<br/><br/>Overview blocks use the following colors:<ul><li>White: The selected pass.</li><li>Gray: The pass isn't related to the selected pass.</li><li>Blue: The pass reads from or writes to a resource the selected pass uses.</li><li>Flashing blue: The pass reads from or writes to a resource the selected pass uses, and can be merged with the current pass.</li></ul>|
80+
81+
### Resources
82+
83+
|**Property**|**Description**|
84+
|-|-|
85+
|Resource type|The type of the resource. Refer to the following screenshot.|
86+
|Resource name|The resource name.|
87+
|Imported resource|Displays a left-facing arrow if the resource is imported.|
88+
89+
### Render graph viewer icons
90+
91+
|**Icon**|**Description**|
92+
|-|-|
93+
|![Texture icon](Images/render-graph-viewer-icon-texture.png)|A texture.|
94+
|![Acceleration structure icon](Images/render-graph-viewer-icon-acceleration-structure.png)|An acceleration structure.|
95+
|![Buffer icon](Images/render-graph-viewer-icon-buffer.png)|A buffer.|
96+
97+
## Resource List
98+
99+
Select a resource in the Resource List to expand or collapse information about the resource.
100+
101+
You can also use the Search bar to find a resource by name.
102+
103+
|**Property**|**Description**|
104+
|-|-|
105+
|Resource name|The resource name.|
106+
|Imported resource|Displays a left-facing arrow if the resource is imported.|
107+
|**Size**|The resource size in pixels.|
108+
|**Format**|The texture format. For more information about texture formats, refer to [GraphicsFormat](https://docs.unity3d.com/Documentation/ScriptReference/Experimental.Rendering.GraphicsFormat.html).|
109+
|**Clear**|Displays **True** if HDRP clears the texture.|
110+
|**BindMS**|Whether the texture is bound as a multisampled texture. For more information about multisampled textures, refer to [RenderTextureDescriptor.BindMS](https://docs.unity3d.com/ScriptReference/RenderTextureDescriptor-bindMS.html).|
111+
|**Samples**|How many times Multisample Anti-aliasing (MSAA) samples the texture. Refer to [Anti-aliasing](anti-aliasing.md).|
112+
|**Memoryless**|Displays **True** if the resource is stored in tile memory on mobile platforms that use tile-based deferred rendering (TBDR). For more information about TBDR, refer to [Render graph system introduction](render-graph-introduction.md).|
113+
114+
## Pass List
115+
116+
Select a render pass in the main window to display information about the render pass in the Pass List.
117+
118+
You can also use the Search bar to find a render pass by name.
119+
120+
|**Property**|**Description**|
121+
|-|-|
122+
|Pass name|The render pass name. If HDRP merged multiple passes, this property displays the names of all the merged passes.|
123+
|**Native Render Pass Info**|Displays information about whether HDRP created a native render pass for this render pass by merging multiple render passes. For more information about native render passes, refer to [Introduction to the render graph system](render-graph-introduction.md).|
124+
|**Pass break reasoning**|Displays the reasons why HDRP could not merge this render pass with the next render pass. |
125+
126+
### Render Graph Pass Info
127+
128+
The **Render Graph Pass Info** section displays information about the render pass, and each of the resources it uses.
129+
130+
If HDRP merged multiple passes into this pass, the section displays information for each merged pass.
131+
132+
|**Property**|**Description**|
133+
|-|-|
134+
|**Name**|The render pass name.|
135+
|**Attachment dimensions**|The size of a resource the render pass uses, in pixels. Displays **0x0x0** if the render pass doesn't use a resource.|
136+
|**Has depth attachment**|Whether the resource has a depth texture.|
137+
|**MSAA samples**|How many times Multisample Anti-aliasing (MSAA) samples the texture. Refer to [Anti-aliasing](anti-aliasing.md). |
138+
|**Async compute**|Whether the render pass accesses the resource using a compute shader.|
139+
140+
### Attachments Load/Store Actions
141+
142+
The **Attachments Load/Store Actions** section displays the resources the render pass uses. The section displays **No attachments** if the render pass doesn't use any resources.
143+
144+
|**Property**|**Description**|
145+
|-|-|
146+
|**Name**|The resource name.|
147+
|**Load Action**|The load action for the resource. Refer to [`RenderBufferLoadAction`](https://docs.unity3d.com/ScriptReference/Rendering.RenderBufferLoadAction.html).|
148+
|**Store Action**|The store action for the resource, and how HDRP uses the resource later in another render pass or outside the graph. Refer to [`RenderBufferStoreAction`](https://docs.unity3d.com/ScriptReference/Rendering.RenderBufferStoreAction.html).|
149+
150+
## Additional resources
151+
152+
- [Frame Debugger](https://docs.unity3d.com/Manual/frame-debugger-window.html)
153+
- [Optimization](Optimization.md)

Packages/com.unity.render-pipelines.high-definition/Documentation~/render-graph.md

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
uid: hdrp-render-passes
3+
---
4+
# Render passes in HDRP
5+
6+
Explore the sequence of render passes in the High Definition Render Pipeline (HDRP) and how to analyze them.
7+
8+
|**Topic**|**Description**|
9+
|-|-|
10+
|[Render graph system in HDRP](render-graph-introduction.md)|What the render graph system is, and how it optimizes rendering.|
11+
|[Analyze the render graph](render-graph-view.md)|Analyze the sequence of render passes in HDRP using the Render Graph Viewer.|
12+
|[Render Graph Viewer window reference](render-graph-viewer-reference.md)|Reference for the **Render Graph Viewer** window.|
13+
|[Execution order reference](rendering-execution-order.md)|Learn the order in which HDRP executes render passes.|
14+
15+
## Additional resources
16+
17+
- [Frame Debugger](https://docs.unity3d.com/Manual/frame-debugger-window.html)
18+
- [Use the Rendering Debugger](use-the-rendering-debugger.md)
19+

0 commit comments

Comments
 (0)