From 08bbe7bbd5cd2e8ee686421e28e4fd963d20cc2e Mon Sep 17 00:00:00 2001 From: sebastienlagarde Date: Sat, 16 Jan 2021 12:32:51 +0100 Subject: [PATCH] [HDRP] Merge Hd/bugfix #3120 --- .../1224_Lit_Tesselation_Culling.meta | 8 + .../1224_Lit_Tesselation_Culling.unity | 345 ++++++++++++++++++ .../1224_Lit_Tesselation_Culling.unity.meta | 7 + .../TesselationPlaneMaterial.mat | 288 +++++++++++++++ .../TesselationPlaneMaterial.mat.meta | 8 + .../None/1224_Lit_Tesselation_Culling.png | 3 + .../1224_Lit_Tesselation_Culling.png.meta | 108 ++++++ .../None/1224_Lit_Tesselation_Culling.png | 3 + .../1224_Lit_Tesselation_Culling.png.meta | 108 ++++++ .../None/1224_Lit_Tesselation_Culling.png | 3 + .../1224_Lit_Tesselation_Culling.png.meta | 108 ++++++ .../None/1224_Lit_Tesselation_Culling.png | 3 + .../1224_Lit_Tesselation_Culling.png.meta | 108 ++++++ .../None/1224_Lit_Tesselation_Culling.png | 3 + .../1224_Lit_Tesselation_Culling.png.meta | 108 ++++++ .../ProjectSettings/EditorBuildSettings.asset | 3 + com.unity.render-pipelines.core/CHANGELOG.md | 3 + .../Editor/LookDev/LookDev.cs | 9 +- .../ShaderLibrary/GeometricTools.hlsl | 30 +- .../CHANGELOG.md | 14 + .../Documentation~/System-Requirements.md | 2 +- .../Compositor/CompositionLayerUI.Drawers.cs | 10 +- .../CompositionManagerEditor.Styles.cs | 3 +- .../Compositor/CompositionManagerEditor.cs | 9 +- .../Editor/Lighting/HDLightUI.cs | 9 +- .../Lighting/LightUnit/LightUnitSlider.cs | 8 +- .../Material/LayeredLit/LayeredLitGUI.cs | 54 ++- .../Material/UIBlocks/LayerListUIBlock.cs | 38 +- .../PhysicallyBasedSkyEditor.cs | 14 +- .../Editor/Wizard/HDWizard.Configuration.cs | 12 +- .../Runtime/Compositor/CompositionManager.cs | 70 +++- .../Material/Lit/LitDataMeshModification.hlsl | 6 +- .../PostProcessSystem.RenderGraph.cs | 5 +- .../PostProcessing/PostProcessSystem.cs | 9 +- .../Runtime/RenderPipeline/Camera/HDCamera.cs | 4 + .../HDRenderPipeline.RenderGraph.cs | 30 ++ .../Raytracing/HDRaytracingManager.cs | 2 +- 37 files changed, 1447 insertions(+), 108 deletions(-) create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1224_Lit_Tesselation_Culling.meta create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1224_Lit_Tesselation_Culling.unity create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1224_Lit_Tesselation_Culling.unity.meta create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1224_Lit_Tesselation_Culling/TesselationPlaneMaterial.mat create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1224_Lit_Tesselation_Culling/TesselationPlaneMaterial.mat.meta create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/1224_Lit_Tesselation_Culling.png create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/1224_Lit_Tesselation_Culling.png.meta create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1224_Lit_Tesselation_Culling.png create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1224_Lit_Tesselation_Culling.png.meta create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/1224_Lit_Tesselation_Culling.png create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/1224_Lit_Tesselation_Culling.png.meta create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/1224_Lit_Tesselation_Culling.png create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/1224_Lit_Tesselation_Culling.png.meta create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/1224_Lit_Tesselation_Culling.png create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/1224_Lit_Tesselation_Culling.png.meta diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1224_Lit_Tesselation_Culling.meta b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1224_Lit_Tesselation_Culling.meta new file mode 100644 index 00000000000..4c3b0f8c6ec --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1224_Lit_Tesselation_Culling.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3e15a4def182a184d9dafc2122db4c90 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1224_Lit_Tesselation_Culling.unity b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1224_Lit_Tesselation_Culling.unity new file mode 100644 index 00000000000..f5d60bb85fb --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1224_Lit_Tesselation_Culling.unity @@ -0,0 +1,345 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.31006354, g: 0.3258909, b: 0.36047056, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1001 &224682462 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1381370728658774, guid: e0446b620fbf66540b1b93f937834a01, type: 3} + propertyPath: m_Name + value: HDRP_Default_Sky + objectReference: {fileID: 0} + - target: {fileID: 4827451743472390, guid: e0446b620fbf66540b1b93f937834a01, type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4827451743472390, guid: e0446b620fbf66540b1b93f937834a01, type: 3} + propertyPath: m_LocalPosition.x + value: -7.5937176 + objectReference: {fileID: 0} + - target: {fileID: 4827451743472390, guid: e0446b620fbf66540b1b93f937834a01, type: 3} + propertyPath: m_LocalPosition.y + value: 8.722061 + objectReference: {fileID: 0} + - target: {fileID: 4827451743472390, guid: e0446b620fbf66540b1b93f937834a01, type: 3} + propertyPath: m_LocalPosition.z + value: -16.973507 + objectReference: {fileID: 0} + - target: {fileID: 4827451743472390, guid: e0446b620fbf66540b1b93f937834a01, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4827451743472390, guid: e0446b620fbf66540b1b93f937834a01, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4827451743472390, guid: e0446b620fbf66540b1b93f937834a01, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4827451743472390, guid: e0446b620fbf66540b1b93f937834a01, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4827451743472390, guid: e0446b620fbf66540b1b93f937834a01, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4827451743472390, guid: e0446b620fbf66540b1b93f937834a01, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4827451743472390, guid: e0446b620fbf66540b1b93f937834a01, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: e0446b620fbf66540b1b93f937834a01, type: 3} +--- !u!1 &1418940182 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1418940186} + - component: {fileID: 1418940185} + - component: {fileID: 1418940184} + - component: {fileID: 1418940183} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &1418940183 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1418940182} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &1418940184 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1418940182} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 257 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: e980b2b23fed9644f8ea87b1e2459a7b, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1418940185 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1418940182} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1418940186 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1418940182} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.86, y: 0, z: -4.57} + m_LocalScale: {x: 28.739809, y: 1, z: 29.833057} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &1795242445 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1132393308280272, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_Name + value: HDRP_Test_Camera + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalPosition.x + value: 14.25 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalPosition.y + value: 2.34 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalPosition.z + value: -16.9 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalRotation.w + value: 0.8770103 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalRotation.x + value: 0.35872343 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalRotation.y + value: -0.30594522 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalRotation.z + value: 0.09256382 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 43.302 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -40.251 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: -4.503 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: m_Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: exposureTarget + value: + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1224_Lit_Tesselation_Culling.unity.meta b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1224_Lit_Tesselation_Culling.unity.meta new file mode 100644 index 00000000000..9d27300b422 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1224_Lit_Tesselation_Culling.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e6dbeb027fe017c41839dd2fcfc728f3 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1224_Lit_Tesselation_Culling/TesselationPlaneMaterial.mat b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1224_Lit_Tesselation_Culling/TesselationPlaneMaterial.mat new file mode 100644 index 00000000000..9b498ad3b3f --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1224_Lit_Tesselation_Culling/TesselationPlaneMaterial.mat @@ -0,0 +1,288 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-3012003138654363470 +MonoBehaviour: + m_ObjectHideFlags: 11 + 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: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 11 +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: TesselationPlaneMaterial + m_Shader: {fileID: 4800000, guid: 756bac9090102564582875f4c7e30202, type: 3} + m_ShaderKeywords: _NORMALMAP_TANGENT_SPACE + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2225 + stringTagMap: {} + disabledShaderPasses: + - DistortionVectors + - MOTIONVECTORS + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AnisotropyMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseColorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BentNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BentNormalMapOS: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _CoatMaskMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortionVectorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissiveColorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _HeightMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _IridescenceMaskMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _IridescenceThicknessMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMapOS: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecularColorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SubsurfaceMaskMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TangentMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TangentMapOS: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ThicknessMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TransmittanceColorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AORemapMax: 1 + - _AORemapMin: 0 + - _ATDistance: 1 + - _AddPrecomputedVelocity: 0 + - _AlbedoAffectEmissive: 0 + - _AlphaCutoff: 0.5 + - _AlphaCutoffEnable: 0 + - _AlphaCutoffPostpass: 0.5 + - _AlphaCutoffPrepass: 0.5 + - _AlphaCutoffShadow: 0.5 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _AlphaToMask: 0 + - _AlphaToMaskInspectorValue: 0 + - _Anisotropy: 0 + - _BlendMode: 0 + - _CoatMask: 0 + - _CullMode: 2 + - _CullModeForward: 2 + - _Cutoff: 0.5 + - _DepthOffsetEnable: 0 + - _DetailAlbedoScale: 1 + - _DetailNormalScale: 1 + - _DetailSmoothnessScale: 1 + - _DiffusionProfile: 0 + - _DiffusionProfileHash: 0 + - _DisplacementLockObjectScale: 1 + - _DisplacementLockTilingScale: 1 + - _DisplacementMode: 0 + - _DistortionBlendMode: 0 + - _DistortionBlurBlendMode: 0 + - _DistortionBlurDstBlend: 1 + - _DistortionBlurRemapMax: 1 + - _DistortionBlurRemapMin: 0 + - _DistortionBlurScale: 1 + - _DistortionBlurSrcBlend: 1 + - _DistortionDepthTest: 1 + - _DistortionDstBlend: 1 + - _DistortionEnable: 0 + - _DistortionScale: 1 + - _DistortionSrcBlend: 1 + - _DistortionVectorBias: -1 + - _DistortionVectorScale: 2 + - _DoubleSidedEnable: 0 + - _DoubleSidedNormalMode: 1 + - _DstBlend: 0 + - _EmissiveColorMode: 1 + - _EmissiveExposureWeight: 1 + - _EmissiveIntensity: 1 + - _EmissiveIntensityUnit: 0 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _EnableGeometricSpecularAA: 0 + - _EnergyConservingSpecularColor: 1 + - _HeightAmplitude: 0.02 + - _HeightCenter: 0.5 + - _HeightMapParametrization: 0 + - _HeightMax: 1 + - _HeightMin: -1 + - _HeightOffset: 0 + - _HeightPoMAmplitude: 2 + - _HeightTessAmplitude: 2 + - _HeightTessCenter: 0.5 + - _InvTilingScale: 1 + - _Ior: 1.5 + - _IridescenceMask: 1 + - _IridescenceThickness: 1 + - _LinkDetailsWithBase: 1 + - _MaterialID: 1 + - _Metallic: 0 + - _MetallicRemapMax: 1 + - _MetallicRemapMin: 0 + - _NormalMapSpace: 0 + - _NormalScale: 1 + - _OpaqueCullMode: 2 + - _PPDLodThreshold: 5 + - _PPDMaxSamples: 15 + - _PPDMinSamples: 5 + - _PPDPrimitiveLength: 1 + - _PPDPrimitiveWidth: 1 + - _RayTracing: 0 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RefractionModel: 0 + - _Smoothness: 0.5 + - _SmoothnessRemapMax: 1 + - _SmoothnessRemapMin: 0 + - _SpecularAAScreenSpaceVariance: 0.1 + - _SpecularAAThreshold: 0.2 + - _SpecularOcclusionMode: 1 + - _SrcBlend: 1 + - _StencilRef: 0 + - _StencilRefDepth: 8 + - _StencilRefDistortionVec: 4 + - _StencilRefGBuffer: 10 + - _StencilRefMV: 40 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 8 + - _StencilWriteMaskDistortionVec: 4 + - _StencilWriteMaskGBuffer: 14 + - _StencilWriteMaskMV: 40 + - _SubsurfaceMask: 1 + - _SupportDecals: 1 + - _SurfaceType: 0 + - _TessellationBackFaceCullEpsilon: -0.25 + - _TessellationFactor: 4 + - _TessellationFactorMaxDistance: 50 + - _TessellationFactorMinDistance: 20 + - _TessellationFactorTriangleSize: 100 + - _TessellationMode: 0 + - _TessellationShapeFactor: 0.75 + - _TexWorldScale: 1 + - _TexWorldScaleEmissive: 1 + - _Thickness: 1 + - _ThicknessMultiplier: 1 + - _TransmissionEnable: 1 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _UVBase: 0 + - _UVDetail: 0 + - _UVEmissive: 0 + - _UseEmissiveIntensity: 0 + - _UseShadowThreshold: 0 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestGBuffer: 4 + - _ZTestModeDistortion: 4 + - _ZTestTransparent: 4 + - _ZWrite: 1 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _BaseColorMap_MipInfo: {r: 0, g: 0, b: 0, a: 0} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _DiffusionProfileAsset: {r: 0, g: 0, b: 0, a: 0} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _EmissiveColor: {r: 0, g: 0, b: 0, a: 1} + - _EmissiveColorLDR: {r: 0, g: 0, b: 0, a: 1} + - _InvPrimScale: {r: 1, g: 1, b: 0, a: 0} + - _IridescenceThicknessRemap: {r: 0, g: 1, b: 0, a: 0} + - _SpecularColor: {r: 1, g: 1, b: 1, a: 1} + - _ThicknessRemap: {r: 0, g: 1, b: 0, a: 0} + - _TransmittanceColor: {r: 1, g: 1, b: 1, a: 1} + - _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0} + - _UVMappingMask: {r: 1, g: 0, b: 0, a: 0} + - _UVMappingMaskEmissive: {r: 1, g: 0, b: 0, a: 0} + m_BuildTextureStacks: [] diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1224_Lit_Tesselation_Culling/TesselationPlaneMaterial.mat.meta b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1224_Lit_Tesselation_Culling/TesselationPlaneMaterial.mat.meta new file mode 100644 index 00000000000..8b63ddc25a4 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1224_Lit_Tesselation_Culling/TesselationPlaneMaterial.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e980b2b23fed9644f8ea87b1e2459a7b +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/1224_Lit_Tesselation_Culling.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/1224_Lit_Tesselation_Culling.png new file mode 100644 index 00000000000..3e535eb4402 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/1224_Lit_Tesselation_Culling.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ee2205b0afb3a6be0d59aaf739e4b56e063309802d4e2e412d89259d48d1312a +size 19660 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/1224_Lit_Tesselation_Culling.png.meta b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/1224_Lit_Tesselation_Culling.png.meta new file mode 100644 index 00000000000..1ee2d25580d --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/1224_Lit_Tesselation_Culling.png.meta @@ -0,0 +1,108 @@ +fileFormatVersion: 2 +guid: 28798005a1e3f20408983140563599a5 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 1 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1224_Lit_Tesselation_Culling.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1224_Lit_Tesselation_Culling.png new file mode 100644 index 00000000000..8a1899e3a13 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1224_Lit_Tesselation_Culling.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6cccca6544389077be9382ec3330fe138c614bded7f22acb8746e590ad70df5a +size 18417 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1224_Lit_Tesselation_Culling.png.meta b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1224_Lit_Tesselation_Culling.png.meta new file mode 100644 index 00000000000..1df632edc69 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1224_Lit_Tesselation_Culling.png.meta @@ -0,0 +1,108 @@ +fileFormatVersion: 2 +guid: 4c596160d92518742ad14f6ac452294d +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 1 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/1224_Lit_Tesselation_Culling.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/1224_Lit_Tesselation_Culling.png new file mode 100644 index 00000000000..6c0047806bc --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/1224_Lit_Tesselation_Culling.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:24126fabef74bf34451d9c0945454b2fdb63d9e07a886a5f3673b50175d12011 +size 19649 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/1224_Lit_Tesselation_Culling.png.meta b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/1224_Lit_Tesselation_Culling.png.meta new file mode 100644 index 00000000000..30981ad345b --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/1224_Lit_Tesselation_Culling.png.meta @@ -0,0 +1,108 @@ +fileFormatVersion: 2 +guid: 46f33bc5edf73f54f854540c9dc6f0e2 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 1 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/1224_Lit_Tesselation_Culling.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/1224_Lit_Tesselation_Culling.png new file mode 100644 index 00000000000..bd484dd3ee5 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/1224_Lit_Tesselation_Culling.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c833cf671c68cad0dcf4d70be7a605434b85415456d57b845d7ad7425c5d8676 +size 20345 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/1224_Lit_Tesselation_Culling.png.meta b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/1224_Lit_Tesselation_Culling.png.meta new file mode 100644 index 00000000000..53d4c8a5846 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/1224_Lit_Tesselation_Culling.png.meta @@ -0,0 +1,108 @@ +fileFormatVersion: 2 +guid: 9a66e269a4e2ddb4c87243ad5d9bd39b +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 1 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/1224_Lit_Tesselation_Culling.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/1224_Lit_Tesselation_Culling.png new file mode 100644 index 00000000000..3e535eb4402 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/1224_Lit_Tesselation_Culling.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ee2205b0afb3a6be0d59aaf739e4b56e063309802d4e2e412d89259d48d1312a +size 19660 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/1224_Lit_Tesselation_Culling.png.meta b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/1224_Lit_Tesselation_Culling.png.meta new file mode 100644 index 00000000000..3177c6fa4a6 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/1224_Lit_Tesselation_Culling.png.meta @@ -0,0 +1,108 @@ +fileFormatVersion: 2 +guid: 1af73e82db44222419418834ae98b87c +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 1 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/ProjectSettings/EditorBuildSettings.asset b/TestProjects/HDRP_Tests/ProjectSettings/EditorBuildSettings.asset index 599e6794aef..1cbc15c05a7 100644 --- a/TestProjects/HDRP_Tests/ProjectSettings/EditorBuildSettings.asset +++ b/TestProjects/HDRP_Tests/ProjectSettings/EditorBuildSettings.asset @@ -89,6 +89,9 @@ EditorBuildSettings: - enabled: 1 path: Assets/GraphicTests/Scenes/1x_Materials/1223_Lit_Iridescence.unity guid: b447fc323b2e7604e9404972d093fb77 + - enabled: 1 + path: Assets/GraphicTests/Scenes/1x_Materials/1224_Lit_Tesselation_Culling.unity + guid: e6dbeb027fe017c41839dd2fcfc728f3 - enabled: 1 path: Assets/GraphicTests/Scenes/1x_Materials/1301_StackLitSG.unity guid: eefb6e7ceaa685442bbf61fd2b82f9ae diff --git a/com.unity.render-pipelines.core/CHANGELOG.md b/com.unity.render-pipelines.core/CHANGELOG.md index 79f99ce27b8..5b4145ade32 100644 --- a/com.unity.render-pipelines.core/CHANGELOG.md +++ b/com.unity.render-pipelines.core/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [10.3.0] - 2020-11-16 +### Added +- New function in GeometryTools.hlsl to calculate triangle edge and full triangle culling. + ### Fixed - Fixed a bug in FreeCamera which would only provide a speed boost for the first frame when pressing the Shfit key. diff --git a/com.unity.render-pipelines.core/Editor/LookDev/LookDev.cs b/com.unity.render-pipelines.core/Editor/LookDev/LookDev.cs index 756dacb06b9..6548aa12bef 100644 --- a/com.unity.render-pipelines.core/Editor/LookDev/LookDev.cs +++ b/com.unity.render-pipelines.core/Editor/LookDev/LookDev.cs @@ -129,7 +129,10 @@ internal static void Initialize(DisplayWindow window) s_ViewDisplayer = window; s_EnvironmentDisplayer = window; open = true; - ConfigureLookDev(reloadWithTemporaryID: false); + + // Lookdev Initialize can be called when the window is re-created by the editor layout system. + // In that case, the current context won't be null and there might be objects to reload from the temp ID + ConfigureLookDev(reloadWithTemporaryID: s_CurrentContext != null); } [Callbacks.DidReloadScripts] @@ -188,10 +191,6 @@ static void LinkViewDisplayer() s_ViewDisplayer = null; //currentContext = null; - //release editorInstanceIDs - currentContext.GetViewContent(ViewIndex.First).CleanTemporaryObjectIndexes(); - currentContext.GetViewContent(ViewIndex.Second).CleanTemporaryObjectIndexes(); - SaveConfig(); open = false; diff --git a/com.unity.render-pipelines.core/ShaderLibrary/GeometricTools.hlsl b/com.unity.render-pipelines.core/ShaderLibrary/GeometricTools.hlsl index e92151aacd0..fd3730586ca 100644 --- a/com.unity.render-pipelines.core/ShaderLibrary/GeometricTools.hlsl +++ b/com.unity.render-pipelines.core/ShaderLibrary/GeometricTools.hlsl @@ -234,9 +234,12 @@ bool CullTriangleFrustum(float3 p0, float3 p1, float3 p2, float epsilon, float4 // Returns 'true' if the edge of the triangle is outside of the frustum. // The edges are defined s.t. they are on the opposite side of the point with the given index. // 'epsilon' is the (negative) distance to (outside of) the frustum below which we cull the triangle. -bool3 CullTriangleEdgesFrustum(float3 p0, float3 p1, float3 p2, float epsilon, float4 frustumPlanes[6], int numPlanes) +//output packing: +// x,y,z - one component per triangle edge, true if outside, false otherwise +// w - true if entire triangle is outside of at least 1 plane of the frustum, false otherwise +bool4 CullFullTriangleAndEdgesFrustum(float3 p0, float3 p1, float3 p2, float epsilon, float4 frustumPlanes[6], int numPlanes) { - bool3 edgesOutside = false; + bool4 edgesOutsideXYZ_triangleOutsideW = false; for (int i = 0; i < numPlanes; i++) { @@ -244,13 +247,26 @@ bool3 CullTriangleEdgesFrustum(float3 p0, float3 p1, float3 p2, float epsilon, f DistanceFromPlane(p1, frustumPlanes[i]) < epsilon, DistanceFromPlane(p2, frustumPlanes[i]) < epsilon); - // If both points of the edge are behind any of the planes, we cull. - edgesOutside.x = edgesOutside.x || (pointsOutside.y && pointsOutside.z); - edgesOutside.y = edgesOutside.y || (pointsOutside.x && pointsOutside.z); - edgesOutside.z = edgesOutside.z || (pointsOutside.x && pointsOutside.y); + bool3 edgesOutside; + // If both points of the edge are behind any of the planes, we cull. + edgesOutside.x = pointsOutside.y && pointsOutside.z; + edgesOutside.y = pointsOutside.x && pointsOutside.z; + edgesOutside.z = pointsOutside.x && pointsOutside.y; + + edgesOutsideXYZ_triangleOutsideW = edgesOutsideXYZ_triangleOutsideW || bool4(edgesOutside.xyz, all(pointsOutside)); } - return edgesOutside; + return edgesOutsideXYZ_triangleOutsideW; +} + +// Returns 'true' if the edge of the triangle is outside of the frustum. +// The edges are defined s.t. they are on the opposite side of the point with the given index. +// 'epsilon' is the (negative) distance to (outside of) the frustum below which we cull the triangle. +//output packing: +// x,y,z - one component per triangle edge, true if outside, false otherwise +bool3 CullTriangleEdgesFrustum(float3 p0, float3 p1, float3 p2, float epsilon, float4 frustumPlanes[6], int numPlanes) +{ + return CullFullTriangleAndEdgesFrustum(p0, p1, p2, epsilon, frustumPlanes, numPlanes).xyz; } bool CullTriangleBackFaceView(float3 p0, float3 p1, float3 p2, float epsilon, float3 V, float winding) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 8ebe5d72c56..758841ae7b2 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -57,6 +57,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed LayerMask editor for volume parameters. - Fixed the condition on temporal accumulation in the reflection denoiser (case 1303504). - Fixed box light attenuation. +- Fixed after post process custom pass scale issue when dynamic resolution is enabled (case 1299194). +- Fixed an issue with light intensity prefab override application not visible in the inspector (case 1299563). +- Fixed Undo/Redo instability of light temperature. +- Fixed label style in pbr sky editor. +- Fixed side effect on styles during compositor rendering. +- Fixed size and spacing of compositor info boxes (case 1305652). +- Fixed spacing of UI widgets in the Graphics Compositor (case 1305638). +- Fixed undo-redo on layered lit editor. +- Fixed tesselation culling, big triangles using lit tesselation shader would dissapear when camera is too close to them (case 1299116) +- Fixed issue with compositor related custom passes still active after disabling the compositor (case 1305330) +- Fixed regression in Wizard that not fix runtime ressource anymore (case 1287627) +- Fixed error in Depth Of Field near radius blur calculation (case 1306228). +- Fixed a reload bug when using objects from the scene in the lookdev (case 1300916). ### Changed - Now reflection probes cannot have SSAO, SSGI, SSR, ray tracing effects or volumetric reprojection. @@ -69,6 +82,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Changed the clamping approach for RTR and RTGI (in both perf and quality) to improve visual quality. - Changed the warning message for ray traced area shadows (case 1303410). - Disabled specular occlusion for what we consider medium and larger scale ao > 1.25 with a 25cm falloff interval. +- Change the source value for the ray tracing frame index iterator from m_FrameCount to the camera frame count (case 1301356). ## [10.2.1] - 2020-11-30 diff --git a/com.unity.render-pipelines.high-definition/Documentation~/System-Requirements.md b/com.unity.render-pipelines.high-definition/Documentation~/System-Requirements.md index 6add0640630..1f90455530b 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/System-Requirements.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/System-Requirements.md @@ -37,7 +37,7 @@ HRDP is only compatible with the following platforms: - MacOS (minimum version 10.13) using Metal graphics - Linux and Windows platforms with Vulkan -**Note: HDRP only works on these platforms if the device used supports Compute Shaders. HDRP does not support OpenGL or OpenGL ES devices.** +**Note: HDRP only works on these platforms if the device used supports Compute Shaders. HDRP does not support OpenGL or OpenGL ES devices. On Linux, Vulkan may not be installed by default. In that case you need to install it manually to run HDRP.** ### Ray tracing diff --git a/com.unity.render-pipelines.high-definition/Editor/Compositor/CompositionLayerUI.Drawers.cs b/com.unity.render-pipelines.high-definition/Editor/Compositor/CompositionLayerUI.Drawers.cs index b05b2cd3d38..5ba90af56ff 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Compositor/CompositionLayerUI.Drawers.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Compositor/CompositionLayerUI.Drawers.cs @@ -32,7 +32,7 @@ static partial class Styles static public readonly GUIContent k_VolumeMask = EditorGUIUtility.TrTextContent("Volume Mask", "To override the volume mask, activate the option by clicking on the check-box and then select the desired value."); static public readonly GUIContent k_AlphaRange = EditorGUIUtility.TrTextContent("Alpha Range", "The range of alpha values used when transitioning from post-processed to plain image regions. A smaller range will result in a steeper transition."); - static public readonly string k_AlphaInfoPost = "The use of AOVs properties in a player require to to enable the Runtime AOV API support in the HDRP quality settings."; + static public readonly string k_AlphaInfoPost = "The use of AOVs properties in a player requires to enable the Runtime AOV API support in the HDRP quality settings."; static public readonly string k_ShaderCompilationWarning = "The Unity Editor is compiling the AOV shaders for the first time. The output might not be correct until the compilation is over."; @@ -154,10 +154,10 @@ public static void DrawOutputLayerProperties(Rect rect, SerializedCompositionLay Rect infoRect = rect; // Compute the height of the infobox based on the width of the window and the amount of text GUIStyle.none.CalcMinMaxWidth(new GUIContent(Styles.k_ShaderCompilationWarning), out float minWidth, out float maxWidth); - float lines = Mathf.CeilToInt(maxWidth / (rect.width - Styles.infoBoxIconWidth)); + float lines = Mathf.Max(2, Mathf.CeilToInt(maxWidth / (rect.width - Styles.infoBoxIconWidth))); infoRect.height = lines * CompositorStyle.k_Spacing; EditorGUI.HelpBox(infoRect, Styles.k_ShaderCompilationWarning, MessageType.Warning); - rect.y += infoRect.height; + rect.y += infoRect.height + EditorGUIUtility.standardVerticalSpacing; } else { @@ -189,10 +189,10 @@ public static void DrawOutputLayerProperties(Rect rect, SerializedCompositionLay Rect infoRect = rect; // Compute the height of the infobox based on the width of the window and the amount of text GUIStyle.none.CalcMinMaxWidth(new GUIContent(Styles.k_AlphaInfoPost), out float minWidth, out float maxWidth); - float lines = Mathf.CeilToInt(maxWidth / (rect.width - Styles.infoBoxIconWidth)); + float lines = Mathf.Max(2, Mathf.CeilToInt(maxWidth / (rect.width - Styles.infoBoxIconWidth))); infoRect.height = lines * CompositorStyle.k_Spacing; EditorGUI.HelpBox(infoRect, Styles.k_AlphaInfoPost, MessageType.Info); - rect.y += infoRect.height; + rect.y += infoRect.height + EditorGUIUtility.standardVerticalSpacing; } } diff --git a/com.unity.render-pipelines.high-definition/Editor/Compositor/CompositionManagerEditor.Styles.cs b/com.unity.render-pipelines.high-definition/Editor/Compositor/CompositionManagerEditor.Styles.cs index fb4a5f1afa9..853abebd3f0 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Compositor/CompositionManagerEditor.Styles.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Compositor/CompositionManagerEditor.Styles.cs @@ -19,9 +19,10 @@ static internal class CompositorStyle internal static readonly int k_IconSize = 28; + internal static readonly int k_HeaderFontSize = 14; internal static readonly int k_ListItemPading = 4; internal static readonly int k_ListItemStackPading = 20; internal static readonly float k_SingleLineHeight = EditorGUIUtility.singleLineHeight; - internal static readonly float k_Spacing = k_SingleLineHeight * 1.1f; + internal static readonly float k_Spacing = k_SingleLineHeight + EditorGUIUtility.standardVerticalSpacing; } } diff --git a/com.unity.render-pipelines.high-definition/Editor/Compositor/CompositionManagerEditor.cs b/com.unity.render-pipelines.high-definition/Editor/Compositor/CompositionManagerEditor.cs index 016392ee526..b08f0bada5e 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Compositor/CompositionManagerEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Compositor/CompositionManagerEditor.cs @@ -29,6 +29,8 @@ static partial class Styles static public readonly string k_AlphaWarningPipeline = "The rendering pipeline was not configured to output an alpha channel. You can select a color buffer format that supports alpha in the HDRP quality settings."; static public readonly string k_AlphaWarningPost = "The post processing system was not configured to process the alpha channel. You can select a buffer format that supports alpha in the HDRP quality settings."; static public readonly string k_ShaderWarning = "You must specify a composition graph to see an output from the compositor."; + + static public readonly GUIStyle k_HeaderStyle = new GUIStyle(EditorStyles.helpBox) { fontSize = CompositorStyle.k_HeaderFontSize }; } ReorderableList m_layerList; @@ -121,9 +123,6 @@ public override void OnInspectorGUI() return; } - var headerStyle = EditorStyles.helpBox; - headerStyle.fontSize = 14; - // Cache the serialized property fields if (m_IsEditorDirty || m_SerializedProperties == null) { @@ -273,7 +272,7 @@ public override void OnInspectorGUI() EditorGUI.BeginChangeCheck(); EditorGUILayout.BeginVertical(); - EditorGUILayout.LabelField(Styles.k_RenderSchedule, headerStyle); + EditorGUILayout.LabelField(Styles.k_RenderSchedule, Styles.k_HeaderStyle); m_layerList.DoLayoutList(); EditorGUILayout.EndVertical(); if (EditorGUI.EndChangeCheck()) @@ -292,7 +291,7 @@ public override void OnInspectorGUI() EditorGUI.BeginChangeCheck(); if (m_layerList.index >= 0) { - EditorGUILayout.LabelField(Styles.k_Properties, headerStyle); + EditorGUILayout.LabelField(Styles.k_Properties, Styles.k_HeaderStyle); rectangle.y += EditorGUIUtility.singleLineHeight * 1.5f; rectangle.x += 5; diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs index 3d0021ecaee..174670bdb20 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.cs @@ -600,11 +600,18 @@ static void DrawLightIntensityGUILayout(SerializedHDLight serialized, Editor own Rect labelRect = lineRect; labelRect.width = EditorGUIUtility.labelWidth; + // Expand to reach both lines of the intensity field. + var interlineOffset = EditorGUIUtility.singleLineHeight + 2f; + labelRect.height += interlineOffset; + //handling of prefab overrides in a parent label GUIContent parentLabel = s_Styles.lightIntensity; - parentLabel = EditorGUI.BeginProperty(labelRect, parentLabel, serialized.intensity); parentLabel = EditorGUI.BeginProperty(labelRect, parentLabel, serialized.lightUnit); + parentLabel = EditorGUI.BeginProperty(labelRect, parentLabel, serialized.intensity); { + // Restore the original rect for actually drawing the label. + labelRect.height -= interlineOffset; + EditorGUI.LabelField(labelRect, parentLabel); } EditorGUI.EndProperty(); diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/LightUnit/LightUnitSlider.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/LightUnit/LightUnitSlider.cs index c29906ce1d6..3dceae88c5d 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/LightUnit/LightUnitSlider.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/LightUnit/LightUnitSlider.cs @@ -569,12 +569,14 @@ void SliderWithTextureNoTextField(Rect rect, ref float value, Vector2 range, Lig // Draw the exponential slider that fits 6500K to the white point on the gradient texture. var internalValue = GUI.HorizontalSlider(rect, ValueToSlider(value), 0f, 1f, SliderStyles.k_TemperatureBorder, SliderStyles.k_TemperatureThumb); - // Map the value back into kelvin. - value = SliderToValue(internalValue); - // Round to nearest since so much precision is not necessary for kelvin while sliding. if (EditorGUI.EndChangeCheck()) + { + // Map the value back into kelvin. + value = SliderToValue(internalValue); + value = Mathf.Round(value); + } } } diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/LayeredLit/LayeredLitGUI.cs b/com.unity.render-pipelines.high-definition/Editor/Material/LayeredLit/LayeredLitGUI.cs index dd31c5a05ca..fdea5b8bb45 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/LayeredLit/LayeredLitGUI.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/LayeredLit/LayeredLitGUI.cs @@ -13,6 +13,7 @@ namespace UnityEditor.Rendering.HighDefinition internal struct SerializeableGUIDs { public string[] GUIDArray; + public bool[] withUV; } /// @@ -254,37 +255,27 @@ public static void SynchronizeAllLayers(Material material) AssetImporter materialImporter = AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(material.GetInstanceID())); Material[] layers = null; + bool[] withUV = null; // Material importer can be null when the selected material doesn't exists as asset (Material saved inside the scene) if (materialImporter != null) - InitializeMaterialLayers(material, ref layers); + InitializeMaterialLayers(material, ref layers, ref withUV); // We could have no userData in the assets, so test if we have load something - if (layers != null) + if (layers != null && withUV != null) { for (int i = 0; i < layerCount; ++i) { - SynchronizeLayerProperties(material, layers, i, true); + SynchronizeLayerProperties(material, i, layers[i], withUV[i]); } } } - public static void SynchronizeAllLayersProperties(Material material, Material[] materialLayers, bool excludeUVMappingProperties) - { - int numLayer = material.GetLayerCount(); - - for (int i = 0; i < numLayer; ++i) - { - SynchronizeLayerProperties(material, materialLayers, i, excludeUVMappingProperties); - } - } - // This function will look for all referenced lit material, and assign value from Lit to layered lit layers. // This is based on the naming of the variables, i.E BaseColor will match BaseColor0, if a properties shouldn't be override // put the name in the exclusionList below - public static void SynchronizeLayerProperties(Material material, Material[] layers, int layerIndex, bool excludeUVMappingProperties) + public static void SynchronizeLayerProperties(Material material, int layerIndex, Material layerMaterial, bool includeUVMappingProperties) { - Material layerMaterial = layers[layerIndex]; string[] exclusionList = { kTexWorldScale, kUVBase, kUVMappingMask, kUVDetail, kUVDetailsMappingMask }; if (layerMaterial != null) @@ -296,7 +287,7 @@ public static void SynchronizeLayerProperties(Material material, Material[] laye string propertyName = ShaderUtil.GetPropertyName(layerShader, i); string layerPropertyName = propertyName + layerIndex; - if (!exclusionList.Contains(propertyName) || !excludeUVMappingProperties) + if (includeUVMappingProperties || !exclusionList.Contains(propertyName)) { if (material.HasProperty(layerPropertyName)) { @@ -322,7 +313,7 @@ public static void SynchronizeLayerProperties(Material material, Material[] laye case ShaderUtil.ShaderPropertyType.TexEnv: { material.SetTexture(layerPropertyName, layerMaterial.GetTexture(propertyName)); - if (!excludeUVMappingProperties) + if (includeUVMappingProperties) { material.SetTextureOffset(layerPropertyName, layerMaterial.GetTextureOffset(propertyName)); material.SetTextureScale(layerPropertyName, layerMaterial.GetTextureScale(propertyName)); @@ -338,10 +329,14 @@ public static void SynchronizeLayerProperties(Material material, Material[] laye // We use the user data to save a string that represent the referenced lit material // so we can keep reference during serialization - public static void InitializeMaterialLayers(Material material, ref Material[] layers) + public static void InitializeMaterialLayers(Material material, ref Material[] layers, ref bool[] withUV) { AssetImporter materialImporter = AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(material.GetInstanceID())); + InitializeMaterialLayers(materialImporter, ref layers, ref withUV); + } + public static void InitializeMaterialLayers(AssetImporter materialImporter, ref Material[] layers, ref bool[] withUV) + { if (materialImporter.userData != string.Empty) { SerializeableGUIDs layersGUID = JsonUtility.FromJson(materialImporter.userData); @@ -353,19 +348,40 @@ public static void InitializeMaterialLayers(Material material, ref Material[] la layers[i] = AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(layersGUID.GUIDArray[i]), typeof(Material)) as Material; } } + if (layersGUID.withUV.Length > 0) + { + withUV = new bool[layersGUID.withUV.Length]; + for (int i = 0; i < layersGUID.withUV.Length; ++i) + withUV[i] = layersGUID.withUV[i]; + } + } + else + { + if (layers != null) + { + for (int i = 0; i < layers.Length; ++i) + layers[i] = null; + } + if (withUV != null) + { + for (int i = 0; i < withUV.Length; ++i) + withUV[i] = true; + } } } - public static void SaveMaterialLayers(Material material, Material[] materialLayers) + public static void SaveMaterialLayers(Material material, Material[] materialLayers, bool[] withUV) { AssetImporter materialImporter = AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(material.GetInstanceID())); SerializeableGUIDs layersGUID; layersGUID.GUIDArray = new string[materialLayers.Length]; + layersGUID.withUV = new bool[withUV.Length]; for (int i = 0; i < materialLayers.Length; ++i) { if (materialLayers[i] != null) layersGUID.GUIDArray[i] = AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(materialLayers[i].GetInstanceID())); + layersGUID.withUV[i] = withUV[i]; } materialImporter.userData = JsonUtility.ToJson(layersGUID); diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LayerListUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LayerListUIBlock.cs index c698386f937..0ad72a5ef68 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LayerListUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LayerListUIBlock.cs @@ -32,7 +32,7 @@ public class Styles MaterialProperty layerCount = null; Expandable m_ExpandableBit; - bool[] m_WithUV; + bool[] m_WithUV = new bool[kMaxLayerCount]; Material[] m_MaterialLayers = new Material[kMaxLayerCount]; AssetImporter m_MaterialImporter; @@ -62,7 +62,6 @@ void UpdateEditorExpended(int layerNumber) public LayerListUIBlock(Expandable expandableBit) { m_ExpandableBit = expandableBit; - m_WithUV = new bool[]{ true, true, true, true }; } public override void LoadMaterialProperties() @@ -76,25 +75,7 @@ public override void LoadMaterialProperties() // Material importer can be null when the selected material doesn't exists as asset (Material saved inside the scene) if (m_MaterialImporter != null) - InitializeMaterialLayers(m_MaterialImporter, ref m_MaterialLayers); - } - - // We use the user data to save a string that represent the referenced lit material - // so we can keep reference during serialization - static void InitializeMaterialLayers(AssetImporter materialImporter, ref Material[] layers) - { - if (materialImporter.userData != string.Empty) - { - SerializeableGUIDs layersGUID = JsonUtility.FromJson(materialImporter.userData); - if (layersGUID.GUIDArray.Length > 0) - { - layers = new Material[layersGUID.GUIDArray.Length]; - for (int i = 0; i < layersGUID.GUIDArray.Length; ++i) - { - layers[i] = AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(layersGUID.GUIDArray[i]), typeof(Material)) as Material; - } - } - } + LayeredLitGUI.InitializeMaterialLayers(m_MaterialImporter, ref m_MaterialLayers, ref m_WithUV); } public override void OnGUI() @@ -140,19 +121,18 @@ void DrawLayerListGUI() { using (new EditorGUILayout.HorizontalScope()) { - EditorGUI.BeginChangeCheck(); - Rect lineRect = GUILayoutUtility.GetRect(1, EditorGUIUtility.singleLineHeight); Rect colorRect = new Rect(lineRect.x + 17f, lineRect.y + 7f, colorWidth, colorWidth); Rect materialRect = new Rect(lineRect.x + padding + colorRect.width, lineRect.y, lineRect.width - UVWidth - padding - 3 - resetButtonWidth + endOffset, lineRect.height); Rect uvRect = new Rect(lineRect.x + lineRect.width - resetButtonWidth - padding - UVWidth - endOffset, lineRect.y, UVWidth, lineRect.height); Rect resetRect = new Rect(lineRect.x + lineRect.width - resetButtonWidth - endOffset, lineRect.y, resetButtonWidth, lineRect.height); + EditorGUI.BeginChangeCheck(); m_MaterialLayers[layerIndex] = EditorGUI.ObjectField(materialRect, Styles.layerLabels[layerIndex], m_MaterialLayers[layerIndex], typeof(Material), allowSceneObjects: true) as Material; if (EditorGUI.EndChangeCheck()) { Undo.RecordObjects(new UnityEngine.Object[] { material, m_MaterialImporter }, "Change layer material"); - LayeredLitGUI.SynchronizeLayerProperties(material, m_MaterialLayers, layerIndex, true); + LayeredLitGUI.SynchronizeLayerProperties(material, layerIndex, m_MaterialLayers[layerIndex], m_WithUV[layerIndex]); layersChanged = true; // Update external reference. @@ -165,12 +145,18 @@ void DrawLayerListGUI() EditorGUI.DrawRect(colorRect, kLayerColors[layerIndex]); + EditorGUI.BeginChangeCheck(); m_WithUV[layerIndex] = EditorGUI.Toggle(uvRect, m_WithUV[layerIndex]); + if (EditorGUI.EndChangeCheck()) + { + Undo.RecordObjects(new UnityEngine.Object[] { material, m_MaterialImporter }, "Change layer material"); + layersChanged = true; + } if (GUI.Button(resetRect, GUIContent.none)) { Undo.RecordObjects(new UnityEngine.Object[] { material, m_MaterialImporter }, "Reset layer material"); - LayeredLitGUI.SynchronizeLayerProperties(material, m_MaterialLayers, layerIndex, !m_WithUV[layerIndex]); + LayeredLitGUI.SynchronizeLayerProperties(material, layerIndex, m_MaterialLayers[layerIndex], m_WithUV[layerIndex]); layersChanged = true; } @@ -199,7 +185,7 @@ void DrawLayerListGUI() // SaveAssetsProcessor the referenced material in the users data if (m_MaterialImporter != null) - LayeredLitGUI.SaveMaterialLayers(material, m_MaterialLayers); + LayeredLitGUI.SaveMaterialLayers(material, m_MaterialLayers, m_WithUV); // We should always do this call at the end materialEditor.serializedObject.ApplyModifiedProperties(); diff --git a/com.unity.render-pipelines.high-definition/Editor/Sky/PhysicallyBasedSky/PhysicallyBasedSkyEditor.cs b/com.unity.render-pipelines.high-definition/Editor/Sky/PhysicallyBasedSky/PhysicallyBasedSkyEditor.cs index 5dd28e72c96..18253bd8978 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Sky/PhysicallyBasedSky/PhysicallyBasedSkyEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Sky/PhysicallyBasedSky/PhysicallyBasedSkyEditor.cs @@ -96,7 +96,7 @@ public override void OnEnable() public override void OnInspectorGUI() { - EditorGUILayout.LabelField("Model"); + EditorGUILayout.LabelField("Model", EditorStyles.miniLabel); using (new EditorGUILayout.HorizontalScope()) { @@ -111,7 +111,7 @@ public override void OnInspectorGUI() PhysicallyBasedSkyModel type = (PhysicallyBasedSkyModel)m_Type.value.intValue; EditorGUILayout.Space(); - EditorGUILayout.LabelField("Planet"); + EditorGUILayout.LabelField("Planet", EditorStyles.miniLabel); if (type == PhysicallyBasedSkyModel.EarthSimple) PropertyField(m_SeaLevel); @@ -146,7 +146,7 @@ public override void OnInspectorGUI() if (type != PhysicallyBasedSkyModel.EarthSimple) { EditorGUILayout.Space(); - EditorGUILayout.LabelField("Space"); + EditorGUILayout.LabelField("Space", EditorStyles.miniLabel); PropertyField(m_SpaceRotation); PropertyField(m_SpaceEmissionTexture); PropertyField(m_SpaceEmissionMultiplier); @@ -155,7 +155,7 @@ public override void OnInspectorGUI() if (type == PhysicallyBasedSkyModel.Custom) { EditorGUILayout.Space(); - EditorGUILayout.LabelField("Air"); + EditorGUILayout.LabelField("Air", EditorStyles.miniLabel); PropertyField(m_AirMaximumAltitude); PropertyField(m_AirDensityR); PropertyField(m_AirDensityG); @@ -164,7 +164,7 @@ public override void OnInspectorGUI() } EditorGUILayout.Space(); - EditorGUILayout.LabelField("Aerosols"); + EditorGUILayout.LabelField("Aerosols", EditorStyles.miniLabel); PropertyField(m_AerosolDensity); PropertyField(m_AerosolTint); if (type != PhysicallyBasedSkyModel.EarthSimple) @@ -174,7 +174,7 @@ public override void OnInspectorGUI() } EditorGUILayout.Space(); - EditorGUILayout.LabelField("Artistic Overrides"); + EditorGUILayout.LabelField("Artistic Overrides", EditorStyles.miniLabel); PropertyField(m_ColorSaturation); PropertyField(m_AlphaSaturation); PropertyField(m_AlphaMultiplier); @@ -183,7 +183,7 @@ public override void OnInspectorGUI() PropertyField(m_ZenithTint); EditorGUILayout.Space(); - EditorGUILayout.LabelField("Miscellaneous"); + EditorGUILayout.LabelField("Miscellaneous", EditorStyles.miniLabel); PropertyField(m_NumberOfBounces); base.CommonSkySettingsGUI(); 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 21fe19f468c..c2abe9feb6f 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 @@ -403,15 +403,15 @@ void FixHdrpAssetRuntimeResources(bool fromAsyncUnused) if (hdrpAsset == null) return; - var editorResourcesPath = HDUtils.GetHDRenderPipelinePath() + "Editor/RenderPipelineResources/HDRenderPipelineEditorResources.asset"; - var objs = InternalEditorUtility.LoadSerializedFileAndForget(editorResourcesPath); - hdrpAsset.renderPipelineEditorResources = objs != null && objs.Length > 0 ? objs.First() as HDRenderPipelineEditorResources : null; - if (ResourceReloader.ReloadAllNullIn(HDRenderPipeline.defaultAsset.renderPipelineEditorResources, + var runtimeResourcesPath = HDUtils.GetHDRenderPipelinePath() + "Runtime/RenderPipelineResources/HDRenderPipelineResources.asset"; + var objs = InternalEditorUtility.LoadSerializedFileAndForget(runtimeResourcesPath); + hdrpAsset.renderPipelineResources = objs != null && objs.Length > 0 ? objs.First() as RenderPipelineResources : null; + if (ResourceReloader.ReloadAllNullIn(HDRenderPipeline.defaultAsset.renderPipelineResources, HDUtils.GetHDRenderPipelinePath())) { InternalEditorUtility.SaveToSerializedFileAndForget( - new UnityEngine.Object[] { HDRenderPipeline.defaultAsset.renderPipelineEditorResources }, - editorResourcesPath, + new UnityEngine.Object[] { HDRenderPipeline.defaultAsset.renderPipelineResources }, + runtimeResourcesPath, true); } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Compositor/CompositionManager.cs b/com.unity.render-pipelines.high-definition/Runtime/Compositor/CompositionManager.cs index 893239180b8..17c3cc10340 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Compositor/CompositionManager.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Compositor/CompositionManager.cs @@ -63,7 +63,7 @@ public bool enableOutput { m_OutputCamera.enabled = value; - // also change the layers + // Aside from the output compositor camera, we also have to change the cameras of the layers foreach(var layer in m_InputLayers) { if (layer.camera && layer.isUsingACameraClone) @@ -72,12 +72,22 @@ public bool enableOutput } else { - // The target texture was managed by the compositor, reset it so the user can se the camera output + // The target texture was managed by the compositor, reset it so the user can see the camera output if (layer.camera && value == false) layer.camera.targetTexture = null; } } + // Toggle the compositor-related custom passes + var hdPipeline = RenderPipelineManager.currentPipeline as HDRenderPipeline; + if (value) + { + RegisterCustomPasses(hdPipeline); + } + else + { + UnRegisterCustomPasses(hdPipeline); + } } } } @@ -188,19 +198,7 @@ bool ValidatePipeline() m_AlphaSupport = AlphaChannelSupport.Rendering; } - int indx = hdPipeline.asset.beforePostProcessCustomPostProcesses.FindIndex(x => x == typeof(ChromaKeying).AssemblyQualifiedName); - if (indx < 0) - { - //Debug.Log("Registering chroma keying pass for the HDRP pipeline"); - hdPipeline.asset.beforePostProcessCustomPostProcesses.Add(typeof(ChromaKeying).AssemblyQualifiedName); - } - - indx = hdPipeline.asset.beforePostProcessCustomPostProcesses.FindIndex(x => x == typeof(AlphaInjection).AssemblyQualifiedName); - if (indx < 0) - { - //Debug.Log("Registering alpha injection pass for the HDRP pipeline"); - hdPipeline.asset.beforePostProcessCustomPostProcesses.Add(typeof(AlphaInjection).AssemblyQualifiedName); - } + RegisterCustomPasses(hdPipeline); return true; } return false; @@ -553,6 +551,10 @@ void OnDestroy() CoreUtils.Destroy(volume); } } + + // We don't need the custom passes anymore + var hdPipeline = RenderPipelineManager.currentPipeline as HDRenderPipeline; + UnRegisterCustomPasses(hdPipeline); } public void AddInputFilterAtLayer(CompositionFilter filter, int index) @@ -923,5 +925,43 @@ static internal RenderTexture GetClearDepthForStackedCamera(HDCamera hdCamera) return null; } + // Register the custom pp passes used by the compositor + static internal void RegisterCustomPasses(HDRenderPipeline hdPipeline) + { + if (hdPipeline == null) + { + return; + } + + // If custom post processes are not registered in the HDRP asset, they are never executed so we have to add them manually + if (!hdPipeline.asset.beforePostProcessCustomPostProcesses.Contains(typeof(ChromaKeying).AssemblyQualifiedName)) + { + hdPipeline.asset.beforePostProcessCustomPostProcesses.Add(typeof(ChromaKeying).AssemblyQualifiedName); + } + + if (!hdPipeline.asset.beforePostProcessCustomPostProcesses.Contains(typeof(AlphaInjection).AssemblyQualifiedName)) + { + hdPipeline.asset.beforePostProcessCustomPostProcesses.Add(typeof(AlphaInjection).AssemblyQualifiedName); + } + } + + // Unregister the custom pp passes used by the compositor + static internal void UnRegisterCustomPasses(HDRenderPipeline hdPipeline) + { + if (hdPipeline == null) + { + return; + } + + if (hdPipeline.asset.beforePostProcessCustomPostProcesses.Contains(typeof(ChromaKeying).AssemblyQualifiedName)) + { + hdPipeline.asset.beforePostProcessCustomPostProcesses.Remove(typeof(ChromaKeying).AssemblyQualifiedName); + } + + if (hdPipeline.asset.beforePostProcessCustomPostProcesses.Contains(typeof(AlphaInjection).AssemblyQualifiedName)) + { + hdPipeline.asset.beforePostProcessCustomPostProcesses.Remove(typeof(AlphaInjection).AssemblyQualifiedName); + } + } } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDataMeshModification.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDataMeshModification.hlsl index 7ea5f75fe58..2151286da7a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDataMeshModification.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDataMeshModification.hlsl @@ -62,14 +62,14 @@ float4 GetTessellationFactors(float3 p0, float3 p1, float3 p2, float3 n0, float3 // TODO: the only reason I test the near plane here is that I am not sure that the product of other tessellation factors // (such as screen-space/distance-based) results in the tessellation factor of 1 for the geometry behind the near plane. // If that is the case (and, IMHO, it should be), we shouldn't have to test the near plane here. - bool3 frustumCullEdgesMainView = CullTriangleEdgesFrustum(p0, p1, p2, frustumEps, _FrustumPlanes, 5); // Do not test the far plane + bool4 frustumCullEdgesMainView = CullFullTriangleAndEdgesFrustum(p0, p1, p2, frustumEps, _FrustumPlanes, 5); // Do not test the far plane #else // During the scene picking pass, we have no access to camera frustum planes - bool3 frustumCullEdgesMainView = false; + bool4 frustumCullEdgesMainView = false; #endif #if defined(SHADERPASS) && (SHADERPASS != SHADERPASS_SHADOWS) - bool frustumCullCurrView = all(frustumCullEdgesMainView); + bool frustumCullCurrView = frustumCullEdgesMainView.w; #else bool frustumCullCurrView = CullTriangleFrustum(p0, p1, p2, frustumEps, _ShadowFrustumPlanes, 4); // Do not test near/far planes #endif diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.RenderGraph.cs b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.RenderGraph.cs index d84d4cc45f0..8b8b9b5c038 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.RenderGraph.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.RenderGraph.cs @@ -510,7 +510,10 @@ TextureHandle DepthOfFieldPass(RenderGraph renderGraph, HDCamera hdCamera, Textu passData.fullresCoC = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) { colorFormat = k_CoCFormat, enableRandomWrite = true, name = "Full res CoC" }); - int passCount = Mathf.CeilToInt((passData.parameters.nearMaxBlur + 2f) / 4f); + GetDoFResolutionScale(passData.parameters, out float unused, out float resolutionScale); + float actualNearMaxBlur = passData.parameters.nearMaxBlur * resolutionScale; + int passCount = Mathf.CeilToInt((actualNearMaxBlur + 2f) / 4f); + passData.dilationPingPongRT = TextureHandle.nullHandle; if (passCount > 1) { 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 b15f9021186..91b052b2a9b 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.cs @@ -2031,6 +2031,12 @@ DepthOfFieldParameters PrepareDoFParameters(HDCamera camera) return parameters; } + static void GetDoFResolutionScale(in DepthOfFieldParameters dofParameters, out float scale, out float resolutionScale) + { + scale = 1f / (float)dofParameters.resolution; + resolutionScale = (dofParameters.camera.actualHeight / 1080f) * (scale * 2f); + } + void PrepareDoFMipsTarget(float dofScale, HDCamera camera) { var mipScale = dofScale; @@ -2095,14 +2101,13 @@ static void DoDepthOfField(in DepthOfFieldParameters dofParameters, CommandBuffe float anamorphism = dofParameters.physicalCameraAnamorphism / 4f; float barrelClipping = dofParameters.physicalCameraBarrelClipping / 3f; - float scale = 1f / (float)dofParameters.resolution; + GetDoFResolutionScale(dofParameters, out float scale, out float resolutionScale); var screenScale = new Vector2(scale, scale); int targetWidth = Mathf.RoundToInt(dofParameters.camera.actualWidth * scale); int targetHeight = Mathf.RoundToInt(dofParameters.camera.actualHeight * scale); cmd.SetGlobalVector(HDShaderIDs._TargetScale, new Vector4((float)dofParameters.resolution, scale, 0f, 0f)); - float resolutionScale = (dofParameters.camera.actualHeight / 1080f) * (scale * 2f); int farSamples = dofParameters.farSampleCount; int nearSamples = dofParameters.nearSampleCount; 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 570be06733f..52291aaa22e 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 @@ -341,6 +341,8 @@ internal GameObject exposureTarget internal bool stopNaNs => m_AdditionalCameraData != null && m_AdditionalCameraData.stopNaNs; + internal bool allowDynamicResolution => m_AdditionalCameraData != null && m_AdditionalCameraData.allowDynamicResolution; + internal HDPhysicalCamera physicalParameters { get; private set; } internal IEnumerable aovRequests => @@ -1384,6 +1386,8 @@ Matrix4x4 ComputePixelCoordToWorldSpaceViewDirectionMatrix(ViewConstants viewCon void Dispose() { + HDRenderPipeline.DestroyVolumetricHistoryBuffers(this); + VolumeManager.instance.DestroyStack(volumeStack); if (m_HistoryRTSystem != null) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs index febd6c73ffe..7d79dc2bab4 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs @@ -276,6 +276,8 @@ void ExecuteWithRenderGraph(RenderRequest renderRequest, } PushFullScreenExposureDebugTexture(m_RenderGraph, postProcessDest); + ResetCameraSizeForAfterPostProcess(m_RenderGraph, hdCamera, commandBuffer); + RenderCustomPass(m_RenderGraph, hdCamera, postProcessDest, prepassOutput, customPassCullingResults, CustomPassInjectionPoint.AfterPostProcess, aovRequest, aovCustomPassBuffers); CopyXRDepth(m_RenderGraph, hdCamera, prepassOutput.resolvedDepthBuffer, backBuffer); @@ -1552,6 +1554,34 @@ bool RenderCustomPass( RenderGraph renderGraph, return executed; } + class ResetCameraSizeForAfterPostProcessPassData + { + public HDCamera hdCamera; + public ShaderVariablesGlobal shaderVariablesGlobal; + } + + void ResetCameraSizeForAfterPostProcess(RenderGraph renderGraph, HDCamera hdCamera, CommandBuffer commandBuffer) + { + if (DynamicResolutionHandler.instance.DynamicResolutionEnabled()) + { + using (var builder = renderGraph.AddRenderPass("Reset Camera Size After Post Process", out ResetCameraSizeForAfterPostProcessPassData passData)) + { + passData.hdCamera = hdCamera; + passData.shaderVariablesGlobal = m_ShaderVariablesGlobalCB; + builder.AllowPassCulling(false); + + builder.SetRenderFunc( + (ResetCameraSizeForAfterPostProcessPassData data, RenderGraphContext ctx) => + { + data.shaderVariablesGlobal._ScreenSize = new Vector4(data.hdCamera.finalViewport.width, data.hdCamera.finalViewport.height, 1.0f / data.hdCamera.finalViewport.width, 1.0f / data.hdCamera.finalViewport.height); + data.shaderVariablesGlobal._RTHandleScale = RTHandles.rtHandleProperties.rtHandleScale; + ConstantBuffer.PushGlobal(ctx.cmd, data.shaderVariablesGlobal, HDShaderIDs._ShaderVariablesGlobal); + RTHandles.SetReferenceSize((int)data.hdCamera.finalViewport.width, (int)data.hdCamera.finalViewport.height, data.hdCamera.msaaSamples); + }); + } + } + } + class BindCustomPassBuffersPassData { public Lazy customColorTexture; diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingManager.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingManager.cs index b3b8c22a538..74f40d0e0dd 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingManager.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingManager.cs @@ -580,7 +580,7 @@ internal int RayTracingFrameIndex(HDCamera hdCamera) return 0; else #endif - return hdCamera.IsTAAEnabled() ? hdCamera.taaFrameIndex : (int)m_FrameCount % 8; + return (int)hdCamera.GetCameraFrameCount() % 8; } internal int RayTracingFrameIndex(HDCamera hdCamera, int targetFrameCount = 8)