Skip to content

Commit 468c4c3

Browse files
robinb-u3dsebastienlagarde
authored andcommitted
Fix XR Display providers not getting zNear and zFar updated on them. #1269
1 parent f9ffcbe commit 468c4c3

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2727
- Fixed errors when switching area light to disk shape while an area emissive mesh was displayed.
2828
- PBR Sky now doesn't go black when going below sea level, but it instead freezes calculation as if on the horizon.
2929
- Fixed XR single-pass macros in tessellation shaders.
30+
- Fixed XR Display providers not getting zNear and zFar plane distances passed to them when in HDRP.
3031

3132
### Changed
3233
- Changed extensions of shader CAS include files.

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,12 @@ internal int GetMaxViews()
150150
Debug.LogWarning("RenderViewportScale has no effect with this render pipeline. Use dynamic resolution instead.");
151151
}
152152

153+
if(display != null)
154+
{
155+
display.zNear = camera.nearClipPlane;
156+
display.zFar = camera.farClipPlane;
157+
}
158+
153159
if (xrSdkActive)
154160
{
155161
CreateLayoutFromXrSdk(camera, singlePassAllowed);

0 commit comments

Comments
 (0)