Skip to content

Commit d880ff4

Browse files
fabien-unitysebastienlagarde
authored andcommitted
HDRP - Fix XR shadows culling (#2263)
1 parent 40c76ed commit d880ff4

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

com.unity.render-pipelines.high-definition/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
6666
- Fixed issue with lookdev shadows looking wrong upon exiting playmode.
6767
- Fixed temporary Editor freeze when selecting AOV output in graphics compositor (case 1288744).
6868
- Fixed normal flip with double sided materials.
69+
- Fixed XR shadows culling
6970

7071
### Changed
7172
- Combined occlusion meshes into one to reduce draw calls and state changes with XR single-pass.

com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3256,6 +3256,10 @@ out ScriptableCullingParameters cullingParams
32563256
if (hdCamera.xr.enabled)
32573257
{
32583258
cullingParams = hdCamera.xr.cullingParams;
3259+
3260+
// Sync the FOV on the camera to match the projection from the XR device in order to cull shadows accurately
3261+
if (!camera.usePhysicalProperties)
3262+
camera.fieldOfView = Mathf.Rad2Deg * Mathf.Atan(1.0f / cullingParams.stereoProjectionMatrix.m11) * 2.0f;
32593263
}
32603264
else
32613265
{

0 commit comments

Comments
 (0)