Search Unity

Question Shadow casting matrix

Discussion in 'High Definition Render Pipeline' started by meicexl, May 18, 2023.

  1. meicexl

    meicexl

    Joined:
    Apr 9, 2020
    Posts:
    12
    Hey there,

    We're currently working on a first-person game and need first person objects to cast shadows onto themselves, but not onto other objects. Basically, we're wondering whether there's an equivalent of the Layer Collision Matrix but for shadow casting.

    We're using shadow layers to prevent first-person objects from casting any shadows, and contact shadows to provide some basic shadowing, but there are all the caveats that come from being screen-space: light leaking at screen edges, incorrect shadows, etc, etc.

    Contact shadows are kinda good enough, but we're wondering whether anybody has any ideas on how to achieve this, since actual shadows look far better. We'd prefer to avoid custom shaders, if possible.

    Cheers.