Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question LWRP. Shader Graph. Custom shader casts no shadow

Discussion in 'Shader Graph' started by fotalik, May 24, 2019.

  1. fotalik

    fotalik

    Joined:
    Sep 23, 2017
    Posts:
    24
    Hello!

    I created an empty Graph by clicking Create -> Shaders -> PBR Graph. I created the material for this shader and assign it to my game object, but the object does not cast a shadow. If I assign LWRP Lit material by default, then everything works and the shadows are dropped, but with a custom shader there is no.

    Has anyone come across this?

    upload_2019-5-24_14-44-24.png upload_2019-5-24_14-45-26.png
    upload_2019-5-24_14-48-4.png

    LWRP Version - 5.6.1
    Shader Graph - 5.6.1

    I cannot update the package versions because this is an AR Foundation project.
     
  2. Keyserjaya99

    Keyserjaya99

    Joined:
    Nov 17, 2016
    Posts:
    10
    Have the same issues too :' )
     
  3. BrunoBelmonte

    BrunoBelmonte

    Joined:
    Jan 16, 2013
    Posts:
    7
    Found the bug. If you use a transparent surface type on standard LWRP or UniversalRP (that not cast shadows) than change that material to a custom shadergraph's shader, you lose shadow casting. Just use a lit shader for the new pipelines, set it to Opaque, than change it to your custom shader.
     
  4. garamanx

    garamanx

    Joined:
    Apr 3, 2019
    Posts:
    10
    I just had the same issue. My problem was that I changed the shader of an existing material with (hidden) parameters set up previously. I solved it by starting again with a freshly created material.