|
1 | 1 | # Convert materials and shaders |
2 | 2 |
|
3 | | -To upgrade the Materials in your Scene to HDRP-compatible Materials: |
| 3 | +After you [set up your project to use HDRP](convert-from-built-in-convert-project-with-hdrp-wizard.md), use the material upgraders or the [Render Pipeline Converter](rp-converter.md) to convert prebuilt material and shaders made for a Built-In Render Pipeline project to be compatible with the High Definition Render Pipeline (HDRP). |
| 4 | + |
| 5 | +Material upgraders and the Render Pipeline Converter don't support converting custom materials or shaders. To convert custom materials and shaders, you must [convert them manually](#ManualConversion). |
| 6 | + |
| 7 | +**Warning**: Using material upgraders or the Render Pipeline Converter overwrites several files in your project folder. These can't be restored after Unity overwrites them. Before you start this task, back up any files you don't want to lose. |
| 8 | + |
| 9 | +## Convert materials and shaders using material upgraders |
| 10 | + |
| 11 | +To upgrade the materials and shaders from the Built-In Render Pipeline to HDRP with material upgraders, do the following: |
4 | 12 |
|
5 | 13 | 1. Go to **Edit** > **Rendering** > **Materials** |
6 | 14 | 2. Choose one of the following options: |
7 | 15 |
|
8 | | - * **Convert All Built-in Materials to HDRP**: Converts every compatible Material in your Project to an HDRP Material. |
9 | | - * **Convert Selected Built-in Materials to HDRP**: Converts every compatible Material currently selected in the Project window to an HDRP Material. |
10 | | - * **Convert Scene Terrains to HDRP Terrains**: Replaces the built-in default standard terrain Material in every [Terrain](https://docs.unity3d.com/Manual/script-Terrain.html) in the scene with HDRP default Terrain Material. |
| 16 | + * **Convert All Built-in Materials to HDRP**: Converts every compatible material in your project to an HDRP material. |
| 17 | + * **Convert Selected Built-in Materials to HDRP**: Converts every compatible material currently selected in the Project window to an HDRP Material. |
| 18 | + * **Convert Scene Terrains to HDRP Terrains**: Replaces the built-in default standard terrain material in every [Terrain](https://docs.unity3d.com/Manual/script-Terrain.html) in the scene with HDRP default Terrain material. |
11 | 19 |
|
12 | | -## Limitations |
| 20 | +### Limitations |
13 | 21 |
|
14 | | -The automatic upgrade options described above can't upgrade all Materials to HDRP correctly: |
| 22 | +The automatic upgrade options described can't upgrade all materials to HDRP correctly: |
15 | 23 |
|
16 | | -* You can't automatically upgrade custom Materials or Shaders to HDRP. You must [convert custom Materials and Shaders manually](#ManualConversion). |
17 | 24 | * HDRP can only convert materials from the **Assets** folder of your project. HDRP uses the [error shader](xref:shader-error) for GameObjects that use the default read-only material from the Built-In Render Pipeline, for example [primitives](xref:um-primitive-objects). |
18 | | -* Height mapped Materials might look incorrect. This is because HDRP supports more height map displacement techniques and decompression options than the Built-in Render Pipeline. To upgrade a Material that uses a heightmap, modify the Material's **Amplitude** and **Base** properties until the result more closely matches the Built-in Render Pipeline version. |
| 25 | +* Height mapped materials might look incorrect. This is because HDRP supports more height map displacement techniques and decompression options than the Built-In Render Pipeline. To upgrade a material that uses a heightmap, modify the Material's **Amplitude** and **Base** properties until the result more closely matches the Built-In Render Pipeline version. |
19 | 26 | * You can't upgrade particle shaders. HDRP doesn't support particle shaders, but it does provide Shader Graphs that are compatible with the [Built-in Particle System](https://docs.unity3d.com/Manual/Built-inParticleSystem.html). These Shader Graphs work in a similar way to the built-in particle shaders. To use these Shader Graphs, import the **Particle System Shader Samples** sample: |
20 | 27 |
|
21 | 28 | 1. Open the Package Manager window (menu: **Window** > **Package Management** > **Package Manager**). |
22 | 29 | 2. Find and click the **High Definition RP** entry. |
23 | 30 | 3. In the package information for **High Definition RP**, go to the **Samples** section and click the **Import into Project** button next to **Particle System Shader Samples**. |
24 | 31 |
|
| 32 | +<a name="render-pipeline-converter"></a> |
| 33 | + |
| 34 | +## Convert shaders using the Render Pipeline Converter |
| 35 | + |
| 36 | +To convert prebuilt shaders from the Built-In Render Pipeline to HDRP with the Render Pipeline Converter, do the following: |
| 37 | + |
| 38 | +1. Go to **Window** > **Rendering** > **Render Pipeline Converter**. |
| 39 | + |
| 40 | + Unity opens the [Render Pipeline Converter window](rp-converter.md). |
| 41 | +2. Set **Source Pipeline** to **Built-in**. |
| 42 | +3. Set **Target Pipeline** to **High Definition Render Pipeline (HDRP)**. |
| 43 | +4. Select the checkbox next to **Material Shader Converter**. |
| 44 | +5. Select **Scan**. |
| 45 | + |
| 46 | + Unity processes the assets in your project and displays the list of shaders it can convert under your selected converter. |
| 47 | +6. Select the checkboxes next to the assets you want to convert. |
| 48 | +7. Select **Convert Assets**. |
| 49 | + |
| 50 | + When Unity finishes the conversion process, the window displays the status of each conversion. |
| 51 | + |
| 52 | +### Shader mapping |
| 53 | + |
| 54 | +The following table shows which HDRP resource path the Built-In Render Pipeline materials map to when you use the Render Pipeline Converter. |
| 55 | + |
| 56 | +| **Built-In Render Pipeline material** | **HDRP resource path** | |
| 57 | +| ------------------------------------- | ------------------------------------------------------------------------ | |
| 58 | +| `Default-Diffuse` | `Runtime/RenderPipelineResources/Material/DefaultHDMaterial.mat` | |
| 59 | +| `Default-Material` | `Runtime/RenderPipelineResources/Material/DefaultHDMaterial.mat` | |
| 60 | +| `Default-ParticleSystem` | `Runtime/RenderPipelineResources/Material/DefaultHDParticleMaterial.mat` | |
| 61 | +| `Default-Particle` | `Runtime/RenderPipelineResources/Material/DefaultHDParticleMaterial.mat` | |
| 62 | +| `Default-Terrain-Diffuse` | `Runtime/RenderPipelineResources/Material/DefaultHDTerrainMaterial.mat` | |
| 63 | +| `Default-Terrain-Specular` | `Runtime/RenderPipelineResources/Material/DefaultHDTerrainMaterial.mat` | |
| 64 | +| `Default-Terrain-Standard` | `Runtime/RenderPipelineResources/Material/DefaultHDTerrainMaterial.mat` | |
| 65 | + |
25 | 66 | <a name="ManualConversion"></a> |
26 | 67 |
|
27 | | -## Converting Materials manually |
| 68 | +## Convert materials manually |
28 | 69 |
|
29 | | -HDRP uses multiple processes to automatically convert Built-in Standard and Unlit Materials to HDRP Lit and Unlit Materials respectively. These processes use an overlay function to blend the color channels together, similar to the process you would use in image editing software like Adobe Photoshop. |
| 70 | +HDRP uses multiple processes to automatically convert Built-in Standard and Unlit Materials to HDRP Lit and Unlit materials respectively. These processes use an overlay function to blend the color channels together, similar to the process you would use in image editing software like Adobe Photoshop. |
30 | 71 |
|
31 | | -To help you convert custom Materials manually, this section describes the maps that the converter creates from the Built-in Materials. |
| 72 | +To help you convert custom materials manually, this section describes the maps that the converter creates from the Built-in Materials. |
32 | 73 |
|
33 | 74 | ### Mask maps |
34 | 75 |
|
35 | | -The Built-in Shader to HDRP Shader conversion process combines the different Material maps of the Built-in Standard Shader into the separate RGBA channels of the mask map in the HDRP [Lit Material](lit-material.md). For information on which color channel each map goes in, see [mask map](Mask-Map-and-Detail-Map.md#MaskMap). |
| 76 | +The Built-in Shader to HDRP Shader conversion process combines the different material maps of the Built-in Standard Shader into the separate RGBA channels of the mask map in the HDRP [Lit Material](lit-material.md). For information on which color channel each map goes in, refer to [Mask map](Mask-Map-and-Detail-Map.md#MaskMap). |
36 | 77 |
|
37 | 78 | ### Detail maps |
38 | 79 |
|
39 | | -The Built-in Shader to HDRP Shader conversion process combines the different detail maps of the Built-in Standard Shader into the separate RGBA channels of the detail map in the HDRP [Lit Material](lit-material.md). It also adds a smoothness detail too. For information on which color channel each map goes in, see [detail map](Mask-Map-and-Detail-Map.md#DetailMap). |
| 80 | +The Built-in Shader to HDRP Shader conversion process combines the different detail maps of the Built-in Standard Shader into the separate RGBA channels of the detail map in the HDRP [Lit Material](lit-material.md). It also adds a smoothness detail too. For information on which color channel each map goes in, refer to [Detail map](Mask-Map-and-Detail-Map.md#DetailMap). |
0 commit comments