Version: 2019.2
Shaders: vertex and fragment programs
Scriptable Render Pipeline (SRP) Batcher

Scriptable Render Pipeline

A Scriptable Render Pipeline (SRP) is an alternative to the Unity built-in render pipeline. With an SRP, you can control and tailor renderingThe process of drawing graphics to the screen (or to a render texture). By default, the main camera in Unity renders its view to the screen. More info
See in Glossary
via C# scriptsA piece of code that allows you to create your own Components, trigger game events, modify Component properties over time and respond to user input in any way you like. More info
See in Glossary
. This way, you can either slightly modify or completely build and customize the render pipeline to your needs.

An SRP gives you more granularity and customization options than the built-in Unity render pipeline. And you can use one of the pre-built SRPs to target your specific needs.

Using an SRP is different from using the built-in Unity render pipeline. For example, the pre-built SRPs use their own ShaderA small script that contains the mathematical calculations and algorithms for calculating the Color of each pixel rendered, based on the lighting input and the Material configuration. More info
See in Glossary
library. This is because the Lit shaders from the built-in render pipeline, and custom Lit shaders, do not work with SRPs. You can upgrade the built-in Lit shaders to both LWRP and HDRP.

Unity has built two Scriptable Render Pipelines: the High Definition Render Pipeline (HDRP) and the Lightweight Render Pipeline (LWRP). Each render pipeline targets a specific set of use-case scenarios and hardware needs. The pre-built render pipelines are available as Project Templates.

Both of these render pipelines are delivered as packages via the Package Manager window in Unity. They both include the Shader Graph and Post-processingA process that improves product visuals by applying filters and effects before the image appears on screen. You can use post-processing effects to simulate physical camera and film properties, for example Bloom and Depth of Field. More info post processing, postprocessing, postprocess
See in Glossary
packages.

Note: HDRP and LWRP are not compatible with each other because they use different lighting models. Your Project must use one or the other. You can, however, use different Assets with the same render pipeline. This means that you can test different settings using different Assets by swapping between them, instead of changing individual settings.

If you are an advanced user, and you want to modify the SRP scripts to directly, see Creating a custom SRP.

Lightweight Render Pipeline (LWRP)

You can use LWRP across a wide range of hardware, from mobile platforms to higher-end consoles and PCs. LWRP uses simplified, physically-based Lighting and Materials to achieve quick rendering at a high quality. LWRP uses single-pass forward renderingA rendering path that renders each object in one or more passes, depending on lights that affect the object. Lights themselves are also treated differently by Forward Rendering, depending on their settings and intensity. More info
See in Glossary
, for optimized real-time performance on several platforms.

LWRP is available via two templates: LWRP and LWRP-VR. The LWRP-VR comes with pre-enabled VR settings.

Note: Built-in and custom Lit Shaders do not work with the Lightweight Render Pipeline. Instead, LWRP has a new set of standard ShadersA built-in shader for rendering real-world objects such as stone, wood, glass, plastic and metal. Supports a wide range of shader types and combinations. More info
See in Glossary
. If you upgrade a current Project to LWRP, you can upgrade built-in Shaders to the new ones.

For more information, see the LWRP documentation. Tip: You can also access the documentation via the Package Manager in Unity ( the Lightweight Render Pipeline package, and click View Documentation).

High Definition Render Pipeline (HDRP)

HDRP targets high-end hardware like consoles and PCs. With HDRP, you’re able to achieve realistic graphics in demanding scenarios. HDRP uses Compute Shader technology and therefore requires compatible GPU hardware.

Use HDRP for AAA quality games, automotive demos, architectural applications and anything that requires high-fidelity graphics over performance. HDRP uses physically-based Lighting and Materials, and supports both Forward and Deferred rendering.

To start using HDRP, create a Project using the HDRP Template.

For more information, see the HDRP documentation. Tip: You can also access the documentation via the Package Manager in Unity, find the High Definition Render Pipeline package, and click View Documentation.

