From e67ba6941b72e270d6270c3bd0839952a96b2123 Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Wed, 29 Sep 2021 11:21:58 +0200 Subject: [PATCH 1/4] direct ambient and specular occlusion don't have "bounce ligthing" --- .../Runtime/Material/MaterialEvaluation.hlsl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialEvaluation.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialEvaluation.hlsl index 02da404572b..2714f4e042f 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialEvaluation.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialEvaluation.hlsl @@ -44,9 +44,9 @@ void AccumulateIndirectLighting(IndirectLighting src, inout AggregateLighting ds struct AmbientOcclusionFactor { real3 indirectAmbientOcclusion; - real3 directAmbientOcclusion; + real directAmbientOcclusion; real3 indirectSpecularOcclusion; - real3 directSpecularOcclusion; + real directSpecularOcclusion; }; // Get screen space ambient occlusion only: @@ -105,8 +105,9 @@ void GetScreenSpaceAmbientOcclusionMultibounce(float2 positionSS, float NdotV, f aoFactor.indirectSpecularOcclusion = GTAOMultiBounce(min(specularOcclusionFromData, indirectSpecularOcclusion), fresnel0); aoFactor.indirectAmbientOcclusion = GTAOMultiBounce(min(ambientOcclusionFromData, indirectAmbientOcclusion), diffuseColor); - aoFactor.directSpecularOcclusion = GTAOMultiBounce(directSpecularOcclusion, fresnel0); - aoFactor.directAmbientOcclusion = GTAOMultiBounce(directAmbientOcclusion, diffuseColor); + // Note: when affecting direct lighting we don't used the fake bounce. + aoFactor.directSpecularOcclusion = directSpecularOcclusion; + aoFactor.directAmbientOcclusion = directAmbientOcclusion; } void ApplyAmbientOcclusionFactor(AmbientOcclusionFactor aoFactor, inout BuiltinData builtinData, inout AggregateLighting lighting) From 49b38c95714d479c801beb218a054cdaab2e136f Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Sat, 2 Oct 2021 10:33:25 +0200 Subject: [PATCH 2/4] update reference screenshots --- .../Linear/LinuxEditor/Vulkan/None/2601_SSAO_HalfRes.png | 4 ++-- .../Linear/LinuxEditor/Vulkan/None/2602_SSAO_FullRes.png | 4 ++-- .../Linear/OSXEditor/Metal/None/2601_SSAO_HalfRes.png | 4 ++-- .../Linear/OSXEditor/Metal/None/2602_SSAO_FullRes.png | 4 ++-- .../WindowsEditor/Direct3D11/None/2601_SSAO_HalfRes.png | 4 ++-- .../WindowsEditor/Direct3D11/None/2602_SSAO_FullRes.png | 4 ++-- .../WindowsEditor/Direct3D12/None/2601_SSAO_HalfRes.png | 4 ++-- .../WindowsEditor/Direct3D12/None/2602_SSAO_FullRes.png | 4 ++-- .../Linear/WindowsEditor/Vulkan/None/2601_SSAO_HalfRes.png | 4 ++-- .../Linear/WindowsEditor/Vulkan/None/2602_SSAO_FullRes.png | 4 ++-- com.unity.render-pipelines.high-definition/CHANGELOG.md | 3 ++- .../Documentation~/Upgrading-from-2021.1-to-2021.2.md | 4 +++- 12 files changed, 25 insertions(+), 22 deletions(-) diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/2601_SSAO_HalfRes.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/2601_SSAO_HalfRes.png index 1b47629eb32..325a149f8e7 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/2601_SSAO_HalfRes.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/2601_SSAO_HalfRes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c2bef3ec9102ba88d4528177c5939622ba6128ba7a9c385319a46c9c7b98a008 -size 129030 +oid sha256:a24b4140640ff01407b48788fac1125554d945b055adc501bba84cdce71486c0 +size 140150 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/2602_SSAO_FullRes.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/2602_SSAO_FullRes.png index 84043a1bc20..0061a05a919 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/2602_SSAO_FullRes.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/2602_SSAO_FullRes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3c359e2eb9ab101493d8ba99e3d7b7a00e487667c30681a9bee9a86d670d4159 -size 123513 +oid sha256:5d349b1d39e2cc5f5a37d91aa78c9a75111e88195081abfd5b8575082a6cc09e +size 129101 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/2601_SSAO_HalfRes.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/2601_SSAO_HalfRes.png index 1d7de206073..b06ddbf4bce 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/2601_SSAO_HalfRes.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/2601_SSAO_HalfRes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d547eed61395925657ef8b42ba68df9e6d839fec396509517a7ca87bb97f3079 -size 127567 +oid sha256:ba068a78864db0503ae197c271d059b8d1f8dfaab1721b6a03e22790e867401d +size 137191 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/2602_SSAO_FullRes.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/2602_SSAO_FullRes.png index 77128b247f1..6f9c337ffe0 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/2602_SSAO_FullRes.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/2602_SSAO_FullRes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1cff8dbb88c907abc104eedc9428454c69b65fc79dec88f778ef820fe0e7726a -size 119720 +oid sha256:25f2885235b70c089bdd4fe7bc2948c6f700dcfe499de5bfaeb75a5842af6d07 +size 125407 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/2601_SSAO_HalfRes.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/2601_SSAO_HalfRes.png index 1c4dda1feaa..dc111bd0ba1 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/2601_SSAO_HalfRes.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/2601_SSAO_HalfRes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4516c8f5ddc09b59da9b8c0a65f3022f1e0cbda10080c7558b733dd8f5e046eb -size 129010 +oid sha256:95751eb08ddc041d0bef148d32e565b5b6d531325e5fa37af48d48d5aa67039f +size 140032 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/2602_SSAO_FullRes.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/2602_SSAO_FullRes.png index 147e9b8c45d..74a2706c315 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/2602_SSAO_FullRes.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/2602_SSAO_FullRes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f1533fca59c0a07ca44e4f69d456102e52e18598273ee484a7dfab25e0e0776e -size 123612 +oid sha256:71fde6ae5e2adb2fa722ee5f34012cd012e474dc660e8ca832b473d41eaac841 +size 129183 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/2601_SSAO_HalfRes.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/2601_SSAO_HalfRes.png index c9bb100e9ef..dc111bd0ba1 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/2601_SSAO_HalfRes.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/2601_SSAO_HalfRes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:262d38331cec1c629a44210f664f923f71159f8ebae98d62de5e0491989eb369 -size 128945 +oid sha256:95751eb08ddc041d0bef148d32e565b5b6d531325e5fa37af48d48d5aa67039f +size 140032 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/2602_SSAO_FullRes.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/2602_SSAO_FullRes.png index 69f68ed50b9..74a2706c315 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/2602_SSAO_FullRes.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/2602_SSAO_FullRes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f2721a0d666d9634c75af8ff1cfcfacfc3f51eae5fed582269bfb2a4973faf1d -size 123933 +oid sha256:71fde6ae5e2adb2fa722ee5f34012cd012e474dc660e8ca832b473d41eaac841 +size 129183 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/2601_SSAO_HalfRes.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/2601_SSAO_HalfRes.png index 9b4e9aba2c3..8fdb393e243 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/2601_SSAO_HalfRes.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/2601_SSAO_HalfRes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:57244bf744e069318e3a9b20c02daeeb813b91b7b3420740da0d9183f77a32c5 -size 129058 +oid sha256:349163a2562153edf2ce026f2b739f1bd9f22ed855eca8171b2125f3b6f4701a +size 140132 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/2602_SSAO_FullRes.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/2602_SSAO_FullRes.png index 31bf724385f..9d59aa28c9c 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/2602_SSAO_FullRes.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/2602_SSAO_FullRes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d59d91ba64ad9b16a7cfe0f4225900e4cea582984c13f35c24d4515c17672f28 -size 123470 +oid sha256:bfae42c31be11cce69969093617064408c84078d9485e53b71415bbd1e040b87 +size 129124 diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index f3357e9cbd1..51fdfea1765 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -56,6 +56,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed the volume not being assigned on some scene templates. - Fixed corruption in player with lightmap uv when Optimize Mesh Data is enabled [1357902] - Fixed a warning to Rendering Debugger Runtime UI when debug shaders are stripped. +- Fixed minor readability issues in the ray tracing code. +- Fixed ambient occlusion strenght incorrectly using GTAOMultiBounce ### Changed - Visual Environment ambient mode is now Dynamic by default. @@ -64,7 +66,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Moved AMD FidelityFX shaders to core - Improved sampling of overlapping point/area lights in path-traced volumetric scattering (case 1358777). - Path-traced volumetric scattering now takes fog color into account, adding scattered contribution on top of the non-scattered result (cases 1346105, 1358783). -- Fixed minor readability issues in the ray tracing code. ## [12.0.0] - 2021-01-11 diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Upgrading-from-2021.1-to-2021.2.md b/com.unity.render-pipelines.high-definition/Documentation~/Upgrading-from-2021.1-to-2021.2.md index 8bd7aefeb2f..0bfa3488f92 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Upgrading-from-2021.1-to-2021.2.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Upgrading-from-2021.1-to-2021.2.md @@ -24,11 +24,13 @@ HDRP 2021.2 has various tessellation shader code to enable tessellation support * HDRP has improved support of motion vectors for tessellation. Only `previousPositionRWS` is part of the varyings. HDRP also added the `MotionVectorTessellation()` function. For more information, see the `MotionVectorVertexShaderCommon.hlsl` file. * HDRP now evaluates the `tessellationFactor` in the vertex shader and passes it to the hull shader as an interpolator. For more information, see the `VaryingMesh.hlsl` and `VertMesh.hlsl` files. -### Specular Occlusion +### Ambient Occlusion and Specular Occlusion The algorithm for computing specular occlusion from bent normals and ambient occlusion has been changed to improve visual results. To use the old algorithm, function calls to `GetSpecularOcclusionFromBentAO` should be replaced by calls to `GetSpecularOcclusionFromBentAO_ConeCone` +The algorithm to calculate the contribution of ambient occlusion and specular occlusion to direct lighting have been change from taking into account the multi-bounce contribution (GTAOMultiBounce) to not using the multi-bounce which is more correct. + ### Light list The previous `g_vLightListGlobal` uniform have been rename to explicit `g_vLightListTile` and `g_vLightListCluster` light list name. This work required to fix a wrong behavior on console. From d9eb5bc7421dafcddfedb52bffb9a45c5ae0af5d Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Sat, 2 Oct 2021 10:37:13 +0200 Subject: [PATCH 3/4] Update CHANGELOG.md --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 492e7757be8..b29536f46f5 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -71,13 +71,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed unexpectedly strong contribution from directional lights in path-traced volumetric scattering (case 1304688). - Fixed memory leak with XR combined occlusion meshes (case 1366173). - Fixed diffusion profile being reset to default on SpeedTree8 materials with subsurface scattering enabled during import. -- Fixed the volume not being assigned on some scene templates. -- Fixed corruption in player with lightmap uv when Optimize Mesh Data is enabled [1357902] -- Fixed a warning to Rendering Debugger Runtime UI when debug shaders are stripped. - Fixed support for light/shadow dimmers (volumetric or not) in path tracing. -- Fixed the volume not being assigned on some scene templates. -- Fixed corruption in player with lightmap uv when Optimize Mesh Data is enabled [1357902] -- Fixed a warning to Rendering Debugger Runtime UI when debug shaders are stripped. ### Changed - Visual Environment ambient mode is now Dynamic by default. @@ -86,6 +80,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Moved AMD FidelityFX shaders to core - Improved sampling of overlapping point/area lights in path-traced volumetric scattering (case 1358777). - Path-traced volumetric scattering now takes fog color into account, adding scattered contribution on top of the non-scattered result (cases 1346105, 1358783). +- Fixed minor readability issues in the ray tracing code. ## [12.0.0] - 2021-01-11 From fb57af0c365b2e97356b6dffec42c010c60a0c96 Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Sat, 2 Oct 2021 12:49:33 +0200 Subject: [PATCH 4/4] Update 203_LocalAmbientOcclusionNoisy.png --- .../Direct3D12/None/203_LocalAmbientOcclusionNoisy.png | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TestProjects/HDRP_DXR_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/203_LocalAmbientOcclusionNoisy.png b/TestProjects/HDRP_DXR_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/203_LocalAmbientOcclusionNoisy.png index cf05f36faa9..0d1101241d2 100644 --- a/TestProjects/HDRP_DXR_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/203_LocalAmbientOcclusionNoisy.png +++ b/TestProjects/HDRP_DXR_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/203_LocalAmbientOcclusionNoisy.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:67a7152f306af4a22ce50281d593efa8b6cbd726266f3ade39c1afd1f0124b02 -size 208153 +oid sha256:123dd32f2ac09b5063c84f97de2b6e2dd008e79d90713ef1a3febe7334281509 +size 207947