Search Unity

URP - Unlit shader that can receive shadows

Discussion in 'Shaders' started by stefanplc, Oct 24, 2020.

  1. stefanplc

    stefanplc

    Joined:
    Feb 21, 2015
    Posts:
    82
    Hi,

    I have an environment that uses painted textures and I don't want the colors to be affected by light sources so an unlit shader works great for it. I created one using Shader Graph and all it has is a Texture2D node which goes to a Sample Texture 2D node which connects to the color.

    I also have a few characters that travel through this environment and I would like them to cast realtime shadows on it if possible. By default this doesn't seem to be possible. If I change the environment shader from an Unlit Graph to a PBR graph it works, but now the colors of the environment are affected and that can't happen.

    I'm quite bad with shaders, is there any simple solution that I could implement or am I stuck without shadows for now?

    Thank you!
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
  3. devravenio

    devravenio

    Joined:
    Jun 9, 2014
    Posts:
    11
    densy07 and Kreshi like this.
  4. Kreshi

    Kreshi

    Joined:
    Jan 12, 2015
    Posts:
    446
    Is there any update on this? I don't see any out-of-the-box support for receiving shadows for Unlit shaders in shader graph.. (Unity 2022.2)

    [EDIT]
    Ok, found a workaround from this video tutorial:
     
    Last edited: Oct 10, 2022
    dustyh55 and ColtPtrHun like this.