Setting up LWRP or HDRP

To use LWRP or HDRP, you can either:

Creating a new Project with LWRP or HDRP

If you want to use HDRP or LWRP in a new Project, and you don’t need to customise the render pipeline, you can create a new Project using a Template.

To create a Project using a Template:

  1. Open Unity. On the Home page, click New to start a new Project.
  2. Under Template, select one of the render pipeline templates.
  3. Click Create Project. Unity automatically creates a new Project for you, complete with all the functionalities of the included built-in pipeline.

For more information on using Templates, see Project Templates.

Converting an existing Project to LWRP or HDRP

You can download and install the latest version of LWRP or HDRP to your existing Project via the Package Manager system.

Switching to LWRP or HDRP from an existing Project consumes a lot of time and resources. LWRP and HDRP use custom shaders. They are not compatible with the built-in Unity shaders. You have to manually change or convert many elements. Instead, consider starting a new Project and using your render pipeline of choice.

To install LWRP or HDRP into an existing Project:

  1. In Unity, open your Project.
  2. In the Unity menu bar, go to Window > Package Manager to open the Package Manager window.
  3. Select the All tab. This tab displays the list of available packages for the version of Unity that you are currently running.
  4. Select the render pipeline that you want to use from the list of packages. In the top right corner of the window, click Install. This installs the render pipeline directly in to your Project.

Preparing to use LWRP or HDRP

Before you can use LWRP or HDRP, you must create a Render Pipeline Asset and add it to your Project settingsA broad collection of settings which allow you to configure how Physics, Audio, Networking, Graphics, Input and many other areas of your Project behave. More info
See in Glossary
.

To create a Render Pipeline Asset for your render pipeline, see either the:

To assign the Render Pipeline Asset to your Project:

  1. Select Edit > Project Settings > Graphics, and locate the Scriptable Render Pipeline Settings property at the top.
  2. Either drag and drop the Render Pipeline Asset into the property field, or use the object picker (located on the right of the field) to select it from a list of all Assets in your Project.

Creating a custom SRP

The Scriptable Render Pipelines are available in an open Project on GitHub. You can clone an SRP and make modifications in your local version.

To configure local script files for a new or existing Unity Project:

  1. Create a clone of the SRP repository. Place the clone in the root of the Project directory, next to the Assets folder. For information on cloning repositories, see the GitHub help on Cloning a repository.

  2. Checkout a branch that is compatible with your version of Unity. Use the command git checkout, and type the branch name.

  3. Use the git submodule update --init command to find and initialize all submodules related to the SRP.

  4. In your Project manifestEach Unity Project has a Project manifest, which acts as an entry point for the Package Manager. This file must be available in the <project>/Packages directory. The Package Manager uses it to configure many things, including a list of dependencies for that Project, as well as any package repository to query for packages. More info
    See in Glossary
    , update dependencies to so that they point to the SRP packages. To read more about Project manifests, see the Package Manager documentation. Here is an example of what your script should look like:

        
    {
        
       "dependencies": {
           "com.unity.postprocessing": "file:../ScriptableRenderPipeline/com.unity.postprocessing",
        
           "com.unity.render-pipelines.core": "file:../ScriptableRenderPipeline/com.unity.render-pipelines.core",
        
           "com.unity.shadergraph": "file:../ScriptableRenderPipeline/com.unity.shadergraph",
        
           "com.unity.render-pipelines.lightweight": "file:../ScriptableRenderPipeline/com.unity.render-pipelines.lightweight"
        
       }
    }
    
  5. Open your Project in Unity. Your packages are now installed locally. When you open the Project solution in an integrated development environment, you can debug and modify the script directly.


  • 2019–05–06 Page amended

  • Preview of Scriptable Render Pipeline added in 2018.1 NewIn20181

  • Scriptable Render Pipeline added in 2019.1 NewIn20191

Shaders: vertex and fragment programs
Scriptable Render Pipeline (SRP) Batcher