You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR is adressing 3 tickets :
- Wrong sets of culled objects are rendered with OnDemand shadow rendering https://jira.unity3d.com/browse/UUM-60823
- Expensive Culling for Non-Rendered Shadow Cascades https://jira.unity3d.com/browse/UUM-60917
- Use-after-free causing a crash under certain conditions https://jira.unity3d.com/browse/UUM-68625
The first ticket is a bug. Some shadow casters are culled when they shouldn't.
The second ticket is a performance improvement. It allows some culling jobs not to be kicked at all when no shadow map update is needed for a given light. E.g when using OnDemand or OnEnable shadow rendering mode and no update was requested.
It is also speeding up culling jobs by skipping receiver sphere culling for the shadow cascade which do not need an update.
Implementation keypoints:
- Fix the splitIndex not being passed to ShadowDrawingSettings. Simply store the splitIndex HDShadowCullingSplit and retrieve it when building the ShadowDrawingSettings
- Refactor shadow caching code so that we know at culling time if a shadow cache will need to be updated or not
- Discard culling jobs for the lights which have no shadow maps to update at all (and does not have the draw dynamic checkbox enabled)
- Add support for a new `splitExclusionMask` API which allows SRP code to tell if culling should be skipped for some cascades (e.g. because of shadow caching)
- Use the `splitExclusionMask` value internally to skip receiver sphere culling on C++ side
- Pass the `splitExclusionMask` value to BRG OnPerformCulling callback so that EG, GRD or any BRG user code can beneficiate from it
Copy file name to clipboardExpand all lines: Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDGpuLightsBuilder.LightLoop.cs
Copy file name to clipboardExpand all lines: Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDProcessedVisibleLightsBuilder.cs
0 commit comments