From 37036cc7e430c87abcea754663c8321eaa45dbd6 Mon Sep 17 00:00:00 2001 From: Fabien Houlmann Date: Wed, 2 Dec 2020 12:18:45 -0500 Subject: [PATCH 1/2] fix volumetric fog with XR single-pass rendering --- .../Runtime/Lighting/VolumetricLighting/VolumetricLighting.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricLighting.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricLighting.cs index 20d73addf1b..0c85a85f87b 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricLighting.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricLighting.cs @@ -289,7 +289,9 @@ static internal Vector3Int ComputeVolumetricViewportSize(HDCamera hdCamera, ref int w = Mathf.RoundToInt(viewportWidth * screenFraction); int h = Mathf.RoundToInt(viewportHeight * screenFraction); - int d = sliceCount; + + // Round to nearest multiple of viewCount so that each views have the exact same number of slices (important for XR) + int d = hdCamera.viewCount * Mathf.CeilToInt(sliceCount / hdCamera.viewCount); return new Vector3Int(w, h, d); } From e2aeb94672d4d9e0529c88e682066a5a6371520c Mon Sep 17 00:00:00 2001 From: Fabien Houlmann Date: Wed, 2 Dec 2020 12:21:37 -0500 Subject: [PATCH 2/2] update changelog --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index ac0c292a0d2..a7ebb808518 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed - Fixed probe volumes debug views. +- Fixed volumetric fog with XR single-pass rendering. ### Changed - Removed the material pass probe volumes evaluation mode.