Search Unity

I need to make a 3rd party shader compatible with URP

Discussion in 'Universal Render Pipeline' started by Xtro, Oct 16, 2020.

  1. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    610
    Hello.

    I want to use a shader from the amazing Honey Hex project in my URP game but the shader renders as pink in URP and I don't know how to fix it.

    As you can see in the screenshot, displacement and tessellation work but any kind of pixel shading doesn't work.
    Adsız.jpg

    I asked the question in the Honey Hex forums but didn't get a response yet and I don't know if they have experience on URP so I wanted to ask it here too.

    What could be the reason for it to not work on URP?

    What is the best way to debug a shader code and find the bug?

    The source of the shader is attached here. Since Honey Hex is a free project, I guess it's not wrong to share the shader here to ask for help.
     

    Attached Files:

  2. revolute

    revolute

    Joined:
    Jul 28, 2014
    Posts:
    50
    Surface shader semantics doesn't work in URP. You have to manually write fragment shader that can be converted from surface block. The basic surface shader in Unity pipeline is practically well wrapped fragment shader that calls surface code block with a few options mixed in.
     
  3. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    610
    Thank you very much for the detailed answer. I am not a shader expert so I ended up buying a 3rd party shader which does a similar thing with this old shader. Thank you.