Version: Unity 6 (6000.0)
Language : English
Render graph system in URP
Write a render pass using the render graph system in URP

Introduction to the render graph system in URP

The render graph system is a set of APIs you use to write a Scriptable Render Pass in the Universal 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
(URP).

When you use the render graph API to create a Scriptable Render Pass, you tell URP the following:

  1. The textures or render texturesA special type of Texture that is created and updated at runtime. To use them, first create a new Render Texture and designate one of your Cameras to render into it. Then you can use the Render Texture in a Material just like a regular Texture. More info
    See in Glossary
    to use. This stage is the recording stage.
  2. The graphics commands to execute, using the textures or render textures from the recording stage. This stage is the execution stage.

You can then add your Scriptable Render Pass to the URP renderer. Your Scriptable Render Pass becomes part of URP’s internal render graph, which is the sequence of render passes URP steps through each frame. URP automatically optimizes your render pass and the render graph to minimize the number of render passes, and the memory and bandwidth the render passes use.

How URP optimizes rendering

URP does the following to optimize rendering in the render graph:

  • Merges multiple render passes into a single render pass.
  • Avoids allocating resources the frame doesn’t use.
  • Avoids executing render passes if the final frame doesn’t use their output.
  • Avoids duplicating resources, for example by replacing two texture that have the same properties with a single texture.
  • Automatically synchronizes the compute and graphics GPU command queues.

On mobile platforms that use tile-based deferred rendering (TBDR), URP 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, URP uses less memory bandwidth and rendering time.

To check how URP optimizes rendering in your custom render passes, refer to Analyze a render graph.

Additional resources

Render graph system in URP
Write a render pass using the render graph system in URP
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961