Converting from High Definition Render Pipeline (HDRP) to Universal Render Pipeline (URP) is a non-trivial process because these two pipelines are designed with different goals and use different rendering techniques. Here's how to approach this conversion:
Backup Your Project: Before making any changes, it's crucial to backup your entire project.
Install URP: Go to
Window -> Package Manager, find the Universal RP package, and install it.
Create a URP Asset: In the Project view, create a new
Universal Render Pipeline ->
Pipeline Asset (Forward Renderer) and optionally a
2D Renderer if your project requires it.
Configure Project Settings:
Edit -> Project Settings -> Graphics.
Scriptable Render Pipeline Settings field.
Review Lighting Settings: Since lighting works differently between the two pipelines, you'll need to revisit your lighting settings and potentially re-bake lightmaps.
Check and Update Custom Shaders: If you have custom HDRP shaders, they won't work in URP without modification. Converting these shaders involves rewriting them to comply with URP standards, which might require substantial effort depending on their complexity.
Rebuild Post-Processing: URP uses its integrated post-processing stack, so you will need to set up post-processing effects again within the URP framework.
Resolve Other Compatibility Issues:
Testing: Finally, test your entire project extensively to ensure everything renders as expected.
Here's a pseudo code example to change materials' shaders to URP:
This code would attempt to switch each material using a HDRP shader to a similarly named URP shader. Note that shader naming conventions may differ, so this code may require customization.
Remember, converting between render pipelines should be done at an early stage of production where possible. If you're deeper into development, weigh the pros and cons carefully, as switching pipelines can significantly affect your project's visuals and performance.