A Scriptable Render Pipeline (SRP) is an alternative to the Unity built-in render pipeline. With an SRP, you can control and tailor rendering via C# scripts. 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 Shader 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-processing 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.
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 rendering, 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.
ノート ビルトインとカスタム製の Lit シェーダーは、LWRP では機能しません。代わりに、LWRP には新しいスタンダードシェーダーが備わっています。 現在のプロジェクトを LWRP にアップグレードすると、ビルトインのシェーダーを新しいものにアップグレードできます。
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).
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.
To use LWRP or HDRP, you can either:
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:
テンプレートの使用に関する詳細は、プロジェクトテンプレート を参照してください。
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:
Before you can use LWRP or HDRP, you must create a Render Pipeline Asset and add it to your Project settings.
To create a Render Pipeline Asset for your render pipeline, see either the:
To assign the Render Pipeline Asset to your Project:
SRP は GitHub のオープンプロジェクトで利用可能です。SRP を複製を作成しローカルのものを変更できます。
新規、または既存の Unity プロジェクトのローカルのスクリプトファイルを設定するには以下の手順で行います。
SRP リポジトリの複製を作成します。Project ディレクトリのルートで Assets フォルダーのとなりに複製を置きます。リポジトリの複製に関する情報は GitHub Help の リポジトリをクローンする を参照してください。
Unity のバージョンと一致するブランチをチェックアウトします。git checkout
コマンドを使用し、ブランチ名をタイプします。
git submodule update --init
コマンドを使用して、SRP に関連するすべてのサブモジュールを見つけて初期化します。
プロジェクトマニフェストで、dependencies
を更新すると、SRP パッケージを指します。 プロジェクトマニフェストに関して詳しくは Package Manager ドキュメント を参照してください。以下はスクリプトの 1 例です。
{
"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"
}
}
Unity でプロジェクトを開きます。パッケージはローカルにインストールされています。統合された開発環境で Project Solution を開くと、スクリプトを直接デバッグし修正することができます。