Search Unity

Surface shaders: how to identify that you are inside a shadowpass?

Discussion in 'Shaders' started by cubrman, Jul 14, 2019.

  1. cubrman

    cubrman

    Joined:
    Jun 18, 2016
    Posts:
    412
    How can I identify that I am inside a shadowpass when I am writing a surface shader? Any #if directive I can use?
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    #if defined(UNITY_PASS_SHADOWCASTER)
     
  3. cubrman

    cubrman

    Joined:
    Jun 18, 2016
    Posts:
    412
    @bgolus, thanks. Jesus it's incredible to see that you are still here for us, bgolus. Srsly Unity should be paying you at this point for all the servise you've done!