Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Get cast shadow info on Shader Graph

Discussion in 'Shader Graph' started by zh4ngwei88, Sep 17, 2020.

  1. zh4ngwei88

    zh4ngwei88

    Joined:
    Nov 7, 2017
    Posts:
    2
    Hi, does anyone knows if there is a way to retrieve shadow info from shader graph?

    I'm trying to create a custom shader that is able to receive cast shadow but I am unable to find any shadow related node in the shader graph. If I place a mesh between my object with a custom shader and light source, my object does not receive a cast shadow. NeedHelp.png

    My shader is able to get the color and direction of lights in the scene, but since I am unable to get a shadow pass, how can I get the shader to detect if there is something in between itself an the light source? Is that an advisable method or does someone have a way for custom shaders to receive shadow?
     

    Attached Files:

  2. imagoFX

    imagoFX

    Joined:
    Sep 19, 2011
    Posts:
    84
    I second the question. Is there a way to access shadow information inside shader graph? Or should I go back to writing shaders manually...?