How to Fix the Shader Error of a World?
If a pink-purple model appears in your project, as shown in the following figure, the materials of your model are using shaders that are not supported by the URP project. When such an issue occurs, try to resolve it by using the following methods:

Use Unity’s Built-In Tool
This method is only applicable to materials that use Unity's built-in shaders.
Find the Material That Is Using Incorrect Shaders
Find the GameObject with incorrect shaders in the Hierachy panel. Then find the Mesh Renderer component and the Materials property. Expand this property to find the material that is using incorrect shaders.
Convert a Single Material
- Select the material to convert.
- Click the feature item in the menu below.

- Click Proceed to finish conversion.

Convert All Materials for the Entire Scene
Finding all materials with incorrect shaders and replacing them one by one is troublesome. Unity provides a feature that can replace all materials in the scene at a time. The steps are as follows:
- Click Window > Rendering > Render Pipeline Converter.

- Click the drop-down menu in the panel and select Build-in to URP.
- Select Material Upgrade below.

- Click the Initialize Converters button.

- Click the Convert Assets button on the right to finish conversion.

Replace Shaders on Your Own
Find the Material That Is Using Incorrect Shaders
Find the GameObject with incorrect shaders in the Hierachy panel. Then find the Mesh Renderer component and the Materials property. Expand this property to find the material that is using incorrect shaders.
Replace the Shaders
Replace the shaders of the material with URP shaders. You can use ParaSpace shaders, which deliver better performance and have more properties. We recommend making a copy of the original material. That is because after you replace the shaders, some shader properties will be reset, causing property losses. With the copy, you can use it as a reference to set new shader properties to the original values.

Updated almost 2 years ago