Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

How to convert Custom Shaders to URP in Unity?

Discussion in 'Universal Render Pipeline' started by castana1962, May 26, 2020.

  1. castana1962


    Apr 10, 2013
    Hi All
    Sorry but I am new in the URP topics and I have a Unity project with Custom Shaders and I need to upgrade it to URP, for it, Could anybody advice about how to do it?
    Thanks for your time
  2. chrismarch


    Jul 24, 2013
    Your old unlit shaders shouldn't need a ton of work, although you may need to remove LightMode Tags, like ForwardBase, if those snuck into your unlit shaders...

    Your lit shaders will basically be incompatible, and you will need to either recreate them in Shader Graph, for maximum portability with future versions of URP, or base new versions of them off of stock URP shaders like Lit and SimpleLit, which are included in the packages:


    Then, once your shaders are working, you will want to make them SRP Batching compatible, for better performance. This is done for you if you work through Shader Graph, otherwise, you will need to read the blog and then convert your CG to HLSL with the new functions, using the Unity GitHub as a reference for the new utility HLSL function names: