urp-toon-shader icon indicating copy to clipboard operation
urp-toon-shader copied to clipboard

Unity 2023: Shader does not work in build mode.

Open TBartl opened this issue 4 months ago • 0 comments

I understand this repo isn't maintained or verified beyond 2021, but I figured I'd leave this here in case anyone else runs into this while trying to use a more modern version of unity.

Attempting to use these shaders in 2023.2.6f1 works in the editor, but fails during runtime: the shaders will appear pink.

After some debugging, I found this was because of the RenderPipeline tag defined:

  • It is currently defined as UniversalRenderPipeline
  • It should be UniversalPipeline

This one is really Unity's fault in the first place: https://forum.unity.com/threads/renderpipeline-tag-changed.1468196/

Older versions of unity <2022 wouldn't actually respect this tag, and some of the documentation had it listed incorrectly.

For anyone looking for a quick workaround, you can create a "CustomToonShader" and edit the shader tags directly in the hlsl file generated from it.

TBartl avatar Feb 23 '24 18:02 TBartl