unity-game-engineshaderunity3d-ui

Shader graph for UI works in scene tab but not in game tab


I'm trying to create a shader that would add a glow to a UI item. It works in scene tab:

shader works

But in Game tab or in built project in doesn't work at all:

shader doesn't work

I'm not really good at shaders so I'm not sure if I'm doing something wrong or Shader Graph doesn't supposed to be used with Unity UI. Does it?


Solution

  • Turn your canvas's rendering mode to Screen Space - Camera or World Space.

    This is necessary because render shaders (unlike compute shaders) require a camera to make any sense, and UIs made with Screen Space - Overlay do not make use of a camera.