Search Unity

Help Wanted [Solved] Shadows not working properly in custom shader (HDRP)

Discussion in 'Shader Graph' started by LukaKotar, Feb 14, 2020 at 7:00 AM.

  1. LukaKotar

    LukaKotar

    Joined:
    Sep 25, 2011
    Posts:
    383
    I'm having trouble with shadows on my Shader Graph shaders. The shadows are present, but they are a lot lighter than they should be.

    Here is the scene using the default "HDRP/Lit" shader:

    (Attachment didn't work, but you can view the screenshot here)

    And here is a basic recreation of the shader using Shader Graph:

    upload_2020-2-14_7-52-7.png

    The shader used in the second screenshot looks like this:


    Am I doing something wrong, or is this some kind of a bug/limitation?
     

    Attached Files:

  2. LukaKotar

    LukaKotar

    Joined:
    Sep 25, 2011
    Posts:
    383
    I had issues with embedding attachments in the original post. If I try to edit it again, the image disappears, so I won't be trying to fix it. First attachment is a screenshot of the scene using the default shader, and the other one is the shader graph.
     
  3. LukaKotar

    LukaKotar

    Joined:
    Sep 25, 2011
    Posts:
    383
    Solved it. I had to connect a "Dielectric Specular" node to "AmbientOcclusion", and set the "Specular Occlusion Mode" to "From AO".
     

    Attached Files:

    Last edited: Feb 14, 2020 at 8:01 AM
unityunity