Search Unity

Question Draw only received shadow.

Discussion in 'Shader Graph' started by lordubik, Oct 13, 2021.

  1. lordubik

    lordubik

    Joined:
    Feb 18, 2013
    Posts:
    149
  2. Sinterklaas

    Sinterklaas

    Joined:
    Jun 6, 2018
    Posts:
    93
    PutridEx likes this.
  3. lordubik

    lordubik

    Joined:
    Feb 18, 2013
    Posts:
    149
    but my trouble is don't draw the mesh that received the shadow... is it possible?
     
  4. lordubik

    lordubik

    Joined:
    Feb 18, 2013
    Posts:
    149
    anybody have an idea? :oops: Thanks!
     
  5. Sinterklaas

    Sinterklaas

    Joined:
    Jun 6, 2018
    Posts:
    93
    Well once you have the amount of shadow attenuation of a pixel, you could for example put that value through a One Minus node, and then put the result in the fragment node's alpha input. This would make all pixels of a mesh transparent, except for the ones that are shadowed.