diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 762116c8590..875a713e44e 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -109,6 +109,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed Nans happening when the history render target is bigger than the current viewport (case 1321139). - Fixed Tube and Disc lights mode selection (case 1317776) - Fixed preview camera updating the skybox material triggering GI baking (case 1314361/1314373). +- The default LookDev volume profile is now copied and referened in the Asset folder instead of the package folder. ### Changed - Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard diff --git a/com.unity.render-pipelines.high-definition/Editor/Wizard/HDWizard.Configuration.cs b/com.unity.render-pipelines.high-definition/Editor/Wizard/HDWizard.Configuration.cs index 016d989bc4d..2fdf2e6b74e 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Wizard/HDWizard.Configuration.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Wizard/HDWizard.Configuration.cs @@ -164,6 +164,7 @@ Entry[] entries new Entry(InclusiveScope.HDRPAsset, Style.hdrpBatcher, IsSRPBatcherCorrect, FixSRPBatcher), new Entry(InclusiveScope.HDRPAsset, Style.hdrpAssetDiffusionProfile, IsHdrpAssetDiffusionProfileCorrect, FixHdrpAssetDiffusionProfile), new Entry(InclusiveScope.HDRP, Style.hdrpVolumeProfile, IsDefaultVolumeProfileAssigned, FixDefaultVolumeProfileAssigned), + new Entry(InclusiveScope.HDRP, Style.hdrpLookDevVolumeProfile, IsDefaultLookDevVolumeProfileAssigned, FixDefaultLookDevVolumeProfileAssigned), new Entry(InclusiveScope.VR, Style.vrLegacyVRSystem, IsOldVRSystemForCurrentBuildTargetGroupCorrect, FixOldVRSystemForCurrentBuildTargetGroup), new Entry(InclusiveScope.VR, Style.vrXRManagementPackage, IsVRXRManagementPackageInstalledCorrect, FixVRXRManagementPackageInstalled), @@ -477,12 +478,28 @@ void FixHdrpAssetDiffusionProfile(bool fromAsyncUnused) EditorUtility.SetDirty(hdrpAsset); } + VolumeProfile CreateDefaultVolumeProfileIfNeeded(VolumeProfile defaultSettingsVolumeProfileInPackage) + { + string defaultSettingsVolumeProfilePath = "Assets/" + HDProjectSettings.projectSettingsFolderPath + '/' + defaultSettingsVolumeProfileInPackage.name + ".asset"; + + //try load one if one already exist + VolumeProfile defaultSettingsVolumeProfile = AssetDatabase.LoadAssetAtPath(defaultSettingsVolumeProfilePath); + if (defaultSettingsVolumeProfile == null || defaultSettingsVolumeProfile.Equals(null)) + { + //else create it + AssetDatabase.CopyAsset(AssetDatabase.GetAssetPath(defaultSettingsVolumeProfileInPackage), defaultSettingsVolumeProfilePath); + defaultSettingsVolumeProfile = AssetDatabase.LoadAssetAtPath(defaultSettingsVolumeProfilePath); + } + + return defaultSettingsVolumeProfile; + } + bool IsDefaultVolumeProfileAssigned() { if (!IsHdrpAssetUsedCorrect()) return false; - var hdAsset = HDRenderPipeline.currentAsset; + var hdAsset = HDRenderPipeline.defaultAsset; return hdAsset.defaultVolumeProfile != null && !hdAsset.defaultVolumeProfile.Equals(null) && hdAsset.defaultVolumeProfile != hdAsset.renderPipelineEditorResources.defaultSettingsVolumeProfile; @@ -493,22 +510,36 @@ void FixDefaultVolumeProfileAssigned(bool fromAsyncUnused) if (!IsHdrpAssetUsedCorrect()) FixHdrpAssetUsed(fromAsync: false); - var hdrpAsset = HDRenderPipeline.currentAsset; + var hdrpAsset = HDRenderPipeline.defaultAsset; if (hdrpAsset == null) return; - VolumeProfile defaultSettingsVolumeProfileInPackage = hdrpAsset.renderPipelineEditorResources.defaultSettingsVolumeProfile; - string defaultSettingsVolumeProfilePath = "Assets/" + HDProjectSettings.projectSettingsFolderPath + '/' + defaultSettingsVolumeProfileInPackage.name + ".asset"; + hdrpAsset.defaultVolumeProfile = CreateDefaultVolumeProfileIfNeeded(hdrpAsset.renderPipelineEditorResources.defaultSettingsVolumeProfile); - //try load one if one already exist - VolumeProfile defaultSettingsVolumeProfile = AssetDatabase.LoadAssetAtPath(defaultSettingsVolumeProfilePath); - if (defaultSettingsVolumeProfile == null || defaultSettingsVolumeProfile.Equals(null)) - { - //else create it - AssetDatabase.CopyAsset(AssetDatabase.GetAssetPath(defaultSettingsVolumeProfileInPackage), defaultSettingsVolumeProfilePath); - defaultSettingsVolumeProfile = AssetDatabase.LoadAssetAtPath(defaultSettingsVolumeProfilePath); - } - hdrpAsset.defaultVolumeProfile = defaultSettingsVolumeProfile; + EditorUtility.SetDirty(hdrpAsset); + } + + bool IsDefaultLookDevVolumeProfileAssigned() + { + if (!IsHdrpAssetUsedCorrect()) + return false; + + var hdAsset = HDRenderPipeline.defaultAsset; + return hdAsset.defaultLookDevProfile != null + && !hdAsset.defaultLookDevProfile.Equals(null) + && hdAsset.defaultLookDevProfile != hdAsset.renderPipelineEditorResources.lookDev.defaultLookDevVolumeProfile; + } + + void FixDefaultLookDevVolumeProfileAssigned(bool fromAsyncUnused) + { + if (!IsHdrpAssetUsedCorrect()) + FixHdrpAssetUsed(fromAsync: false); + + var hdrpAsset = HDRenderPipeline.defaultAsset; + if (hdrpAsset == null) + return; + + hdrpAsset.defaultLookDevProfile = CreateDefaultVolumeProfileIfNeeded(hdrpAsset.renderPipelineEditorResources.lookDev.defaultLookDevVolumeProfile); EditorUtility.SetDirty(hdrpAsset); } diff --git a/com.unity.render-pipelines.high-definition/Editor/Wizard/HDWizard.Window.cs b/com.unity.render-pipelines.high-definition/Editor/Wizard/HDWizard.Window.cs index e7bc69df5b7..aef8d56171d 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Wizard/HDWizard.Window.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Wizard/HDWizard.Window.cs @@ -107,6 +107,9 @@ public ConfigStyle(string label, string error, string button = resolve, MessageT public static readonly ConfigStyle hdrpVolumeProfile = new ConfigStyle( label: "Default volume profile", error: "Default volume profile must be assigned in the HDRP asset! Also, for it to be editable, it should be outside of package."); + public static readonly ConfigStyle hdrpLookDevVolumeProfile = new ConfigStyle( + label: "Default Look Dev volume profile", + error: "Default Look Dev volume profile must be assigned in the HDRP asset! Also, for it to be editable, it should be outside of package."); public static readonly ConfigStyle vrLegacyVRSystem = new ConfigStyle( label: "Legacy VR System", diff --git a/com.unity.template-hd/Assets/HDRPDefaultResources/DefaultHDRPAsset.asset b/com.unity.template-hd/Assets/HDRPDefaultResources/DefaultHDRPAsset.asset index 5a979d11f3a..419b85d51d0 100644 --- a/com.unity.template-hd/Assets/HDRPDefaultResources/DefaultHDRPAsset.asset +++ b/com.unity.template-hd/Assets/HDRPDefaultResources/DefaultHDRPAsset.asset @@ -16,7 +16,7 @@ MonoBehaviour: m_RenderPipelineRayTracingResources: {fileID: 0} m_DefaultVolumeProfile: {fileID: 11400000, guid: 7f342610b85f4164f808a1f380dcc668, type: 2} m_LensAttenuation: 0 - m_DefaultLookDevProfile: {fileID: 11400000, guid: 254c4fe87beb7be4fa72e1681edbed02, type: 2} + m_DefaultLookDevProfile: {fileID: 11400000, guid: 254320a857a30444da2c99496a186368, type: 2} m_RenderingPathDefaultCameraFrameSettings: bitDatas: data1: 140666621263709 @@ -71,6 +71,7 @@ MonoBehaviour: m_SchemaId: m_Id: With3Levels supportVolumetrics: 1 + supportVolumetricClouds: 0 supportLightLayers: 1 lightLayerName0: Light LayerDefault lightLayerName1: InteriorOnly @@ -237,6 +238,8 @@ MonoBehaviour: AODirectionCount: 010000000200000002000000 ContactShadowSampleCount: 04000000080000000c000000 SSRMaxRaySteps: 0c0000001800000030000000 + SSGIRaySteps: 200000004000000080000000 + SSGIFilterRadius: 100000000e0000000c000000 RTAORayLength: - 0.5 - 3 diff --git a/com.unity.template-hd/Assets/HDRPDefaultResources/DefaultLookDevProfile.asset b/com.unity.template-hd/Assets/HDRPDefaultResources/DefaultLookDevProfile.asset new file mode 100644 index 00000000000..b13b332c050 --- /dev/null +++ b/com.unity.template-hd/Assets/HDRPDefaultResources/DefaultLookDevProfile.asset @@ -0,0 +1,237 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-8402669528135881980 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2f1984a7ac01bf84b86559f7595cdc68, type: 3} + m_Name: LightCluster + m_EditorClassIdentifier: + active: 1 + cameraClusterRange: + m_OverrideState: 0 + m_Value: 10 +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d7fd9488000d3734a9e00ee676215985, type: 3} + m_Name: DefaultLookDevProfile + m_EditorClassIdentifier: + components: + - {fileID: 8761387877531654226} + - {fileID: 1902828633788537306} + - {fileID: 1880163708194025631} + - {fileID: 2340290907100754200} + - {fileID: -8402669528135881980} +--- !u!114 &1880163708194025631 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9008a067f4d626c4d8bc4bc48f04bb89, type: 3} + m_Name: AmbientOcclusion + m_EditorClassIdentifier: + active: 1 + quality: + m_OverrideState: 0 + m_Value: 1 + rayTracing: + m_OverrideState: 0 + m_Value: 0 + intensity: + m_OverrideState: 1 + m_Value: 0.5 + directLightingStrength: + m_OverrideState: 0 + m_Value: 0 + radius: + m_OverrideState: 1 + m_Value: 1 + spatialBilateralAggressiveness: + m_OverrideState: 0 + m_Value: 0.15 + temporalAccumulation: + m_OverrideState: 0 + m_Value: 1 + ghostingReduction: + m_OverrideState: 0 + m_Value: 0.5 + blurSharpness: + m_OverrideState: 0 + m_Value: 0.1 + layerMask: + m_OverrideState: 0 + m_Value: + serializedVersion: 2 + m_Bits: 4294967295 + m_StepCount: + m_OverrideState: 0 + m_Value: 6 + m_FullResolution: + m_OverrideState: 0 + m_Value: 0 + m_MaximumRadiusInPixels: + m_OverrideState: 0 + m_Value: 32 + m_BilateralUpsample: + m_OverrideState: 0 + m_Value: 0 + m_DirectionCount: + m_OverrideState: 0 + m_Value: 2 + m_RayLength: + m_OverrideState: 0 + m_Value: 3 + m_SampleCount: + m_OverrideState: 0 + m_Value: 2 + m_Denoise: + m_OverrideState: 0 + m_Value: 1 + m_DenoiserRadius: + m_OverrideState: 0 + m_Value: 0.5 +--- !u!114 &1902828633788537306 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7ddcec8a8eb2d684d833ac8f5d26aebd, type: 3} + m_Name: HDShadowSettings + m_EditorClassIdentifier: + active: 1 + maxShadowDistance: + m_OverrideState: 1 + m_Value: 25 + directionalTransmissionMultiplier: + m_OverrideState: 0 + m_Value: 1 + cascadeShadowSplitCount: + m_OverrideState: 1 + m_Value: 2 + cascadeShadowSplit0: + m_OverrideState: 0 + m_Value: 0.05 + cascadeShadowSplit1: + m_OverrideState: 0 + m_Value: 0.15 + cascadeShadowSplit2: + m_OverrideState: 0 + m_Value: 0.3 + cascadeShadowBorder0: + m_OverrideState: 0 + m_Value: 0 + cascadeShadowBorder1: + m_OverrideState: 0 + m_Value: 0 + cascadeShadowBorder2: + m_OverrideState: 0 + m_Value: 0 + cascadeShadowBorder3: + m_OverrideState: 0 + m_Value: 0 +--- !u!114 &2340290907100754200 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 24f077503be6ae942a1e1245dbd53ea9, type: 3} + m_Name: Bloom + m_EditorClassIdentifier: + active: 1 + quality: + m_OverrideState: 0 + m_Value: 3 + threshold: + m_OverrideState: 0 + m_Value: 0 + intensity: + m_OverrideState: 1 + m_Value: 0.1 + scatter: + m_OverrideState: 0 + m_Value: 0.7 + tint: + m_OverrideState: 0 + m_Value: {r: 1, g: 1, b: 1, a: 1} + dirtTexture: + m_OverrideState: 0 + m_Value: {fileID: 0} + dirtIntensity: + m_OverrideState: 0 + m_Value: 0 + anamorphic: + m_OverrideState: 0 + m_Value: 1 + m_Resolution: + m_OverrideState: 0 + m_Value: 2 + m_HighQualityPrefiltering: + m_OverrideState: 0 + m_Value: 0 + m_HighQualityFiltering: + m_OverrideState: 0 + m_Value: 1 +--- !u!114 &8761387877531654226 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f086a068d4c5889438831b3ae9afc11c, type: 3} + m_Name: Tonemapping + m_EditorClassIdentifier: + active: 1 + mode: + m_OverrideState: 1 + m_Value: 1 + toeStrength: + m_OverrideState: 0 + m_Value: 0 + toeLength: + m_OverrideState: 0 + m_Value: 0.5 + shoulderStrength: + m_OverrideState: 0 + m_Value: 0 + shoulderLength: + m_OverrideState: 0 + m_Value: 0.5 + shoulderAngle: + m_OverrideState: 0 + m_Value: 0 + gamma: + m_OverrideState: 0 + m_Value: 1 + lutTexture: + m_OverrideState: 0 + m_Value: {fileID: 0} + lutContribution: + m_OverrideState: 0 + m_Value: 1 diff --git a/com.unity.template-hd/Assets/HDRPDefaultResources/DefaultLookDevProfile.asset.meta b/com.unity.template-hd/Assets/HDRPDefaultResources/DefaultLookDevProfile.asset.meta new file mode 100644 index 00000000000..14b37b54137 --- /dev/null +++ b/com.unity.template-hd/Assets/HDRPDefaultResources/DefaultLookDevProfile.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 254320a857a30444da2c99496a186368 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: