Search Unity

Question Separating Shadow Casting and Shadow Receiving in Unity 2020+

Discussion in 'Shaders' started by DevilBlackDeath, Sep 15, 2022.

  1. DevilBlackDeath

    DevilBlackDeath

    Joined:
    Mar 16, 2014
    Posts:
    14
    Hello everyone,

    has anyone been able to figure out a way to differentiate shadow casting and receiving in Unity 2020 and above using the built-in pipeline ?

    As far as my researches go it seems ShadowCaster is used for receiving and casting as well as self shadowing. Actually ShadowCollector isn't even lister as a possible value for the LightMode shader tag anymore.

    The idea would be to have a vertex shader that's different for both. The vertices used for casting would be displaced, but not those for receiving shadow (so the model is properly rendered on screen).

    I thought about using #pragma multi_compile_shadowcollector and using the defines to differentiate, but that apparently doesn't work and seemingly doesn't do anything (which makes sense since apparently, internally, shadow collecting and casting have been "unified" in a way).

    Thanks in advance everyone and have a good day !