From eecc994d056c253515ea18c54b59a59fadf6a52b Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Tue, 24 Aug 2021 14:21:56 +0200 Subject: [PATCH 1/5] Cleanup only when initialized. --- .../Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.cs | 7 ++++++- .../Runtime/RenderPipeline/HDRenderPipeline.cs | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.cs b/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.cs index 7de0dd8150a..ac340cc69f3 100644 --- a/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.cs +++ b/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.cs @@ -547,7 +547,12 @@ public struct ExtraDataActionInput bool m_NeedLoadAsset = false; bool m_ProbeReferenceVolumeInit = false; - internal bool isInitialized => m_ProbeReferenceVolumeInit; + + /// + /// Returns whether the Probe Volume system has been initialized. + /// + /// Whether the Probe Volume system has been initialized. + public bool isInitialized => m_ProbeReferenceVolumeInit; struct InitInfo { diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index 61f670b78fa..046c0163f6f 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -772,7 +772,7 @@ void DisposeProbeCameraPool() #endif } - if (IsAPVEnabled()) + if (IsAPVEnabled() && ProbeReferenceVolume.instance.isInitialized) { ProbeReferenceVolume.instance.Cleanup(); } From 8ddfb67081b80f74db597b2e9ce86c77d284336c Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Tue, 24 Aug 2021 14:23:14 +0200 Subject: [PATCH 2/5] changelog --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 7949081d7d2..9c74d8a7fdf 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -373,7 +373,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed the earth curvature not being properly taken into account when evaluating the sun attenuation (case 1357927). - Reduced the volumetric clouds pattern repetition frequency (case 1358717). - Fixed the clouds missing in the ambient probe and in the static and dynamic sky. -- Fixed lens flare not rendering correctly with TAAU or DLSS +- Fixed lens flare not rendering correctly with TAAU or DLSS. +- Fixed assert failure when enabling the probe volume system for the first time. ### Changed - Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard From 678c4388cb125f8738f68f07195e70b03b014504 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Tue, 24 Aug 2021 17:12:34 +0200 Subject: [PATCH 3/5] More decimated sphere --- .../HDRenderPipelineRuntimeResources.asset | 55 ++++++------------- .../RenderPipelineResources/Mesh/Sphere.fbx | 4 +- .../Mesh/Sphere.fbx.meta | 47 ++++++++++------ 3 files changed, 49 insertions(+), 57 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipelineResources/HDRenderPipelineRuntimeResources.asset b/com.unity.render-pipelines.high-definition/Runtime/RenderPipelineResources/HDRenderPipelineRuntimeResources.asset index df1997d6698..073aba07210 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipelineResources/HDRenderPipelineRuntimeResources.asset +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipelineResources/HDRenderPipelineRuntimeResources.asset @@ -77,26 +77,16 @@ MonoBehaviour: physicallyBasedSkyPS: {fileID: 4800000, guid: a06934a4863e778498be65d8f865b7a4, type: 3} planarReflectionFilteringCS: {fileID: 7200000, guid: 9f3f8a01b8caaaa4595591dc96d43dd2, type: 3} cloudLayerPS: {fileID: 4800000, guid: 001a47fa123e95a4bba13ecb0442d944, type: 3} - bakeCloudTextureCS: {fileID: 7200000, guid: 09a7f6850ee9fb4439e5ebd632127da5, - type: 3} - bakeCloudShadowsCS: {fileID: 7200000, guid: 3e7317e0800c066448ee07a3e47f102b, - type: 3} - volumetricCloudsCS: {fileID: 7200000, guid: f911a8577fa9a4546a6b255bcf888baf, - type: 3} - volumetricCloudMapGeneratorCS: {fileID: 7200000, guid: 6b22771f0aa98744cb09f455a5a818cb, - type: 3} - volumetricCloudsCombinePS: {fileID: 4800000, guid: 12f1a69ddf916f042ae6ce8a994506f3, - type: 3} - preIntegratedFGD_GGXDisneyDiffusePS: {fileID: 4800000, guid: 123f13d52852ef547b2962de4bd9eaad, - type: 3} - preIntegratedFGD_CharlieFabricLambertPS: {fileID: 4800000, guid: 3b3bf235775cf8b4baae7f3306787ab0, - type: 3} - preIntegratedFGD_MarschnerPS: {fileID: 4800000, guid: 31f36caf0a5e7f848a1b5328b6ad3eb8, - type: 3} - preIntegratedFGD_WardPS: {fileID: 4800000, guid: d279c46a545b0af4f9f0c4fa82cd489e, - type: 3} - preIntegratedFGD_CookTorrancePS: {fileID: 4800000, guid: a6402c19b020b4a4fb7073aaa2e26aba, - type: 3} + bakeCloudTextureCS: {fileID: 7200000, guid: 09a7f6850ee9fb4439e5ebd632127da5, type: 3} + bakeCloudShadowsCS: {fileID: 7200000, guid: 3e7317e0800c066448ee07a3e47f102b, type: 3} + volumetricCloudsCS: {fileID: 7200000, guid: f911a8577fa9a4546a6b255bcf888baf, type: 3} + volumetricCloudMapGeneratorCS: {fileID: 7200000, guid: 6b22771f0aa98744cb09f455a5a818cb, type: 3} + volumetricCloudsCombinePS: {fileID: 4800000, guid: 12f1a69ddf916f042ae6ce8a994506f3, type: 3} + preIntegratedFGD_GGXDisneyDiffusePS: {fileID: 4800000, guid: 123f13d52852ef547b2962de4bd9eaad, type: 3} + preIntegratedFGD_CharlieFabricLambertPS: {fileID: 4800000, guid: 3b3bf235775cf8b4baae7f3306787ab0, type: 3} + preIntegratedFGD_MarschnerPS: {fileID: 4800000, guid: 31f36caf0a5e7f848a1b5328b6ad3eb8, type: 3} + preIntegratedFGD_WardPS: {fileID: 4800000, guid: d279c46a545b0af4f9f0c4fa82cd489e, type: 3} + preIntegratedFGD_CookTorrancePS: {fileID: 4800000, guid: a6402c19b020b4a4fb7073aaa2e26aba, type: 3} encodeBC6HCS: {fileID: 7200000, guid: aa922d239de60304f964e24488559eeb, type: 3} cubeToPanoPS: {fileID: 4800000, guid: 595434cc3b6405246b6cd3086d0b6f7d, type: 3} blitCubeTextureFacePS: {fileID: 4800000, guid: d850d0a2481878d4bbf17e5126b04163, type: 3} @@ -156,28 +146,21 @@ MonoBehaviour: clearBlackPS: {fileID: 4800000, guid: 3330c1503ea8c6d4d9408df3f64227eb, type: 3} SMAAPS: {fileID: 4800000, guid: 9655f4aa89a469c49aceaceabf9bc77b, type: 3} temporalAntialiasingPS: {fileID: 4800000, guid: 3dd9fd928fdb83743b1f27d15df22179, type: 3} - upsampleSceneCS: {fileID: 7200000, guid: 51e13c18f34ea1d4183edb912e98cbf7, type: 3} lensFlareDataDrivenPS: {fileID: 4800000, guid: 85330b3de0cfebc4ba78b2d61b1a2899, type: 3} DLSSBiasColorMaskPS: {fileID: 4800000, guid: 017a05924c0b0484ca29717ed0c60343, type: 3} dofCircleOfConfusion: {fileID: 7200000, guid: 75332b7b315c80d4babe506820aa0bfd, type: 3} dofGatherCS: {fileID: 7200000, guid: 1e6b16a7970a1494db74b1d3d007d1cc, type: 3} dofCoCMinMaxCS: {fileID: 7200000, guid: c70dd492c3d2fe94589d6ca8d4e37915, type: 3} dofMinMaxDilateCS: {fileID: 7200000, guid: 757a3f81b35177b44b2b178909b49172, type: 3} - contrastAdaptiveSharpenCS: {fileID: 7200000, guid: 560896aec2f412c48995be35551a4ac6, - type: 3} - robustContrastAdaptiveSharpenCS: {fileID: 7200000, guid: d907373e407ff65479c449a66c04443d, - type: 3} - edgeAdaptiveSpatialUpsamplingCS: {fileID: 7200000, guid: f054fa9fe2c85bb42b9489e2f9ffb643, - type: 3} - VTFeedbackDownsample: {fileID: 7200000, guid: 32d963548086c2c439aeb23a93e9a00a, - type: 3} + contrastAdaptiveSharpenCS: {fileID: 7200000, guid: 560896aec2f412c48995be35551a4ac6, type: 3} + robustContrastAdaptiveSharpenCS: {fileID: 7200000, guid: d907373e407ff65479c449a66c04443d, type: 3} + edgeAdaptiveSpatialUpsamplingCS: {fileID: 7200000, guid: f054fa9fe2c85bb42b9489e2f9ffb643, type: 3} + VTFeedbackDownsample: {fileID: 7200000, guid: 32d963548086c2c439aeb23a93e9a00a, type: 3} accumulationCS: {fileID: 7200000, guid: ed80add7a217efa468d137d6f7c668f3, type: 3} alphaInjectionPS: {fileID: 4800000, guid: 4edd96259a5e8b44c90479928f0cd11e, type: 3} chromaKeyingPS: {fileID: 4800000, guid: 49feb6b111e82ec4eb6d3d08e4b6903e, type: 3} customClearPS: {fileID: 4800000, guid: 9cef3686fa32c8840947ed99b561195c, type: 3} - ssGIDenoiserCS: {fileID: 7200000, guid: a435d803bc32d0845ba1a713b7a1c8b1, type: 3} - bilateralUpsampleCS: {fileID: 7200000, guid: 68e831c555284d741b985e05369f0e63, - type: 3} + bilateralUpsampleCS: {fileID: 7200000, guid: 68e831c555284d741b985e05369f0e63, type: 3} temporalFilterCS: {fileID: 7200000, guid: 741979ff70f7bd6489fbcb464280ecff, type: 3} diffuseDenoiserCS: {fileID: 7200000, guid: b4ed2382141619f40af1f743a84ccaea, type: 3} textures: @@ -258,10 +241,8 @@ MonoBehaviour: rankingTile8SPP: {fileID: 2800000, guid: af4bd638a4b3eb14781e6441adcdfbb9, type: 3} scramblingTile8SPP: {fileID: 2800000, guid: 152f8b933250a7b448fc2d4d301b9944, type: 3} rankingTile256SPP: {fileID: 2800000, guid: 1e604a266c415cd46b36d97cd9220aa8, type: 3} - scramblingTile256SPP: {fileID: 2800000, guid: 882fb55d7b3e7c94598a318df9376e32, - type: 3} - preintegratedAzimuthalScattering: {fileID: 2800000, guid: 4f022cc0bdd8db4428a8faae60acb3dc, - type: 3} + scramblingTile256SPP: {fileID: 2800000, guid: 882fb55d7b3e7c94598a318df9376e32, type: 3} + preintegratedAzimuthalScattering: {fileID: 2800000, guid: 4f022cc0bdd8db4428a8faae60acb3dc, type: 3} cloudLutRainAO: {fileID: 2800000, guid: e0bcfddf26ed5584ba3d8b94d3200114, type: 3} worleyNoise128RGBA: {fileID: 11700000, guid: 1fe54a721d0e2504e89f121c723404a8, type: 3} worleyNoise32RGB: {fileID: 11700000, guid: ec156c314a242914dbb706f73ad78cf2, type: 3} @@ -285,5 +266,5 @@ MonoBehaviour: defaultDiffusionProfile: {fileID: 11400000, guid: 2b7005ba3a4d8474b8cdc34141ad766e, type: 2} emissiveCylinderMesh: {fileID: 2534964839176971238, guid: accb6d90f0d50fe4ca0f68159b4323de, type: 3} emissiveQuadMesh: {fileID: 4300000, guid: 1d5a8595286f94f4bb54171d49f473c3, type: 3} - sphereMesh: {fileID: 4300000, guid: 9e0af751bc36ea146940ba245193e28c, type: 3} + sphereMesh: {fileID: 532591105809680800, guid: f7f013a81640a284ea38df61c509ff9a, type: 3} m_Version: 4 diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipelineResources/Mesh/Sphere.fbx b/com.unity.render-pipelines.high-definition/Runtime/RenderPipelineResources/Mesh/Sphere.fbx index cceb1e76926..a225668ca63 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipelineResources/Mesh/Sphere.fbx +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipelineResources/Mesh/Sphere.fbx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a68cc8459e0e19ff6ea5eba075edbd0da492df1e0ed43b5a16143986da4f9d7b -size 51632 +oid sha256:696831e63b190731502326c428323eb77bab6dd8fb9285030f6ec6467d49aab4 +size 24092 diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipelineResources/Mesh/Sphere.fbx.meta b/com.unity.render-pipelines.high-definition/Runtime/RenderPipelineResources/Mesh/Sphere.fbx.meta index fb87f7716b2..de4ec0ea6a8 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipelineResources/Mesh/Sphere.fbx.meta +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipelineResources/Mesh/Sphere.fbx.meta @@ -1,17 +1,11 @@ fileFormatVersion: 2 -guid: 9e0af751bc36ea146940ba245193e28c +guid: f7f013a81640a284ea38df61c509ff9a ModelImporter: - serializedVersion: 23 - fileIDToRecycleName: - 100000: //RootNode - 400000: //RootNode - 2100000: No Name - 2300000: //RootNode - 3300000: //RootNode - 4300000: Sphere + serializedVersion: 21202 + internalIDToNameTable: [] externalObjects: {} materials: - importMaterials: 1 + materialImportMode: 2 materialName: 0 materialSearch: 1 materialLocation: 1 @@ -20,6 +14,7 @@ ModelImporter: bakeSimulation: 0 resampleCurves: 1 optimizeGameObjects: 0 + removeConstantScaleCurves: 0 motionNodeName: rigImportErrors: rigImportWarnings: @@ -37,40 +32,53 @@ ModelImporter: extraExposedTransformPaths: [] extraUserProperties: [] clipAnimations: [] - isReadable: 1 + isReadable: 0 meshes: lODScreenPercentages: [] globalScale: 1 meshCompression: 0 addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 importVisibility: 1 importBlendShapes: 1 importCameras: 1 importLights: 1 + nodeNameCollisionStrategy: 1 + fileIdsGeneration: 2 swapUVChannels: 0 generateSecondaryUV: 0 useFileUnits: 1 - optimizeMeshForGPU: 1 keepQuads: 0 weldVertices: 1 + bakeAxisConversion: 0 preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + optimizeBones: 0 + meshOptimizationFlags: -1 indexFormat: 0 secondaryUVAngleDistortion: 8 secondaryUVAreaDistortion: 15.000001 secondaryUVHardAngle: 88 + secondaryUVMarginMethod: 1 + secondaryUVMinLightmapResolution: 40 + secondaryUVMinObjectScale: 1 secondaryUVPackMargin: 4 useFileScale: 1 - previousCalculatedGlobalScale: 1 - hasPreviousCalculatedGlobalScale: 0 tangentSpace: normalSmoothAngle: 60 normalImportMode: 0 tangentImportMode: 3 normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] importAnimation: 1 - copyAvatar: 0 humanDescription: - serializedVersion: 2 + serializedVersion: 3 human: [] skeleton: [] armTwist: 0.5 @@ -80,14 +88,17 @@ ModelImporter: armStretch: 0.05 legStretch: 0.05 feetSpacing: 0 + globalScale: 1 rootMotionBoneName: - rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} hasTranslationDoF: 0 hasExtraRoot: 0 skeletonHasParents: 1 lastHumanDescriptionAvatarSource: {instanceID: 0} - animationType: 0 + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 2 humanoidOversampling: 1 + avatarSetup: 0 + addHumanoidExtraRootOnlyWhenUsingAvatar: 1 additionalBone: 0 userData: assetBundleName: From 78abe69a03a55342a94de79d36ba27670ad4ce1c Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Tue, 24 Aug 2021 17:40:14 +0200 Subject: [PATCH 4/5] 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 9c74d8a7fdf..2e1d941779a 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -375,6 +375,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed the clouds missing in the ambient probe and in the static and dynamic sky. - Fixed lens flare not rendering correctly with TAAU or DLSS. - Fixed assert failure when enabling the probe volume system for the first time. +- Significantly improved performance of APV probe debug. ### Changed - Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard From 23eb96b409b82c8fa8c87a9e13cda1301fc6c8d9 Mon Sep 17 00:00:00 2001 From: FrancescoC-Unity Date: Mon, 30 Aug 2021 14:13:34 +0200 Subject: [PATCH 5/5] Move init check inside --- .../Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.cs | 8 +++----- .../Runtime/RenderPipeline/HDRenderPipeline.cs | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.cs b/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.cs index ac340cc69f3..756af4b316c 100644 --- a/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.cs +++ b/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.cs @@ -548,11 +548,7 @@ public struct ExtraDataActionInput bool m_NeedLoadAsset = false; bool m_ProbeReferenceVolumeInit = false; - /// - /// Returns whether the Probe Volume system has been initialized. - /// - /// Whether the Probe Volume system has been initialized. - public bool isInitialized => m_ProbeReferenceVolumeInit; + internal bool isInitialized => m_ProbeReferenceVolumeInit; struct InitInfo { @@ -640,6 +636,8 @@ public void Initialize(in ProbeVolumeSystemParameters parameters) /// public void Cleanup() { + if (!m_ProbeReferenceVolumeInit) return; + if (!m_IsInitialized) { Debug.LogError("Probe Volume System has not been initialized first before calling cleanup."); diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index 046c0163f6f..61f670b78fa 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -772,7 +772,7 @@ void DisposeProbeCameraPool() #endif } - if (IsAPVEnabled() && ProbeReferenceVolume.instance.isInitialized) + if (IsAPVEnabled()) { ProbeReferenceVolume.instance.Cleanup(); }