diff --git a/TestProjects/HDRP_DXR_Tests/Packages/manifest.json b/TestProjects/HDRP_DXR_Tests/Packages/manifest.json index 8439c77f45a..88bef3f617a 100644 --- a/TestProjects/HDRP_DXR_Tests/Packages/manifest.json +++ b/TestProjects/HDRP_DXR_Tests/Packages/manifest.json @@ -2,25 +2,25 @@ "dependencies": { "com.unity.2d.sprite": "1.0.0", "com.unity.2d.tilemap": "1.0.0", - "com.unity.ads": "3.3.1", + "com.unity.ads": "3.4.4", "com.unity.analytics": "3.3.5", - "com.unity.collab-proxy": "1.3.5", "com.unity.ide.rider": "1.2.1", "com.unity.ide.visualstudio": "2.0.0", "com.unity.ide.vscode": "1.1.4", + "com.unity.multiplayer-hlapi": "1.0.4", "com.unity.purchasing": "2.0.6", "com.unity.render-pipelines.core": "file:../../../com.unity.render-pipelines.core", "com.unity.render-pipelines.high-definition": "file:../../../com.unity.render-pipelines.high-definition", "com.unity.render-pipelines.high-definition-config": "file:../LocalPackages/com.unity.render-pipelines.high-definition-config", "com.unity.shadergraph": "file:../../../com.unity.shadergraph", - "com.unity.test-framework": "1.1.9", + "com.unity.test-framework": "1.1.13", "com.unity.testframework.graphics": "7.2.1-preview", "com.unity.testing.hdrp": "file:../../../com.unity.testing.hdrp", "com.unity.textmeshpro": "3.0.0-preview.1", "com.unity.timeline": "1.2.6", "com.unity.ugui": "1.0.0", "com.unity.visualeffectgraph": "file:../../../com.unity.visualeffectgraph", - "com.unity.xr.legacyinputhelpers": "1.3.7", + "com.unity.xr.legacyinputhelpers": "1.3.11", "com.unity.modules.ai": "1.0.0", "com.unity.modules.androidjni": "1.0.0", "com.unity.modules.animation": "1.0.0", diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/1710_Decals_Normal_Patch.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/1710_Decals_Normal_Patch.png index 3160433f359..4fb0aaa0453 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/1710_Decals_Normal_Patch.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/1710_Decals_Normal_Patch.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c70bf0b1d29454fd2ae35267909ea4aea9aed834361bf6e22b333743b49c88ce -size 64825 +oid sha256:6ffc533da9518f67d6bd96507273b32ce2ecfda4ae7395ebbb61be259d0fe1d6 +size 63642 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/2316_ShadowTint.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/2316_ShadowTint.png index 719eab3a10a..13666faf757 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/2316_ShadowTint.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/2316_ShadowTint.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:556bc8905ef1f0f78382707adf52761e3d0a2a1b4e04185f255fdb8e7c72a7b4 -size 132133 +oid sha256:3a6cc6c9e5ceeb4eab1a884369ec892e1461a420f5f8b927539445b1d7df6526 +size 132020 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 8c455613a93..696532baa26 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:7b18128f7c2f299245d29b1b281df8cf638a1140c81301041a267892de271be3 -size 133832 +oid sha256:f50c0856d3250f8cef177c562bf45278e8138336f623f1ba1e3638d8b90f2d97 +size 138385 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 ba2e24790f9..4d1d4d33411 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:2bd1a14cd17243c2da3e2021eaabba11792e40afe1f7fdaa7009e302e64c3686 -size 154493 +oid sha256:201a9d7e8c98df01d55770a3e4e2ba3b697770923841da173a206677ca52d059 +size 161780 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4052_TAA.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4052_TAA.png index 29015fff8e2..50255388db6 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4052_TAA.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4052_TAA.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e293a01b72ac593c538be1e0d6db9fcf095f9447c297a1123d27373e3d57445d -size 183316 +oid sha256:407996856886cd24a508b6d9577aeb9b2e6af9cec8564778702b32c3cf6e3812 +size 184101 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4053_TAA-FP16Alpha.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4053_TAA-FP16Alpha.png index c26c649282f..74478ca59e7 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4053_TAA-FP16Alpha.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4053_TAA-FP16Alpha.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:35bfaabe20c17251cff955c89334d02eeca38087670aa474b40536d1ff1dfd3c -size 191253 +oid sha256:b1317b044ef80780ceeadde45548f4f266c403f0f2e6477454bf28933f1c7e22 +size 192501 diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 0c577390afb..295be2e6fcd 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -88,6 +88,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed error when undo a Reflection Probe removal in a prefab instance. (case 1244047) - Fixed various multi-editing issues when changing Emission parameters. - Fixed issue that prevented cubemap thumbnails from rendering (only on D3D11 and Metal). +- Fixed Microshadow not working correctly in deferred with LightLayers +- Tentative fix for missing include in depth of field shaders. +- Fix an issue in reading the gbuffer for ray traced subsurface scattering (case 1248358). ### Changed - Rejecting history for ray traced reflections based on a threshold evaluated on the neighborhood of the sampled history. diff --git a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/ExposureEditor.cs b/com.unity.render-pipelines.high-definition/Editor/PostProcessing/ExposureEditor.cs index 783223d4d49..9e6ba5a09fe 100644 --- a/com.unity.render-pipelines.high-definition/Editor/PostProcessing/ExposureEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/PostProcessing/ExposureEditor.cs @@ -51,7 +51,6 @@ public override void OnInspectorGUI() else if (mode == (int)ExposureMode.Fixed) { PropertyField(m_FixedExposure); - PropertyField(m_Compensation); } else { diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl index 64ad119c8fd..e92762b9224 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl @@ -195,11 +195,8 @@ float GetAmbientOcclusionForMicroShadowing(BSDFData bsdfData) { float sourceAO; #if (SHADERPASS == SHADERPASS_DEFERRED_LIGHTING) - // Note: In deferred pass we don't have space in GBuffer to store ambientOcclusion unless LIGHT_LAYERS is enabled - // so we use specularOcclusion instead - // The define LIGHT_LAYERS only exist for the GBuffer and the Forward pass. To avoid to add another - // variant to deferred.compute, we use dynamic branching instead with _EnableLightLayers. - sourceAO = _EnableLightLayers ? bsdfData.ambientOcclusion : bsdfData.specularOcclusion; + // Note: In deferred pass we don't have space in GBuffer to store ambientOcclusion so we use specularOcclusion instead + sourceAO = bsdfData.specularOcclusion; #else sourceAO = bsdfData.ambientOcclusion; #endif diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubsurfaceScatteringManager.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubsurfaceScatteringManager.cs index 08419191dcb..114ccae3f06 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubsurfaceScatteringManager.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubsurfaceScatteringManager.cs @@ -350,10 +350,6 @@ void RenderSubsurfaceScattering(HDCamera hdCamera, CommandBuffer cmd, RTHandle c // Bind the textures for ray generation cmd.SetRayTracingTextureParam(subSurfaceShader, HDShaderIDs._DepthTexture, sharedRTManager.GetDepthStencilBuffer()); cmd.SetRayTracingTextureParam(subSurfaceShader, HDShaderIDs._NormalBufferTexture, sharedRTManager.GetNormalBuffer()); - cmd.SetRayTracingTextureParam(subSurfaceShader, HDShaderIDs._GBufferTexture[0], m_GbufferManager.GetBuffer(0)); - cmd.SetRayTracingTextureParam(subSurfaceShader, HDShaderIDs._GBufferTexture[1], m_GbufferManager.GetBuffer(1)); - cmd.SetRayTracingTextureParam(subSurfaceShader, HDShaderIDs._GBufferTexture[2], m_GbufferManager.GetBuffer(2)); - cmd.SetRayTracingTextureParam(subSurfaceShader, HDShaderIDs._GBufferTexture[3], m_GbufferManager.GetBuffer(3)); cmd.SetRayTracingTextureParam(subSurfaceShader, HDShaderIDs._SSSBufferTexture, m_SSSColor); cmd.SetGlobalTexture(HDShaderIDs._StencilTexture, sharedRTManager.GetDepthStencilBuffer(), RenderTextureSubElement.Stencil); diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.cs b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.cs index 4f5aeca5a90..fd8ec95a9e6 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.cs @@ -809,7 +809,8 @@ void DoFixedExposure(CommandBuffer cmd, HDCamera camera) if (m_Exposure.mode.value == ExposureMode.Fixed) { kernel = cs.FindKernel("KFixedExposure"); - cmd.SetComputeVectorParam(cs, HDShaderIDs._ExposureParams, new Vector4(m_Exposure.compensation.value + m_DebugExposureCompensation, m_Exposure.fixedExposure.value, 0f, 0f)); + // Don't apply exposure compensation on fixed exposure in 7.4.0 to not break existing users project + cmd.SetComputeVectorParam(cs, HDShaderIDs._ExposureParams, new Vector4(0f /* m_Exposure.compensation.value + m_DebugExposureCompensation */, m_Exposure.fixedExposure.value, 0f, 0f)); } else if (m_Exposure.mode == ExposureMode.UsePhysicalCamera) { diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldGather.compute b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldGather.compute index 6ddc24e0c0d..732ee482b01 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldGather.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldGather.compute @@ -1,6 +1,6 @@ #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" -#include "DepthOfFieldCommon.hlsl" +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldCommon.hlsl" #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldTileMax.compute b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldTileMax.compute index 9174ec0f47c..8d8d36e9c3a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldTileMax.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldTileMax.compute @@ -1,6 +1,6 @@ #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" -#include "DepthOfFieldCommon.hlsl" +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldCommon.hlsl" #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs index 799fb4659b9..bbe8a97a2ea 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs @@ -472,6 +472,10 @@ internal void Update(FrameSettings currentFrameSettings, HDRenderPipeline hdrp, screenSize = new Vector4(screenWidth, screenHeight, 1.0f / screenWidth, 1.0f / screenHeight); screenParams = new Vector4(screenSize.x, screenSize.y, 1 + screenSize.z, 1 + screenSize.w); + const int kMaxSampleCount = 8; + if (++taaFrameIndex >= kMaxSampleCount) + taaFrameIndex = 0; + UpdateAllViewConstants(); isFirstFrame = false; cameraFrameCount++; @@ -889,6 +893,8 @@ void UpdateAllViewConstants() if (m_XRViewConstants == null || m_XRViewConstants.Length != viewCount) { m_XRViewConstants = new ViewConstants[viewCount]; + resetPostProcessingHistory = true; + isFirstFrame = true; } UpdateAllViewConstants(IsTAAEnabled(), true); @@ -1138,10 +1144,6 @@ Matrix4x4 GetJitteredProjectionMatrix(Matrix4x4 origProj) float jitterY = HaltonSequence.Get((taaFrameIndex & 1023) + 1, 3) - 0.5f; taaJitter = new Vector4(jitterX, jitterY, jitterX / actualWidth, jitterY / actualHeight); - const int kMaxSampleCount = 8; - if (++taaFrameIndex >= kMaxSampleCount) - taaFrameIndex = 0; - Matrix4x4 proj; if (camera.orthographic) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/RayTracingSubSurface.raytrace b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/RayTracingSubSurface.raytrace index faffd8f5997..85762c9926e 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/RayTracingSubSurface.raytrace +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/RayTracingSubSurface.raytrace @@ -66,13 +66,9 @@ void RayGenSubSurface() PositionInputs posInput = GetPositionInput(currentPixelCoord, 1.0/LaunchDim.xy, depthValue, UNITY_MATRIX_I_VP, GetWorldToViewMatrix(), 0); posInput.positionWS = GetAbsolutePositionWS(posInput.positionWS); - // Read the bsdf data and builtin data from the gbuffer - BSDFData bsdfData; - ZERO_INITIALIZE(BSDFData, bsdfData); - BuiltinData builtinData; - ZERO_INITIALIZE(BuiltinData, builtinData); - uint featureFlags = MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; - DecodeFromGBuffer(currentPixelCoord, featureFlags, bsdfData, builtinData); + // Read the normal data + NormalData normalData; + DecodeFromNormalBuffer(currentPixelCoord, normalData); // Read the SSS Data SSSData sssData; @@ -88,7 +84,7 @@ void RayGenSubSurface() // Do our walk ScatteringResult scatteringResult; - ScatteringWalk(bsdfData.normalWS, bsdfData.diffuseColor, scatteringDistance, currentPixelCoord, globalSampleIndex, posInput.positionWS, scatteringResult); + ScatteringWalk(normalData.normalWS, sssData.diffuseColor, scatteringDistance, currentPixelCoord, globalSampleIndex, posInput.positionWS, scatteringResult); // Normalize the throughput scatteringResult.outputThroughput /= (float)_RaytracingNumSamples; diff --git a/com.unity.testing.hdrp/TestRunner/HDRP_GraphicTestRunner.cs b/com.unity.testing.hdrp/TestRunner/HDRP_GraphicTestRunner.cs index 0b0113342ac..e6e73a3fe40 100644 --- a/com.unity.testing.hdrp/TestRunner/HDRP_GraphicTestRunner.cs +++ b/com.unity.testing.hdrp/TestRunner/HDRP_GraphicTestRunner.cs @@ -58,6 +58,9 @@ public IEnumerator Run(GraphicsTestCase testCase) yield return null; } + // Reset temporal effects on hdCamera + HDCamera.GetOrCreate(camera).Reset(); + for (int i=0 ; i