HDRP custom shadow injection, best approach

Hello,

I am looking to add custom shadows to HDRP, but based on the available injection points, I’m not sure what the best method might be.

The shadows are for volumetric clouds, and I have a precalculated 3D shadow map volume (rather than a cookie like the Unity ones), which should be pretty trivial to apply using the depth buffer, but finding the right way to actually do this is proving mysterious.

Has anyone tried something like this? What approach did you take?

Thanks so much,
Chris

2 Likes

Oops forgot about this. Anyway the best solution I found was just to locally duplicate Deferred.compute and VolumetricLighting.compute, and inject my shadows in the lightloop, and shadow sample respectively. This is quite trivial and easy to maintain without needing to have HDRP as an embedded package.

To use these you just need to duplicate HDRenderPipelineRuntimeResources locally in your project, and set your custom compute shaders respectively. Then tell HDRP to use these resources.

5 Likes