unity-game-engineshadershader-graph

Unity3D - How do you turn off "receive shadows" in a shader made with Shader Graph?


Unlike default URP shaders, custom Shader Graph shaders dont come with a "receive shadows" checkbox as you can see here. How can I disable shadow receiving on my shader? Or alternatively, turn off shadow receiving on any material/object that uses my shader

this is a lit shader that does have "receive shadows" option


Solution

    1. Go to your Graph.
    2. Below Properties, there is a section called Keywords.
    3. Add a new Keyword, set Reference to _RECEIVE_SHADOWS_OFF, Definition Shader Feature, Scope Global and Default True.
    4. Go to your material, click on three dots in the right upper corner of the Inspector and select Debug
    5. Set Shader Keywords to _RECEIVE_SHADOWS_OFF

    That should do it.