/main-light-shadow-cascades-culling

Test project to investigate main light shadow cascades culling in Unity render pipelines

main-light-shadow-cascades-culling

Test project to investigate main light shadow cascades culling in Unity render pipelines

Illustrates the comment mentioned in Unity-Technologies/Graphics#1616 (comment)

Illustration steps

The test contains 8 shadow casters (4 cubes, 4 spheres) spread along the 4 cascades slices of a DIrectional Light:

Be careful that currently Package Manager fails to download packages from repos containing largefiles, so until this is fixed you have to locally checkout that modified URP fork/branch, and modify file cascades-culling-urp-cullingplanes/Packages/manifest.json to make it use this local version of URP package.

  • Open Frame Debugger in both projects

In reference scene, only 12 shadow casters are rendered in the shadow map.
In the test scene, that uses a version of URP modified to keep the ShadowSplitData culling planes returned from CullingResults.ComputeDirectionalShadowMatricesAndCullingPrimitives, and later pass them to ScriptableRenderContext.DrawShadows, 28 shadow casters are rendered in the shadow map.

  • Optionally Check the values passed with the culling planes

Attach managed debugger and place a breakpoint at the following location to verify that in the test version of URP package, the ShadowSplitData object passed to does contain culling planes information: