Search Unity

Question Render additional object into shadow map

Discussion in 'High Definition Render Pipeline' started by SkiesOfArcadia, Mar 29, 2021.

  1. SkiesOfArcadia

    SkiesOfArcadia

    Joined:
    Nov 27, 2017
    Posts:
    2
    Hi,

    Im rendering an object using a custom pass in HDRP (I render a quad in front of camera and use depth offset)
    It looks good, but it doesn't cast shadows.

    How can I hook into the directional light shadow maps to add my object into it?
    Seems we have access to events like LightEvent.AfterShadowMap, so it seems possible I can hook in and render my custom object into the shadowmap.

    Its not clear if I can get the shadow map camera. Given its a screenspace effect I need to do the same effect in the shadowmap camera.


    Alternatively is there a way for this to just work? It seems calling the shadowcaster pass manually doesnt work