Convert assets and quality levels from the Built-In Render Pipeline to URP
Convert material references, prebuilt shaders, and quality levels made for a Built-in Render Pipeline project to be compatible with URP.
阅读时间4 分钟最后更新于 22 天前
After you configure your project to use URP, use the Render Pipeline Converter to convert material references, shaders, and quality levels made for a Built-In Render Pipeline project to be compatible with the Universal Render Pipeline (URP).
Convert material references, shaders, and quality levels using the Render Pipeline Converter
To convert read-only material references, prebuilt shaders, and quality levels from the Built-In Render Pipeline to the Universal Render Pipeline (URP), do the following:
-
Go to Window > Rendering > Render Pipeline Converter.Unity opens the Render Pipeline Converter window.
-
Set Source Pipeline to Built-in.
-
Set Target Pipeline to Universal Render Pipeline (Universal Renderer).
-
Select the checkboxes next to your Material Reference Converter, Material Shader Converter, and Rendering Settings.If you have animation clips or Post-Processing Stack v2 assets in your project, also select the checkboxes next toand Post-Processing Stack v 2. For more information on these converters, refer to Render Pipeline Converter window for URP reference.Animation Clip
?
-
Select Scan.Unity processes the assets in your project and displays the list of materials and levels it can convert under your selected converters.
-
Select the checkboxes next to the assets you want to convert.
-
Select Convert Assets.When Unity finishes the conversion process, the window displays the status of each conversion.
Your quality levels in URP might provide a different level of performance from your Built-In Render Pipeline project. To manually update the quality levels to match the previous performance, refer to Match the quality level performance of the Built-In Render Pipeline in URP.
For more information on what material references and shaders, and quality levels Unity converts to, refer to the following:
- Built-In Render Pipeline material references in URP reference
- Built-In Render Pipeline prebuilt shaders in URP reference
Convert assets using the command line
You can run the conversion process from the command line, using the Converters class with RunInBatchMode methods.
Use the command with the following commands and options:
RunInBatchModeCmdLineCommand | Description |
|---|---|
| Shows help and exit. |
| Lists all available containers and their converters. |
Option | Description |
|---|---|
| Defines the name of the container to be batched. This is required. Use the |
| Includes the list of converters specified with |
| Excludes the list of converters specified with |
| Defines the list of converters to include or exclude from batching. These converters must be part of the container you pass in for them to run. Use the |
For example, the following command initializes and executes Material Reference Converter and Material Shader Converter from the command line.
<path to Unity application> -projectPath <project path> -batchmode -executeMethod UnityEditor.Rendering.Universal.Converters.RunInBatchModeCmdLine -container BuiltInToURP -typesFilter Material --inclusive ReadonlyMaterial
Convert materials using API/CLI
You can also convert materials using the Converters class with RunInBatchMode.
For example, the following script initializes and executes the Material Reference Converter and Material Shader Converter.
using System.Collections;using System.Collections.Generic;using UnityEditor;using UnityEditor.Rendering.Universal;using UnityEngine;public class MyUpgradeScript : MonoBehaviour{ public static void ConvertBuiltinToURPMaterials() { Converters.RunInBatchMode( ConverterContainerId.BuiltInToURP , new List<ConverterId> { ConverterId.Material, ConverterId.ReadonlyMaterial } , ConverterFilter.Inclusive ); EditorApplication.Exit(0); }}
To run the example conversion from the command line, use the following command:
"<path to Unity application> -projectPath <project path> -batchmode -executeMethod MyUpgradeScript.ConvertBuiltinToURPMaterials