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.
  2. Unity 2022.2 is now available as the latest Tech release.
    Dismiss Notice
  3. We are making some changes to the DOTS forums.
    Dismiss Notice
  4. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Question Shadow ONLY Shader in URP 12.1.6 & Unity 2021.3.0+

Discussion in 'Shaders' started by Ruhan-_-, May 20, 2022.

  1. Ruhan-_-

    Ruhan-_-

    Joined:
    Sep 14, 2016
    Posts:
    20
    Just as the title says, I just need a simple shader to apply on a Quad on the ground so that it simply shows the shadow received only WITHOUT mesh or shadow casting.

    I have gone through the following forums but something in URP changed again and there is no way to obtain this..

    https://forum.unity.com/threads/how-to-make-receive-shadow-shader-in-urp.849178/
    https://forum.unity.com/threads/urp...hadows-exclusively-from-other-objects.871561/
    https://forum.unity.com/threads/wat...adows-universal-render-pipeline-order.748142/
    https://forum.unity.com/threads/matte-shader-only-shadows-in-hdrp.740684/

    This is the only poor hack I was able to find by experimenting but it still multiplies the colors behind it. There are no combination of settings to my knowledge that allows alpha 0 while showing shadows properly.

    upload_2022-5-20_12-32-41.png

    upload_2022-5-20_12-34-15.png
     
  2. Ruhan-_-

    Ruhan-_-

    Joined:
    Sep 14, 2016
    Posts:
    20
  3. Mr_FJ

    Mr_FJ

    Joined:
    Sep 4, 2013
    Posts:
    5
    With URP 3.1.8 I get this error when I import the package:
    Code (CSharp):
    1. Shader error in 'Shader Graphs/ShadowReceiver': Couldn't open include file 'Packages/com.cyanilux.shadergraph-customlighting/CustomLighting.hlsl'.
    Can anyone help? :)
     
  4. Ruhan-_-

    Ruhan-_-

    Joined:
    Sep 14, 2016
    Posts:
    20
    I'd recommend updating to Unity 2021. URP 3.1.8 is very outdated.
    As per your problem, the github root directory has the CustomLighting.hlsl file that the shader is complaining about. Move it to a new directory like root Asset folder and change that line in the shader file to point to 'Assets/CustomLighting.hlsl' instead of 'Packages/com.cyanilux.shadergraph-customlighting/CustomLighting.hlsl'

    upload_2022-8-26_15-13-19.png