From 410a1d2746b75fafdad000990df252869f6bcce4 Mon Sep 17 00:00:00 2001 From: Anis Date: Tue, 13 Oct 2020 12:39:53 +0200 Subject: [PATCH 01/10] Added a rough distortion frame setting and and info box on distortion materials. Proper support for the migration process Chaging the default value for rough distortion frame setting SSR now uses the pre-refraction color pyramid. --- .../1101_Unlit_Smooth_Distortion.meta | 8 + .../1101_Unlit_Smooth_Distortion.unity | 509 ++++++++++++++++++ .../1101_Unlit_Smooth_Distortion.unity.meta | 9 + .../Global Volume Profile.asset | 15 + .../Global Volume Profile.asset.meta | 8 + .../M_Distortion.mat | 272 ++++++++++ .../M_Distortion.mat.meta | 8 + .../1101_Unlit_Smooth_Distortion/M_Plane.mat | 267 +++++++++ .../M_Plane.mat.meta | 8 + ...1_Unlit_Smooth_DistortionSettings.lighting | 63 +++ ...it_Smooth_DistortionSettings.lighting.meta | 8 + .../None/1101_Unlit_Smooth_Distortion.png | 3 + .../1101_Unlit_Smooth_Distortion.png.meta | 108 ++++ .../ProjectSettings/EditorBuildSettings.asset | 3 + .../CHANGELOG.md | 2 + .../Material/UIBlocks/DistortionUIBlock.cs | 2 + .../HDRenderPipeline.RenderGraph.cs | 49 +- .../RenderPipeline/HDRenderPipeline.cs | 37 +- .../HDRenderPipelineAsset.Migration.cs | 9 +- .../Distortion/ApplyDistortion.shader | 10 +- .../Settings/FrameSettings.Migration.cs | 5 + .../RenderPipeline/Settings/FrameSettings.cs | 9 +- 22 files changed, 1378 insertions(+), 34 deletions(-) create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion.meta create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion.unity create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion.unity.meta create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion/Global Volume Profile.asset create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion/Global Volume Profile.asset.meta create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion/M_Distortion.mat create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion/M_Distortion.mat.meta create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion/M_Plane.mat create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion/M_Plane.mat.meta create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_DistortionSettings.lighting create mode 100644 TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_DistortionSettings.lighting.meta create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/1101_Unlit_Smooth_Distortion.png create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/1101_Unlit_Smooth_Distortion.png.meta diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion.meta b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion.meta new file mode 100644 index 00000000000..4df60f21380 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7a7aa901198cd17488fec8e0ae73425f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion.unity b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion.unity new file mode 100644 index 00000000000..aeec00dd41e --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion.unity @@ -0,0 +1,509 @@ +%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.31014395, g: 0.32596427, b: 0.36057457, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + 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: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 0 + 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: 4890085278179872738, guid: 8483688f996b46249976479af6c20f90, + type: 2} +--- !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!1 &75602620 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 75602624} + - component: {fileID: 75602623} + - component: {fileID: 75602622} + - component: {fileID: 75602621} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &75602621 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 75602620} + 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 &75602622 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 75602620} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + 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: e10994a990a6a044cb7e608fed341b71, 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 &75602623 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 75602620} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &75602624 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 75602620} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1.06, z: -1.76} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &749245062 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalPosition.x + value: 0.049918726 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalPosition.y + value: 1.8820345 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalPosition.z + value: -3.4468884 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalRotation.x + value: 0.27280915 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalRotation.w + value: 0.9620682 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 31.663 + objectReference: {fileID: 0} + - target: {fileID: 4209882255362944, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 20109210616973140, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: m_ClearFlags + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 20109210616973140, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: m_BackGroundColor.r + value: 0.4705882 + objectReference: {fileID: 0} + - target: {fileID: 20109210616973140, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: m_BackGroundColor.g + value: 0.4705882 + objectReference: {fileID: 0} + - target: {fileID: 20109210616973140, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: m_BackGroundColor.b + value: 0.4705882 + objectReference: {fileID: 0} + - target: {fileID: 20109210616973140, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: far clip plane + value: 30 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: customRenderingSettings + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: renderingPathCustomFrameSettingsOverrideMask.mask.data2 + value: 8 + objectReference: {fileID: 0} + - target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: m_RenderingPathCustomFrameSettings.bitDatas.data2 + value: 4539628424389459968 + objectReference: {fileID: 0} + - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: ImageComparisonSettings.TargetWidth + value: 1920 + objectReference: {fileID: 0} + - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: ImageComparisonSettings.TargetHeight + value: 1080 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} +--- !u!1 &1263046121 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1263046123} + - component: {fileID: 1263046122} + m_Layer: 0 + m_Name: Global Volume + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1263046122 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1263046121} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3} + m_Name: + m_EditorClassIdentifier: + isGlobal: 1 + priority: 0 + blendDistance: 0 + weight: 1 + sharedProfile: {fileID: 11400000, guid: 8e73ed7097ec54c4c9825150e7bc0528, type: 2} +--- !u!4 &1263046123 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1263046121} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -1.3492156, y: 0.09702644, z: 13.447937} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1713358249 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1713358253} + - component: {fileID: 1713358252} + - component: {fileID: 1713358251} + - component: {fileID: 1713358250} + m_Layer: 0 + m_Name: Plane + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!64 &1713358250 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1713358249} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1713358251 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1713358249} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + 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: 2a93f2b8f03202247aa30728a63f0146, 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 &1713358252 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1713358249} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1713358253 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1713358249} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &2100869524 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1381370728658774, guid: e0446b620fbf66540b1b93f937834a01, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4827451743472390, guid: e0446b620fbf66540b1b93f937834a01, type: 3} + propertyPath: m_LocalPosition.x + value: -4.945982 + objectReference: {fileID: 0} + - target: {fileID: 4827451743472390, guid: e0446b620fbf66540b1b93f937834a01, type: 3} + propertyPath: m_LocalPosition.y + value: 3.5591245 + objectReference: {fileID: 0} + - target: {fileID: 4827451743472390, guid: e0446b620fbf66540b1b93f937834a01, type: 3} + propertyPath: m_LocalPosition.z + value: -6.423647 + 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_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4827451743472390, guid: e0446b620fbf66540b1b93f937834a01, type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: e0446b620fbf66540b1b93f937834a01, type: 3} diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion.unity.meta b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion.unity.meta new file mode 100644 index 00000000000..741e7dbfd08 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion.unity.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 50b2c92f5c04d254aa8df03d007f00a9 +timeCreated: 1508424011 +licenseType: Pro +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion/Global Volume Profile.asset b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion/Global Volume Profile.asset new file mode 100644 index 00000000000..5811643ae9f --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion/Global Volume Profile.asset @@ -0,0 +1,15 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !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: Global Volume Profile + m_EditorClassIdentifier: + components: [] diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion/Global Volume Profile.asset.meta b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion/Global Volume Profile.asset.meta new file mode 100644 index 00000000000..9387c351251 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion/Global Volume Profile.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8e73ed7097ec54c4c9825150e7bc0528 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion/M_Distortion.mat b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion/M_Distortion.mat new file mode 100644 index 00000000000..c4220165498 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion/M_Distortion.mat @@ -0,0 +1,272 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-2090987444760498821 +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: 9 +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: M_Distortion + m_Shader: {fileID: 4800000, guid: c4edd00ff2db5b24391a4fcb1762e459, type: 3} + m_ShaderKeywords: _BLENDMODE_ALPHA _DISABLE_SSR_TRANSPARENT _ENABLE_FOG_ON_TRANSPARENT + _NORMALMAP_TANGENT_SPACE _SURFACE_TYPE_TRANSPARENT + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent + disabledShaderPasses: + - MOTIONVECTORS + 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: 2800000, guid: a184dfba0fc61b1429443ebb75783b8a, type: 3} + 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} + - _UnlitColorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + 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: 10 + - _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: 1 + - _DistortionOnly: 0 + - _DistortionScale: 100 + - _DistortionSrcBlend: 1 + - _DistortionVectorBias: -1 + - _DistortionVectorScale: 5 + - _DoubleSidedEnable: 0 + - _DoubleSidedNormalMode: 1 + - _DstBlend: 10 + - _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 + - _IncludeIndirectLighting: 1 + - _InvTilingScale: 1 + - _Ior: 1.5 + - _IridescenceMask: 1 + - _IridescenceThickness: 1 + - _LinkDetailsWithBase: 1 + - _MaterialID: 1 + - _Metallic: 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 + - _SSRefractionProjectionModel: 0 + - _Smoothness: 0.5 + - _SmoothnessRemapMax: 1 + - _SmoothnessRemapMin: 0 + - _SpecularAAScreenSpaceVariance: 0.1 + - _SpecularAAThreshold: 0.2 + - _SpecularOcclusionMode: 1 + - _SrcBlend: 1 + - _StencilRef: 0 + - _StencilRefDepth: 0 + - _StencilRefDistortionVec: 4 + - _StencilRefGBuffer: 10 + - _StencilRefMV: 32 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 8 + - _StencilWriteMaskDistortionVec: 4 + - _StencilWriteMaskGBuffer: 14 + - _StencilWriteMaskMV: 40 + - _SubsurfaceMask: 1 + - _SupportDecals: 1 + - _SurfaceType: 1 + - _TexWorldScale: 1 + - _TexWorldScaleEmissive: 1 + - _Thickness: 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: 4 + - _ZTestGBuffer: 4 + - _ZTestModeDistortion: 4 + - _ZTestTransparent: 4 + - _ZWrite: 0 + m_Colors: + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _BaseColorMap_MipInfo: {r: 0, g: 0, b: 0, a: 0} + - _Color: {r: 0, g: 0, b: 0, 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} + - _UnlitColor: {r: 1, g: 1, b: 1, a: 0.12156863} + - _UnlitColorMap_MipInfo: {r: 0, g: 0, b: 0, a: 0} + m_BuildTextureStacks: [] diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion/M_Distortion.mat.meta b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion/M_Distortion.mat.meta new file mode 100644 index 00000000000..d31a1961ed0 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion/M_Distortion.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e10994a990a6a044cb7e608fed341b71 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion/M_Plane.mat b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion/M_Plane.mat new file mode 100644 index 00000000000..167afae6a94 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion/M_Plane.mat @@ -0,0 +1,267 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: M_Plane + m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3} + m_ShaderKeywords: _DISABLE_SSR_TRANSPARENT _NORMALMAP_TANGENT_SPACE + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2225 + stringTagMap: {} + disabledShaderPasses: + - DistortionVectors + - MOTIONVECTORS + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + 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: 2800000, guid: d0ab2de4305d3f24e97132774d93313e, type: 3} + 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: 2800000, guid: d0ab2de4305d3f24e97132774d93313e, type: 3} + 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} + 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 + - _NormalMapSpace: 0 + - _NormalScale: 1 + - _OpaqueCullMode: 2 + - _PPDLodThreshold: 5 + - _PPDMaxSamples: 15 + - _PPDMinSamples: 5 + - _PPDPrimitiveLength: 1 + - _PPDPrimitiveWidth: 1 + - _RayTracing: 0 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RefractionModel: 0 + - _SSRefractionProjectionModel: 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 + - _TexWorldScale: 1 + - _TexWorldScaleEmissive: 1 + - _Thickness: 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: [] +--- !u!114 &7032124506222128993 +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: 9 diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion/M_Plane.mat.meta b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion/M_Plane.mat.meta new file mode 100644 index 00000000000..70f2c6ab88e --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion/M_Plane.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2a93f2b8f03202247aa30728a63f0146 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_DistortionSettings.lighting b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_DistortionSettings.lighting new file mode 100644 index 00000000000..ea0de1267c6 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_DistortionSettings.lighting @@ -0,0 +1,63 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!850595691 &4890085278179872738 +LightingSettings: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: 1101_Unlit_Smooth_DistortionSettings + serializedVersion: 3 + m_GIWorkflowMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_RealtimeEnvironmentLighting: 1 + m_BounceScale: 1 + m_AlbedoBoost: 1 + m_IndirectOutputScale: 1 + m_UsingShadowmask: 1 + m_BakeBackend: 0 + m_LightmapMaxSize: 1024 + m_BakeResolution: 40 + m_Padding: 2 + m_TextureCompression: 1 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAO: 0 + m_MixedBakeMode: 2 + m_LightmapsBakeMode: 1 + m_FilterMode: 1 + m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0} + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_RealtimeResolution: 2 + m_ForceWhiteAlbedo: 0 + m_ForceUpdates: 0 + m_FinalGather: 0 + m_FinalGatherRayCount: 256 + m_FinalGatherFiltering: 1 + m_PVRCulling: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVREnvironmentSampleCount: 500 + m_PVREnvironmentReferencePointCount: 2048 + m_LightProbeSampleCountMultiplier: 4 + m_PVRBounces: 2 + m_PVRMinBounces: 2 + m_PVREnvironmentMIS: 0 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_DistortionSettings.lighting.meta b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_DistortionSettings.lighting.meta new file mode 100644 index 00000000000..e11bd0fae22 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_DistortionSettings.lighting.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8483688f996b46249976479af6c20f90 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/1101_Unlit_Smooth_Distortion.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/1101_Unlit_Smooth_Distortion.png new file mode 100644 index 00000000000..1d808d73392 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/1101_Unlit_Smooth_Distortion.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:681004d594e165adcbc2d3c2d3e9df9c18a9547d8e578c888319ace9535debd6 +size 1816671 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/1101_Unlit_Smooth_Distortion.png.meta b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/1101_Unlit_Smooth_Distortion.png.meta new file mode 100644 index 00000000000..59f33a83aa8 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/1101_Unlit_Smooth_Distortion.png.meta @@ -0,0 +1,108 @@ +fileFormatVersion: 2 +guid: 9a3b7ca9c47177a459872671e35a8a3d +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 c509b3b4011..50868bb1018 100644 --- a/TestProjects/HDRP_Tests/ProjectSettings/EditorBuildSettings.asset +++ b/TestProjects/HDRP_Tests/ProjectSettings/EditorBuildSettings.asset @@ -8,6 +8,9 @@ EditorBuildSettings: - enabled: 1 path: Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit.unity guid: 7fe3f9e94b4355641ba1534c54d5c356 + - enabled: 1 + path: Assets/GraphicTests/Scenes/1x_Materials/1101_Unlit_Smooth_Distortion.unity + guid: 50b2c92f5c04d254aa8df03d007f00a9 - enabled: 1 path: Assets/GraphicTests/Scenes/1x_Materials/1102_Unlit_Distortion.unity guid: a6e4a81e1988f24459f57a881905a465 diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index e4f142d1b14..92044698bca 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added a new ray tracing only function that samples the specular part of the materials. - Adding missing marker for ray tracing profiling (RaytracingDeferredLighting) - Added the support of eye shader for ray tracing. +- Added a rough distortion frame setting and and info box on distortion materials. ### Fixed - Fixed several issues with physically-based DoF (TAA ghosting of the CoC buffer, smooth layer transitions, etc) @@ -204,6 +205,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Move System Generated Values semantics out of VaryingsMesh structure. - Other forms of FSAA are silently deactivated, when path tracing is on. - Removed XRSystemTests. The GC verification is now done during playmode tests (case 1285012). +- SSR now uses the pre-refraction color pyramid. ## [10.0.0] - 2019-06-10 diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/DistortionUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/DistortionUIBlock.cs index a77a4ae9bc6..756a7d98b8f 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/DistortionUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/DistortionUIBlock.cs @@ -17,6 +17,7 @@ internal static class Styles public static GUIContent distortionScaleText = new GUIContent("Distortion Scale", "Sets the scale HDRP applies to the Distortion Vector Map."); public static GUIContent distortionBlurScaleText = new GUIContent("Distortion Blur Scale", "Sets the scale HDRP applies to the distortion blur effect."); public static GUIContent distortionBlurRemappingText = new GUIContent("Distortion Blur Remapping", "Controls a remap for the Distortion Blur effect."); + public static GUIContent distortionRoughInfoText = new GUIContent("Blur parameters will have an effect on the distortion if the Rough Distortion Frame Setting is enabled on the target camera."); } protected MaterialProperty distortionEnable = null; @@ -69,6 +70,7 @@ public override void OnGUI() if (distortionEnable.floatValue == 1.0f) { + EditorGUILayout.HelpBox(Styles.distortionRoughInfoText.text, MessageType.Info, true); EditorGUI.indentLevel++; materialEditor.ShaderProperty(distortionBlendMode, Styles.distortionBlendModeText); if (distortionOnly != 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 5d82c8928aa..07aec0cbe7a 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 @@ -198,13 +198,29 @@ void ExecuteWithRenderGraph( RenderRequest renderRequest, } // This final Gaussian pyramid can be reused by SSR, so disable it only if there is no distortion - if (hdCamera.frameSettings.IsEnabled(FrameSettingsField.Distortion) || hdCamera.IsSSREnabled()) - GenerateColorPyramid(m_RenderGraph, hdCamera, colorBuffer, currentColorPyramid, false); + TextureHandle distortionColorPyramid; + if (hdCamera.frameSettings.IsEnabled(FrameSettingsField.Distortion) && hdCamera.frameSettings.IsEnabled(FrameSettingsField.RoughDistortion)) + { + distortionColorPyramid = m_RenderGraph.CreateTexture( + new TextureDesc(Vector2.one, true, true) + { + colorFormat = GetColorBufferFormat(), + enableRandomWrite = true, + useMipMap = true, + autoGenerateMips = false, + name = "DistortionColorBufferMipChain" + }); + GenerateColorPyramid(m_RenderGraph, hdCamera, colorBuffer, distortionColorPyramid, false); + } + else + { + distortionColorPyramid = currentColorPyramid; + } using (new RenderGraphProfilingScope(m_RenderGraph, ProfilingSampler.Get(HDProfileId.Distortion))) { var distortionBuffer = AccumulateDistortion(m_RenderGraph, hdCamera, prepassOutput.resolvedDepthBuffer, cullingResults); - RenderDistortion(m_RenderGraph, hdCamera, colorBuffer, prepassOutput.resolvedDepthBuffer, currentColorPyramid, distortionBuffer); + RenderDistortion(m_RenderGraph, hdCamera, colorBuffer, prepassOutput.resolvedDepthBuffer, distortionColorPyramid, distortionBuffer); } PushFullScreenDebugTexture(m_RenderGraph, colorBuffer, FullScreenDebugMode.NanTracker); @@ -1133,19 +1149,14 @@ class GenerateColorPyramidData void GenerateColorPyramid(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle inputColor, TextureHandle output, bool isPreRefraction) { - // Here we cannot rely on automatic pass culling if the result is not read - // because the output texture is imported from outside of render graph (as it is persistent) - // and in this case the pass is considered as having side effect and cannot be culled. - if (isPreRefraction) + if (!isPreRefraction) { - if (!hdCamera.frameSettings.IsEnabled(FrameSettingsField.Refraction)) + bool distortionRequiresPyramid = hdCamera.frameSettings.IsEnabled(FrameSettingsField.Distortion) + && hdCamera.frameSettings.IsEnabled(FrameSettingsField.RoughDistortion); + // This final Gaussian pyramid is not used by the SSR, so distortion is the only condition. + if (!distortionRequiresPyramid) return; } - // This final Gaussian pyramid can be reused by SSR, so disable it only if there is no distortion - else if (!hdCamera.frameSettings.IsEnabled(FrameSettingsField.Distortion) && !hdCamera.IsSSREnabled()) - { - return; - } using (var builder = renderGraph.AddRenderPass("Color Gaussian MIP Chain", out var passData, ProfilingSampler.Get(HDProfileId.ColorPyramid))) { @@ -1206,11 +1217,12 @@ TextureHandle AccumulateDistortion( RenderGraph renderGraph, class RenderDistortionPassData { public Material applyDistortionMaterial; - public TextureHandle colorPyramidBuffer; + public TextureHandle sourceColorBuffer; public TextureHandle distortionBuffer; public TextureHandle colorBuffer; public TextureHandle depthStencilBuffer; public Vector4 size; + public bool smoothDistortion; } void RenderDistortion( RenderGraph renderGraph, @@ -1226,7 +1238,8 @@ void RenderDistortion( RenderGraph renderGraph, using (var builder = renderGraph.AddRenderPass("Apply Distortion", out var passData, ProfilingSampler.Get(HDProfileId.ApplyDistortion))) { passData.applyDistortionMaterial = m_ApplyDistortionMaterial; - passData.colorPyramidBuffer = builder.ReadTexture(colorPyramidBuffer); + passData.smoothDistortion = !hdCamera.frameSettings.IsEnabled(FrameSettingsField.RoughDistortion); + passData.sourceColorBuffer = passData.smoothDistortion ? builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) { colorFormat = GetColorBufferFormat(), name = "DistortionIntermediateBuffer" }) : builder.ReadTexture(colorPyramidBuffer); passData.distortionBuffer = builder.ReadTexture(distortionBuffer); passData.colorBuffer = builder.UseColorBuffer(colorBuffer, 0); passData.depthStencilBuffer = builder.UseDepthBuffer(depthStencilBuffer, DepthAccess.Read); @@ -1235,13 +1248,17 @@ void RenderDistortion( RenderGraph renderGraph, builder.SetRenderFunc( (RenderDistortionPassData data, RenderGraphContext context) => { + if (data.smoothDistortion) + HDUtils.BlitCameraTexture(context.cmd, passData.colorBuffer, data.sourceColorBuffer); + // TODO: Set stencil stuff via parameters rather than hard-coding it in shader. data.applyDistortionMaterial.SetTexture(HDShaderIDs._DistortionTexture, data.distortionBuffer); - data.applyDistortionMaterial.SetTexture(HDShaderIDs._ColorPyramidTexture, data.colorPyramidBuffer); + data.applyDistortionMaterial.SetTexture(HDShaderIDs._ColorPyramidTexture, data.sourceColorBuffer); data.applyDistortionMaterial.SetVector(HDShaderIDs._Size, data.size); data.applyDistortionMaterial.SetInt(HDShaderIDs._StencilMask, (int)StencilUsage.DistortionVectors); data.applyDistortionMaterial.SetInt(HDShaderIDs._StencilRef, (int)StencilUsage.DistortionVectors); + CoreUtils.SetKeyword(context.cmd, "SMOOTH_DISTORTION", data.smoothDistortion); HDUtils.DrawFullScreen(context.cmd, data.applyDistortionMaterial, data.colorBuffer, data.depthStencilBuffer, null, 0); }); } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index 6bddb91693b..cc9daf91f09 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -184,6 +184,7 @@ internal static Volume GetOrCreateDefaultVolume() RTHandle m_CameraColorBuffer; RTHandle m_OpaqueAtmosphericScatteringBuffer; // Necessary to perform dual-source (polychromatic alpha) blending which is not supported by Unity RTHandle m_CameraSssDiffuseLightingBuffer; + RTHandle m_DistortionIntermediateBuffer; RTHandle m_ContactShadowBuffer; RTHandle m_ScreenSpaceShadowsBuffer; @@ -735,6 +736,7 @@ void InitializeRenderTextures() m_CameraSssDiffuseLightingBuffer = RTHandles.Alloc(Vector2.one, TextureXR.slices, dimension: TextureXR.dimension, colorFormat: GraphicsFormat.B10G11R11_UFloatPack32, enableRandomWrite: true, useDynamicScale: true, name: "CameraSSSDiffuseLighting"); m_DistortionBuffer = RTHandles.Alloc(Vector2.one, TextureXR.slices, dimension: TextureXR.dimension, colorFormat: Builtin.GetDistortionBufferFormat(), useDynamicScale: true, name: "Distortion"); + m_DistortionIntermediateBuffer = RTHandles.Alloc(Vector2.one, TextureXR.slices, dimension: TextureXR.dimension, colorFormat: GetColorBufferFormat(), enableRandomWrite: true, useMipMap: true, autoGenerateMips: false, useDynamicScale: true, name: "DistortionIntermediateBuffer"); m_ContactShadowBuffer = RTHandles.Alloc(Vector2.one, TextureXR.slices, dimension: TextureXR.dimension, colorFormat: GraphicsFormat.R32_UInt, enableRandomWrite: true, useDynamicScale: true, name: "ContactShadowsBuffer"); if (m_Asset.currentPlatformRenderPipelineSettings.lowresTransparentSettings.enabled) @@ -815,6 +817,7 @@ void DestroyRenderTextures() RTHandles.Release(m_CameraSssDiffuseLightingBuffer); RTHandles.Release(m_DistortionBuffer); + RTHandles.Release(m_DistortionIntermediateBuffer); RTHandles.Release(m_ContactShadowBuffer); RTHandles.Release(m_LowResTransparentBuffer); @@ -2912,12 +2915,12 @@ void Callback(CommandBuffer c, HDCamera cam) // Render pre refraction objects RenderForwardTransparent(cullingResults, hdCamera, true, renderContext, cmd); - if (hdCamera.frameSettings.IsEnabled(FrameSettingsField.Refraction)) + if (hdCamera.frameSettings.IsEnabled(FrameSettingsField.Refraction) || hdCamera.IsSSREnabled()) { // First resolution of the color buffer for the color pyramid m_SharedRTManager.ResolveMSAAColor(cmd, hdCamera, m_CameraColorMSAABuffer, m_CameraColorBuffer); - RenderColorPyramid(hdCamera, cmd, true); + RenderColorPyramid(hdCamera, cmd, true, null); // Bind current color pyramid for shader graph SceneColorNode on transparent objects cmd.SetGlobalTexture(HDShaderIDs._ColorPyramidTexture, hdCamera.GetCurrentFrameRT((int)HDCameraFrameHistoryType.ColorBufferMipChain)); @@ -2956,8 +2959,6 @@ void Callback(CommandBuffer c, HDCamera cam) // Fill depth buffer to reduce artifact for transparent object during postprocess RenderTransparentDepthPostpass(cullingResults, hdCamera, renderContext, cmd); - RenderColorPyramid(hdCamera, cmd, false); - AccumulateDistortion(cullingResults, hdCamera, renderContext, cmd); RenderDistortion(hdCamera, cmd); @@ -3637,18 +3638,23 @@ void RenderDistortion(HDCamera hdCamera, CommandBuffer cmd) using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.ApplyDistortion))) { - var currentColorPyramid = hdCamera.GetCurrentFrameRT((int)HDCameraFrameHistoryType.ColorBufferMipChain); + bool smoothDistortion = !hdCamera.frameSettings.IsEnabled(FrameSettingsField.RoughDistortion); + if (smoothDistortion) + HDUtils.BlitCameraTexture(cmd, m_CameraColorBuffer, m_DistortionIntermediateBuffer); + else + RenderColorPyramid(hdCamera, cmd, false, m_DistortionIntermediateBuffer); CoreUtils.SetRenderTarget(cmd, m_CameraColorBuffer); - // TODO: Set stencil stuff via parameters rather than hardcoding it in shader. m_ApplyDistortionMaterial.SetTexture(HDShaderIDs._DistortionTexture, m_DistortionBuffer); - m_ApplyDistortionMaterial.SetTexture(HDShaderIDs._ColorPyramidTexture, currentColorPyramid); + m_ApplyDistortionMaterial.SetTexture(HDShaderIDs._ColorPyramidTexture, m_DistortionIntermediateBuffer); var size = new Vector4(hdCamera.actualWidth, hdCamera.actualHeight, 1f / hdCamera.actualWidth, 1f / hdCamera.actualHeight); m_ApplyDistortionMaterial.SetVector(HDShaderIDs._Size, size); + // TODO: Set stencil stuff via parameters rather than hardcoding it in shader. m_ApplyDistortionMaterial.SetInt(HDShaderIDs._StencilMask, (int)StencilUsage.DistortionVectors); m_ApplyDistortionMaterial.SetInt(HDShaderIDs._StencilRef, (int)StencilUsage.DistortionVectors); + CoreUtils.SetKeyword(cmd, "SMOOTH_DISTORTION", smoothDistortion); HDUtils.DrawFullScreen(cmd, m_ApplyDistortionMaterial, m_CameraColorBuffer, m_SharedRTManager.GetDepthStencilBuffer(), null, 0); } } @@ -4913,22 +4919,23 @@ void RenderSSRTransparent(HDCamera hdCamera, CommandBuffer cmd, ScriptableRender PushFullScreenDebugTexture(hdCamera, cmd, m_SsrLightingTexture, FullScreenDebugMode.TransparentScreenSpaceReflections); } - void RenderColorPyramid(HDCamera hdCamera, CommandBuffer cmd, bool isPreRefraction) + void RenderColorPyramid(HDCamera hdCamera, CommandBuffer cmd, bool isPreRefraction, RTHandle outputPyramid) { - if (isPreRefraction) + RTHandle currentColorPyramid; + if (!isPreRefraction) { - if (!hdCamera.frameSettings.IsEnabled(FrameSettingsField.Refraction)) + bool distortionRequiresPyramid = hdCamera.frameSettings.IsEnabled(FrameSettingsField.Distortion) + && hdCamera.frameSettings.IsEnabled(FrameSettingsField.RoughDistortion); + // This final Gaussian pyramid is not used by the SSR, so distortion is the only condition. + if (!distortionRequiresPyramid) return; + currentColorPyramid = outputPyramid; } else { - // This final Gaussian pyramid can be reused by SSR, so disable it only if there is no distortion - if (!hdCamera.frameSettings.IsEnabled(FrameSettingsField.Distortion) && !hdCamera.IsSSREnabled()) - return; + currentColorPyramid = hdCamera.GetCurrentFrameRT((int)HDCameraFrameHistoryType.ColorBufferMipChain); } - var currentColorPyramid = hdCamera.GetCurrentFrameRT((int)HDCameraFrameHistoryType.ColorBufferMipChain); - int lodCount; using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.ColorPyramid))) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineAsset.Migration.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineAsset.Migration.cs index 80b84960155..94f61a5b5c0 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineAsset.Migration.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineAsset.Migration.cs @@ -22,7 +22,8 @@ enum Version SeparateColorGradingAndTonemappingFrameSettings, ReplaceTextureArraysByAtlasForCookieAndPlanar, AddedAdaptiveSSS, - RemoveCookieCubeAtlasToOctahedral2D + RemoveCookieCubeAtlasToOctahedral2D, + RoughDistortion } static readonly MigrationDescription k_Migration = MigrationDescription.New( @@ -125,6 +126,12 @@ enum Version { Debug.LogWarning("HDRP Internally change the storage of Cube Cookie to Octahedral Projection inside the Planar Reflection Atlas. It is recommended that you increase the size of the Planar Projection Atlas if the cookies no longer fit."); } + }), + MigrationStep.New(Version.RoughDistortion, (HDRenderPipelineAsset data) => + { + FrameSettings.MigrateRoughDistortion(ref data.m_RenderingPathDefaultCameraFrameSettings); + FrameSettings.MigrateRoughDistortion(ref data.m_RenderingPathDefaultBakedOrCustomReflectionFrameSettings); + FrameSettings.MigrateRoughDistortion(ref data.m_RenderingPathDefaultRealtimeReflectionFrameSettings); }) ); diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Distortion/ApplyDistortion.shader b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Distortion/ApplyDistortion.shader index f1bcac52b52..c9274d30904 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Distortion/ApplyDistortion.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Distortion/ApplyDistortion.shader @@ -12,6 +12,8 @@ Shader "Hidden/HDRP/ApplyDistortion" #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma editor_sync_compilation + #pragma multi_compile _ SMOOTH_DISTORTION + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Builtin/BuiltinData.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" @@ -88,8 +90,14 @@ Shader "Hidden/HDRP/ApplyDistortion" // Get source pixel for distortion float2 distordedUV = float2(input.positionCS.xy + distortion * _FetchBias) * _Size.zw; + #ifndef SMOOTH_DISTORTION float mip = (_ColorPyramidLodCount - 1) * clamp(distortionBlur, 0.0, 1.0); - float4 sampled = SAMPLE_TEXTURE2D_X_LOD(_ColorPyramidTexture, s_trilinear_clamp_sampler, distordedUV * _RTHandleScaleHistory.xy, mip); + float2 uv = distordedUV * _RTHandleScaleHistory.xy; + #else + float mip = 0; + float2 uv = distordedUV * _RTHandleScale.xy; + #endif + float4 sampled = SAMPLE_TEXTURE2D_X_LOD(_ColorPyramidTexture, s_trilinear_clamp_sampler, uv, mip); return sampled; } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.Migration.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.Migration.cs index 405a76fcf0b..0385158afb7 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.Migration.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.Migration.cs @@ -426,5 +426,10 @@ internal static void MigrateSubsurfaceParams(ref FrameSettings fs, bool previous fs.sssQualityLevel = 0; fs.sssCustomSampleBudget = previouslyHighQuality ? 55 : (int)DefaultSssSampleBudgetForQualityLevel.Low; } + + internal static void MigrateRoughDistortion(ref FrameSettings cameraFrameSettings) + { + cameraFrameSettings.SetEnabled(FrameSettingsField.RoughDistortion, true); + } } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs index 35d57b997b1..67c67dd793c 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Settings/FrameSettings.cs @@ -152,6 +152,9 @@ public enum FrameSettingsField /// When enabled, HDRP processes a distortion render pass for Cameras using these Frame Settings. [FrameSettingsField(0, autoName: Distortion, tooltip: "When enabled, HDRP processes a distortion render pass for Cameras using these Frame Settings (Depends on \"Distortion\" in current HDRP Asset).")] Distortion = 14, + /// When enabled, HDRP processes a distortion render pass for Cameras using these Frame Settings. + [FrameSettingsField(0, autoName: RoughDistortion, customOrderInGroup: 16, positiveDependencies: new[] { Distortion }, tooltip: "When enabled, HDRP processes a distortion render pass for Cameras using these Frame Settings (Depends on \"Distortion\" in current HDRP Asset).")] + RoughDistortion = 67, /// When enabled, HDRP processes a post-processing render pass for Cameras using these Frame Settings. [FrameSettingsField(0, displayedName: "Post-process", customOrderInGroup: 17, tooltip: "When enabled, HDRP processes a post-processing render pass for Cameras using these Frame Settings.")] Postprocess = 15, @@ -396,6 +399,7 @@ partial struct FrameSettings (uint)FrameSettingsField.DecalLayers, (uint)FrameSettingsField.Refraction, // Depends on DepthPyramid - If not enable, just do a copy of the scene color (?) - how to disable refraction ? (uint)FrameSettingsField.Distortion, + (uint)FrameSettingsField.RoughDistortion, (uint)FrameSettingsField.Postprocess, (uint)FrameSettingsField.CustomPostProcess, (uint)FrameSettingsField.StopNaN, @@ -470,6 +474,7 @@ partial struct FrameSettings (uint)FrameSettingsField.DecalLayers, //(uint)FrameSettingsField.Refraction, // Depends on DepthPyramid - If not enable, just do a copy of the scene color (?) - how to disable refraction ? //(uint)FrameSettingsField.Distortion, + //(uint)FrameSettingsField.RoughDistortion, //(uint)FrameSettingsField.Postprocess, //(uint)FrameSettingsField.CustomPostProcess, //(uint)FrameSettingsField.AfterPostprocess, @@ -525,6 +530,7 @@ partial struct FrameSettings (uint)FrameSettingsField.DecalLayers, (uint)FrameSettingsField.Refraction, // Depends on DepthPyramid - If not enable, just do a copy of the scene color (?) - how to disable rough refraction ? (uint)FrameSettingsField.Distortion, + (uint)FrameSettingsField.RoughDistortion, //(uint)FrameSettingsField.Postprocess, //(uint)FrameSettingsField.CustomPostProcess, //(uint)FrameSettingsField.AfterPostprocess, @@ -778,7 +784,8 @@ internal static void Sanitize(ref FrameSettings sanitizedFrameSettings, Camera c sanitizedFrameSettings.bitDatas[(int)FrameSettingsField.Decals] &= renderPipelineSettings.supportDecals && !preview; sanitizedFrameSettings.bitDatas[(int)FrameSettingsField.DecalLayers] &= renderPipelineSettings.supportDecalLayers && sanitizedFrameSettings.bitDatas[(int)FrameSettingsField.Decals]; sanitizedFrameSettings.bitDatas[(int)FrameSettingsField.TransparentPostpass] &= renderPipelineSettings.supportTransparentDepthPostpass && !preview; - sanitizedFrameSettings.bitDatas[(int)FrameSettingsField.Distortion] &= renderPipelineSettings.supportDistortion && !msaa && !preview; + bool distortion = sanitizedFrameSettings.bitDatas[(int)FrameSettingsField.Distortion] &= renderPipelineSettings.supportDistortion && !msaa && !preview; + sanitizedFrameSettings.bitDatas[(int)FrameSettingsField.RoughDistortion] &= distortion && !msaa && !preview; sanitizedFrameSettings.bitDatas[(int)FrameSettingsField.LowResTransparent] &= renderPipelineSettings.lowresTransparentSettings.enabled; From 089f9b3252571643310b85d01b17b7be4b0d3003 Mon Sep 17 00:00:00 2001 From: Anis Date: Tue, 13 Oct 2020 14:55:52 +0200 Subject: [PATCH 02/10] Review fixes, updating screenshot and adding capture delay --- .../Scenes/9x_Other/9401_MSAAForwardOnly.unity | 7 ++++++- .../Linear/WindowsEditor/Direct3D11/None/2551_SSR.png | 4 ++-- .../RenderPipeline/HDRenderPipeline.RenderGraph.cs | 10 +++------- .../RenderPass/Distortion/ApplyDistortion.shader | 3 +-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9401_MSAAForwardOnly.unity b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9401_MSAAForwardOnly.unity index fc17d06aec6..66ba5f98e2d 100644 --- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9401_MSAAForwardOnly.unity +++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/9x_Other/9401_MSAAForwardOnly.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.042444438, g: 0.05500048, b: 0.0708929, a: 1} + m_IndirectSpecularColor: {r: 0.042444408, g: 0.05500044, b: 0.07089285, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -273,6 +273,11 @@ PrefabInstance: propertyPath: renderGraphCompatible value: 1 objectReference: {fileID: 0} + - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7, + type: 3} + propertyPath: waitFrames + value: 2 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3} --- !u!1001 &5493111667791475096 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/2551_SSR.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/2551_SSR.png index 11d290bcef7..ae8c8b9c21e 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/2551_SSR.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/2551_SSR.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:235f591a18ba1f53e0144f5996fcfb91b3a2704ae65459618ece20bafcffd284 -size 146936 +oid sha256:fd4cc825a6ed554fc78c06d0231804f1e7583e9470110cd06445c7e1cddbb4ae +size 146369 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 07aec0cbe7a..88b21044a22 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 @@ -198,10 +198,9 @@ void ExecuteWithRenderGraph( RenderRequest renderRequest, } // This final Gaussian pyramid can be reused by SSR, so disable it only if there is no distortion - TextureHandle distortionColorPyramid; if (hdCamera.frameSettings.IsEnabled(FrameSettingsField.Distortion) && hdCamera.frameSettings.IsEnabled(FrameSettingsField.RoughDistortion)) { - distortionColorPyramid = m_RenderGraph.CreateTexture( + TextureHandle distortionColorPyramid = m_RenderGraph.CreateTexture( new TextureDesc(Vector2.one, true, true) { colorFormat = GetColorBufferFormat(), @@ -211,16 +210,13 @@ void ExecuteWithRenderGraph( RenderRequest renderRequest, name = "DistortionColorBufferMipChain" }); GenerateColorPyramid(m_RenderGraph, hdCamera, colorBuffer, distortionColorPyramid, false); - } - else - { - distortionColorPyramid = currentColorPyramid; + currentColorPyramid = distortionColorPyramid; } using (new RenderGraphProfilingScope(m_RenderGraph, ProfilingSampler.Get(HDProfileId.Distortion))) { var distortionBuffer = AccumulateDistortion(m_RenderGraph, hdCamera, prepassOutput.resolvedDepthBuffer, cullingResults); - RenderDistortion(m_RenderGraph, hdCamera, colorBuffer, prepassOutput.resolvedDepthBuffer, distortionColorPyramid, distortionBuffer); + RenderDistortion(m_RenderGraph, hdCamera, colorBuffer, prepassOutput.resolvedDepthBuffer, currentColorPyramid, distortionBuffer); } PushFullScreenDebugTexture(m_RenderGraph, colorBuffer, FullScreenDebugMode.NanTracker); diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Distortion/ApplyDistortion.shader b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Distortion/ApplyDistortion.shader index c9274d30904..e1610d18b53 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Distortion/ApplyDistortion.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Distortion/ApplyDistortion.shader @@ -92,11 +92,10 @@ Shader "Hidden/HDRP/ApplyDistortion" float2 distordedUV = float2(input.positionCS.xy + distortion * _FetchBias) * _Size.zw; #ifndef SMOOTH_DISTORTION float mip = (_ColorPyramidLodCount - 1) * clamp(distortionBlur, 0.0, 1.0); - float2 uv = distordedUV * _RTHandleScaleHistory.xy; #else float mip = 0; - float2 uv = distordedUV * _RTHandleScale.xy; #endif + float2 uv = distordedUV * _RTHandleScale.xy; float4 sampled = SAMPLE_TEXTURE2D_X_LOD(_ColorPyramidTexture, s_trilinear_clamp_sampler, uv, mip); return sampled; From c001879f134678a9aacdd54cd8c6246a4778956f Mon Sep 17 00:00:00 2001 From: Anis Date: Tue, 13 Oct 2020 15:33:52 +0200 Subject: [PATCH 03/10] additional review fixes --- .../HDRenderPipeline.RenderGraph.cs | 19 ++++-------- .../RenderPipeline/HDRenderPipeline.cs | 29 +++++-------------- 2 files changed, 12 insertions(+), 36 deletions(-) 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 88b21044a22..8a81b4c23b6 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 @@ -209,7 +209,7 @@ void ExecuteWithRenderGraph( RenderRequest renderRequest, autoGenerateMips = false, name = "DistortionColorBufferMipChain" }); - GenerateColorPyramid(m_RenderGraph, hdCamera, colorBuffer, distortionColorPyramid, false); + GenerateColorPyramid(m_RenderGraph, hdCamera, colorBuffer, distortionColorPyramid, FullScreenDebugMode.PreRefractionColorPyramid); currentColorPyramid = distortionColorPyramid; } @@ -886,10 +886,10 @@ TextureHandle RenderTransparency( RenderGraph renderGraph, // Render pre-refraction objects RenderForwardTransparent(renderGraph, hdCamera, colorBuffer, prepassOutput, vtFeedbackBuffer, volumetricLighting, ssrLightingBuffer, null, lightLists, shadowResult, cullingResults, true); - if (hdCamera.frameSettings.IsEnabled(FrameSettingsField.Refraction)) + if (hdCamera.frameSettings.IsEnabled(FrameSettingsField.Refraction) || hdCamera.IsSSREnabled()) { var resolvedColorBuffer = ResolveMSAAColor(renderGraph, hdCamera, colorBuffer, m_NonMSAAColorBuffer); - GenerateColorPyramid(renderGraph, hdCamera, resolvedColorBuffer, currentColorPyramid, true); + GenerateColorPyramid(renderGraph, hdCamera, resolvedColorBuffer, currentColorPyramid, FullScreenDebugMode.FinalColorPyramid); } // We don't have access to the color pyramid with transparent if rough refraction is disabled @@ -1143,17 +1143,8 @@ class GenerateColorPyramidData public HDCamera hdCamera; } - void GenerateColorPyramid(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle inputColor, TextureHandle output, bool isPreRefraction) + void GenerateColorPyramid(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle inputColor, TextureHandle output, FullScreenDebugMode fsDebugMode) { - if (!isPreRefraction) - { - bool distortionRequiresPyramid = hdCamera.frameSettings.IsEnabled(FrameSettingsField.Distortion) - && hdCamera.frameSettings.IsEnabled(FrameSettingsField.RoughDistortion); - // This final Gaussian pyramid is not used by the SSR, so distortion is the only condition. - if (!distortionRequiresPyramid) - return; - } - using (var builder = renderGraph.AddRenderPass("Color Gaussian MIP Chain", out var passData, ProfilingSampler.Get(HDProfileId.ColorPyramid))) { passData.colorPyramid = builder.WriteTexture(output); @@ -1175,7 +1166,7 @@ void GenerateColorPyramid(RenderGraph renderGraph, HDCamera hdCamera, TextureHan // Note: hdCamera.colorPyramidHistoryMipCount is going to be one frame late here (rendering, which is done later, is updating it) // In practice this should not be a big problem as it's only for debug purpose here. var scale = new Vector4(RTHandles.rtHandleProperties.rtHandleScale.x, RTHandles.rtHandleProperties.rtHandleScale.y, 0f, 0f); - PushFullScreenDebugTextureMip(renderGraph, output, hdCamera.colorPyramidHistoryMipCount, scale, isPreRefraction ? FullScreenDebugMode.PreRefractionColorPyramid : FullScreenDebugMode.FinalColorPyramid); + PushFullScreenDebugTextureMip(renderGraph, output, hdCamera.colorPyramidHistoryMipCount, scale, fsDebugMode); } class AccumulateDistortionPassData diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index cc9daf91f09..6caeaf6dd16 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -2920,7 +2920,8 @@ void Callback(CommandBuffer c, HDCamera cam) // First resolution of the color buffer for the color pyramid m_SharedRTManager.ResolveMSAAColor(cmd, hdCamera, m_CameraColorMSAABuffer, m_CameraColorBuffer); - RenderColorPyramid(hdCamera, cmd, true, null); + RTHandle colorPyramid = hdCamera.GetCurrentFrameRT((int)HDCameraFrameHistoryType.ColorBufferMipChain); + RenderColorPyramid(hdCamera, cmd, colorPyramid, FullScreenDebugMode.PreRefractionColorPyramid); // Bind current color pyramid for shader graph SceneColorNode on transparent objects cmd.SetGlobalTexture(HDShaderIDs._ColorPyramidTexture, hdCamera.GetCurrentFrameRT((int)HDCameraFrameHistoryType.ColorBufferMipChain)); @@ -3642,7 +3643,7 @@ void RenderDistortion(HDCamera hdCamera, CommandBuffer cmd) if (smoothDistortion) HDUtils.BlitCameraTexture(cmd, m_CameraColorBuffer, m_DistortionIntermediateBuffer); else - RenderColorPyramid(hdCamera, cmd, false, m_DistortionIntermediateBuffer); + RenderColorPyramid(hdCamera, cmd, m_DistortionIntermediateBuffer, FullScreenDebugMode.FinalColorPyramid); CoreUtils.SetRenderTarget(cmd, m_CameraColorBuffer); m_ApplyDistortionMaterial.SetTexture(HDShaderIDs._DistortionTexture, m_DistortionBuffer); @@ -4919,29 +4920,13 @@ void RenderSSRTransparent(HDCamera hdCamera, CommandBuffer cmd, ScriptableRender PushFullScreenDebugTexture(hdCamera, cmd, m_SsrLightingTexture, FullScreenDebugMode.TransparentScreenSpaceReflections); } - void RenderColorPyramid(HDCamera hdCamera, CommandBuffer cmd, bool isPreRefraction, RTHandle outputPyramid) + void RenderColorPyramid(HDCamera hdCamera, CommandBuffer cmd, RTHandle outputPyramid, FullScreenDebugMode fsDebugMode) { - RTHandle currentColorPyramid; - if (!isPreRefraction) - { - bool distortionRequiresPyramid = hdCamera.frameSettings.IsEnabled(FrameSettingsField.Distortion) - && hdCamera.frameSettings.IsEnabled(FrameSettingsField.RoughDistortion); - // This final Gaussian pyramid is not used by the SSR, so distortion is the only condition. - if (!distortionRequiresPyramid) - return; - currentColorPyramid = outputPyramid; - } - else - { - currentColorPyramid = hdCamera.GetCurrentFrameRT((int)HDCameraFrameHistoryType.ColorBufferMipChain); - } - int lodCount; - using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.ColorPyramid))) { Vector2Int pyramidSizeV2I = new Vector2Int(hdCamera.actualWidth, hdCamera.actualHeight); - lodCount = m_MipGenerator.RenderColorGaussianPyramid(cmd, pyramidSizeV2I, m_CameraColorBuffer, currentColorPyramid); + lodCount = m_MipGenerator.RenderColorGaussianPyramid(cmd, pyramidSizeV2I, m_CameraColorBuffer, outputPyramid); hdCamera.colorPyramidHistoryMipCount = lodCount; } @@ -4952,8 +4937,8 @@ void RenderColorPyramid(HDCamera hdCamera, CommandBuffer cmd, bool isPreRefracti // size AND the viewport, (uv * _ColorPyramidScale.xy) can be off by a texel // unless the scale is 1 (and it will not be 1 if the texture was resized // and is of greater size compared to the viewport). - cmd.SetGlobalTexture(HDShaderIDs._ColorPyramidTexture, currentColorPyramid); - PushFullScreenDebugTextureMip(hdCamera, cmd, currentColorPyramid, lodCount, isPreRefraction ? FullScreenDebugMode.PreRefractionColorPyramid : FullScreenDebugMode.FinalColorPyramid); + cmd.SetGlobalTexture(HDShaderIDs._ColorPyramidTexture, outputPyramid); + PushFullScreenDebugTextureMip(hdCamera, cmd, outputPyramid, lodCount, fsDebugMode); } void GenerateDepthPyramid(HDCamera hdCamera, CommandBuffer cmd, FullScreenDebugMode debugMode, bool mip1AlreadyComputed) From ee7d68da3325c3c8d41ded638aea2116c417873b Mon Sep 17 00:00:00 2001 From: Anis Date: Wed, 14 Oct 2020 10:34:05 +0200 Subject: [PATCH 04/10] review fixes --- .../Direct3D12/None/1101_Unlit_Smooth_Distortion.png | 3 +++ .../Linear/WindowsEditor/Direct3D12/None/2551_SSR.png | 4 ++-- .../RenderPipeline/HDRenderPipeline.RenderGraph.cs | 10 +++++----- .../Runtime/RenderPipeline/HDRenderPipeline.cs | 10 +++++----- .../Runtime/RenderPipeline/HDStringConstants.cs | 3 ++- .../RenderPass/Distortion/ApplyDistortion.shader | 9 ++------- 6 files changed, 19 insertions(+), 20 deletions(-) create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/1101_Unlit_Smooth_Distortion.png diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/1101_Unlit_Smooth_Distortion.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/1101_Unlit_Smooth_Distortion.png new file mode 100644 index 00000000000..4e809302ea9 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/1101_Unlit_Smooth_Distortion.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:26d6bdadc112b3d49ba8cc6ec4c79bb503ba71f21a08db23f1fca71c4d94d254 +size 2114899 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/2551_SSR.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/2551_SSR.png index 41950cc4d89..7e58d0a69cc 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/2551_SSR.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/2551_SSR.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3746d6ef4cdff7d0c7c3b24fb8e5fd4a80430f647a5a6d3c1a658f4961ea8c95 -size 165868 +oid sha256:455f39d891b2aaa099e2e06aea7251ba3866e8e15de46f12aa41e43aec655a98 +size 146307 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 8a81b4c23b6..b47e2dc48d9 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 @@ -1209,7 +1209,7 @@ class RenderDistortionPassData public TextureHandle colorBuffer; public TextureHandle depthStencilBuffer; public Vector4 size; - public bool smoothDistortion; + public bool roughDistortion; } void RenderDistortion( RenderGraph renderGraph, @@ -1225,8 +1225,8 @@ void RenderDistortion( RenderGraph renderGraph, using (var builder = renderGraph.AddRenderPass("Apply Distortion", out var passData, ProfilingSampler.Get(HDProfileId.ApplyDistortion))) { passData.applyDistortionMaterial = m_ApplyDistortionMaterial; - passData.smoothDistortion = !hdCamera.frameSettings.IsEnabled(FrameSettingsField.RoughDistortion); - passData.sourceColorBuffer = passData.smoothDistortion ? builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) { colorFormat = GetColorBufferFormat(), name = "DistortionIntermediateBuffer" }) : builder.ReadTexture(colorPyramidBuffer); + passData.roughDistortion = hdCamera.frameSettings.IsEnabled(FrameSettingsField.RoughDistortion); + passData.sourceColorBuffer = passData.roughDistortion ? builder.ReadTexture(colorPyramidBuffer) : builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true) { colorFormat = GetColorBufferFormat(), name = "DistortionIntermediateBuffer" }); passData.distortionBuffer = builder.ReadTexture(distortionBuffer); passData.colorBuffer = builder.UseColorBuffer(colorBuffer, 0); passData.depthStencilBuffer = builder.UseDepthBuffer(depthStencilBuffer, DepthAccess.Read); @@ -1235,7 +1235,7 @@ void RenderDistortion( RenderGraph renderGraph, builder.SetRenderFunc( (RenderDistortionPassData data, RenderGraphContext context) => { - if (data.smoothDistortion) + if (!data.roughDistortion) HDUtils.BlitCameraTexture(context.cmd, passData.colorBuffer, data.sourceColorBuffer); // TODO: Set stencil stuff via parameters rather than hard-coding it in shader. @@ -1244,8 +1244,8 @@ void RenderDistortion( RenderGraph renderGraph, data.applyDistortionMaterial.SetVector(HDShaderIDs._Size, data.size); data.applyDistortionMaterial.SetInt(HDShaderIDs._StencilMask, (int)StencilUsage.DistortionVectors); data.applyDistortionMaterial.SetInt(HDShaderIDs._StencilRef, (int)StencilUsage.DistortionVectors); + data.applyDistortionMaterial.SetInt(HDShaderIDs._RoughDistortion, data.roughDistortion ? 1 : 0); - CoreUtils.SetKeyword(context.cmd, "SMOOTH_DISTORTION", data.smoothDistortion); HDUtils.DrawFullScreen(context.cmd, data.applyDistortionMaterial, data.colorBuffer, data.depthStencilBuffer, null, 0); }); } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs index 6caeaf6dd16..218cad72dcf 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -3639,11 +3639,11 @@ void RenderDistortion(HDCamera hdCamera, CommandBuffer cmd) using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.ApplyDistortion))) { - bool smoothDistortion = !hdCamera.frameSettings.IsEnabled(FrameSettingsField.RoughDistortion); - if (smoothDistortion) - HDUtils.BlitCameraTexture(cmd, m_CameraColorBuffer, m_DistortionIntermediateBuffer); - else + bool roughDistortion = hdCamera.frameSettings.IsEnabled(FrameSettingsField.RoughDistortion); + if (roughDistortion) RenderColorPyramid(hdCamera, cmd, m_DistortionIntermediateBuffer, FullScreenDebugMode.FinalColorPyramid); + else + HDUtils.BlitCameraTexture(cmd, m_CameraColorBuffer, m_DistortionIntermediateBuffer); CoreUtils.SetRenderTarget(cmd, m_CameraColorBuffer); m_ApplyDistortionMaterial.SetTexture(HDShaderIDs._DistortionTexture, m_DistortionBuffer); @@ -3654,8 +3654,8 @@ void RenderDistortion(HDCamera hdCamera, CommandBuffer cmd) // TODO: Set stencil stuff via parameters rather than hardcoding it in shader. m_ApplyDistortionMaterial.SetInt(HDShaderIDs._StencilMask, (int)StencilUsage.DistortionVectors); m_ApplyDistortionMaterial.SetInt(HDShaderIDs._StencilRef, (int)StencilUsage.DistortionVectors); + m_ApplyDistortionMaterial.SetInt(HDShaderIDs._RoughDistortion, roughDistortion ? 1 : 0); - CoreUtils.SetKeyword(cmd, "SMOOTH_DISTORTION", smoothDistortion); HDUtils.DrawFullScreen(cmd, m_ApplyDistortionMaterial, m_CameraColorBuffer, m_SharedRTManager.GetDepthStencilBuffer(), null, 0); } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs index 3f27d1a8e68..ecfde018826 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs @@ -345,7 +345,8 @@ static class HDShaderIDs public static readonly int _DistortionTexture = Shader.PropertyToID("_DistortionTexture"); public static readonly int _ColorPyramidTexture = Shader.PropertyToID("_ColorPyramidTexture"); public static readonly int _ColorPyramidUvScaleAndLimitPrevFrame = Shader.PropertyToID("_ColorPyramidUvScaleAndLimitPrevFrame"); - + public static readonly int _RoughDistortion = Shader.PropertyToID("_RoughDistortion"); + public static readonly int _DebugColorPickerTexture = Shader.PropertyToID("_DebugColorPickerTexture"); public static readonly int _ColorPickerMode = Shader.PropertyToID("_ColorPickerMode"); public static readonly int _ApplyLinearToSRGB = Shader.PropertyToID("_ApplyLinearToSRGB"); diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Distortion/ApplyDistortion.shader b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Distortion/ApplyDistortion.shader index e1610d18b53..229cc39708b 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Distortion/ApplyDistortion.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Distortion/ApplyDistortion.shader @@ -12,8 +12,6 @@ Shader "Hidden/HDRP/ApplyDistortion" #pragma only_renderers d3d11 playstation xboxone vulkan metal switch #pragma editor_sync_compilation - #pragma multi_compile _ SMOOTH_DISTORTION - #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Builtin/BuiltinData.hlsl" #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" @@ -22,6 +20,7 @@ Shader "Hidden/HDRP/ApplyDistortion" CBUFFER_START(cb) float4 _Size; + int _RoughDistortion; CBUFFER_END struct Attributes @@ -90,11 +89,7 @@ Shader "Hidden/HDRP/ApplyDistortion" // Get source pixel for distortion float2 distordedUV = float2(input.positionCS.xy + distortion * _FetchBias) * _Size.zw; - #ifndef SMOOTH_DISTORTION - float mip = (_ColorPyramidLodCount - 1) * clamp(distortionBlur, 0.0, 1.0); - #else - float mip = 0; - #endif + int mip = (_ColorPyramidLodCount - 1) * saturate(distortionBlur) * _RoughDistortion; float2 uv = distordedUV * _RTHandleScale.xy; float4 sampled = SAMPLE_TEXTURE2D_X_LOD(_ColorPyramidTexture, s_trilinear_clamp_sampler, uv, mip); From 28e0f6429a2d05e8e710734ab6f0f754fc864634 Mon Sep 17 00:00:00 2001 From: Anis Date: Wed, 14 Oct 2020 10:55:37 +0200 Subject: [PATCH 05/10] missing meta file --- .../1101_Unlit_Smooth_Distortion.png.meta | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/1101_Unlit_Smooth_Distortion.png.meta diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/1101_Unlit_Smooth_Distortion.png.meta b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/1101_Unlit_Smooth_Distortion.png.meta new file mode 100644 index 00000000000..0493a7b6269 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/1101_Unlit_Smooth_Distortion.png.meta @@ -0,0 +1,108 @@ +fileFormatVersion: 2 +guid: 847b09ec6f586dd47a1f44186e9f84ef +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: From 831af9da97985f4d2b02069c6c19fb5f1206c1bc Mon Sep 17 00:00:00 2001 From: Anis Date: Thu, 15 Oct 2020 14:07:13 +0200 Subject: [PATCH 06/10] minor fix --- .../RenderPass/Distortion/ApplyDistortion.shader | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Distortion/ApplyDistortion.shader b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Distortion/ApplyDistortion.shader index 229cc39708b..fbd15933e7a 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Distortion/ApplyDistortion.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/Distortion/ApplyDistortion.shader @@ -89,10 +89,9 @@ Shader "Hidden/HDRP/ApplyDistortion" // Get source pixel for distortion float2 distordedUV = float2(input.positionCS.xy + distortion * _FetchBias) * _Size.zw; - int mip = (_ColorPyramidLodCount - 1) * saturate(distortionBlur) * _RoughDistortion; + float mip = (_ColorPyramidLodCount - 1) * saturate(distortionBlur) * _RoughDistortion; float2 uv = distordedUV * _RTHandleScale.xy; float4 sampled = SAMPLE_TEXTURE2D_X_LOD(_ColorPyramidTexture, s_trilinear_clamp_sampler, uv, mip); - return sampled; } ENDHLSL From cc243588f858bef77153e927f4234ea1de17db6f Mon Sep 17 00:00:00 2001 From: Anis Date: Thu, 15 Oct 2020 17:49:48 +0200 Subject: [PATCH 07/10] Update screenshots --- .../LinuxEditor/Vulkan/None/1101_Unlit_Smooth_Distortion.png | 3 +++ .../Linear/LinuxEditor/Vulkan/None/2551_SSR.png | 4 ++-- .../OSXEditor/Metal/None/1101_Unlit_Smooth_Distortion.png | 3 +++ .../ReferenceImages/Linear/OSXEditor/Metal/None/2551_SSR.png | 4 ++-- 4 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/1101_Unlit_Smooth_Distortion.png create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1101_Unlit_Smooth_Distortion.png diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/1101_Unlit_Smooth_Distortion.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/1101_Unlit_Smooth_Distortion.png new file mode 100644 index 00000000000..e8a772087fd --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/1101_Unlit_Smooth_Distortion.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3013f19788284ccf4c9b227059d0c8c4d47cb8399ec2b434e6fa145783dc8bb5 +size 2104772 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/2551_SSR.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/2551_SSR.png index 1490cf53b55..8a1531347d8 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/2551_SSR.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/2551_SSR.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:099e5b4199f4e5a02a10049fc82831af62fad50eeebdd23ef046351d0183c27d -size 167811 +oid sha256:3af76e5557db3d39146f8e006d0625e70fb6bf7e0998e3391f6c0276bdd932f5 +size 147867 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1101_Unlit_Smooth_Distortion.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1101_Unlit_Smooth_Distortion.png new file mode 100644 index 00000000000..9f48220fa40 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1101_Unlit_Smooth_Distortion.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:036b892bad9d1fdb3f38e2bb62e29b3bd02c5d0c8f1b4753cfb64c248742e3df +size 2096440 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/2551_SSR.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/2551_SSR.png index ef386e1a83e..23a017fcd4d 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/2551_SSR.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/2551_SSR.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b08cd2558c486edb3643f3b4e19ef753010a52ef6d1a03bf7be6dea2be65f018 -size 143418 +oid sha256:41469ac834cdb3fe0ccfe2683ca4aca6252ced4a72c70f9b3e4d38124fd22dcc +size 142763 From a435e036867a21878f15357fa0a3b0bc802cec2e Mon Sep 17 00:00:00 2001 From: Anis Date: Fri, 16 Oct 2020 10:19:46 +0200 Subject: [PATCH 08/10] update windows vulkan screenshots --- .../Vulkan/None/1101_Unlit_Smooth_Distortion.png | 3 +++ .../Linear/WindowsEditor/Vulkan/None/2551_SSR.png | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/1101_Unlit_Smooth_Distortion.png diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/1101_Unlit_Smooth_Distortion.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/1101_Unlit_Smooth_Distortion.png new file mode 100644 index 00000000000..c776b06cc1c --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/1101_Unlit_Smooth_Distortion.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:679c3bf1eb8509854e87475c7eb4de79f8594c9dbcc94596189e8aeb933a41f4 +size 2104575 diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/2551_SSR.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/2551_SSR.png index 4ca8874cd86..75b99d7e6bd 100644 --- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/2551_SSR.png +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/2551_SSR.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c8883c0e2227a0f961324f342db126f6ea9ad3a165684080f4a777d8492ccf38 -size 148744 +oid sha256:c71a9706be65493a38f64a2a8f0e8b9d9e5810a3dd9b63f5aa8b9aa0e73fd3dd +size 147812 From 28539bfaf05ddceacaeab33a7296fa6137df64c5 Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Tue, 20 Oct 2020 00:40:10 +0200 Subject: [PATCH 09/10] update documentation --- .../1101_Unlit_Smooth_Distortion.png.meta | 108 ++++++++++++++++++ .../1101_Unlit_Smooth_Distortion.png.meta | 108 ++++++++++++++++++ .../1101_Unlit_Smooth_Distortion.png.meta | 108 ++++++++++++++++++ .../Override-Screen-Space-Reflection.md | 5 +- .../Upgrading-from-2020.1-to-2020.2.md | 2 + .../Documentation~/whats-new-10-0.md | 10 +- 6 files changed, 336 insertions(+), 5 deletions(-) create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/1101_Unlit_Smooth_Distortion.png.meta create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1101_Unlit_Smooth_Distortion.png.meta create mode 100644 TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/1101_Unlit_Smooth_Distortion.png.meta diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/1101_Unlit_Smooth_Distortion.png.meta b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/1101_Unlit_Smooth_Distortion.png.meta new file mode 100644 index 00000000000..e85cadf5ce4 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/1101_Unlit_Smooth_Distortion.png.meta @@ -0,0 +1,108 @@ +fileFormatVersion: 2 +guid: 92dd39cebeedf204ebe648568cc7eeb6 +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/1101_Unlit_Smooth_Distortion.png.meta b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1101_Unlit_Smooth_Distortion.png.meta new file mode 100644 index 00000000000..b287fdc7f91 --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/OSXEditor/Metal/None/1101_Unlit_Smooth_Distortion.png.meta @@ -0,0 +1,108 @@ +fileFormatVersion: 2 +guid: 1df065366a0915342953c95e3d4eccec +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/1101_Unlit_Smooth_Distortion.png.meta b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/1101_Unlit_Smooth_Distortion.png.meta new file mode 100644 index 00000000000..5f121fc569d --- /dev/null +++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/1101_Unlit_Smooth_Distortion.png.meta @@ -0,0 +1,108 @@ +fileFormatVersion: 2 +guid: a8640724d85a38f469ebc219341d66d9 +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/com.unity.render-pipelines.high-definition/Documentation~/Override-Screen-Space-Reflection.md b/com.unity.render-pipelines.high-definition/Documentation~/Override-Screen-Space-Reflection.md index 00ade97a578..657b984f240 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Override-Screen-Space-Reflection.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Override-Screen-Space-Reflection.md @@ -35,7 +35,4 @@ HDRP uses the [Volume](Volumes.md) framework to calculate SSR, so to enable and ## Limitations -To calculate SSR, HDRP reads a color buffer with a blurred mipmap generated during the previous frame. Depending on your [HDRP Asset](HDRP-Asset.md) settings, the content of this color buffer may vary. -- With **Rough Refraction** enabled and **Distortion** disabled, the color buffer only includes transparent GameObjects that use the **BeforeRefraction** [Rendering Pass](Surface-Type.md). -- With both **Rough Refraction** and **Distortion** enabled, the color buffer includes all transparent GameObjects. -- With both **Rough Refraction** and **Distortion** disabled, the color buffer includes all transparent GameObjects. +To calculate SSR, HDRP reads a color buffer with a blurred mipmap generated during the previous frame. The color buffer only includes transparent GameObjects that use the **BeforeRefraction** [Rendering Pass](Surface-Type.md). diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Upgrading-from-2020.1-to-2020.2.md b/com.unity.render-pipelines.high-definition/Documentation~/Upgrading-from-2020.1-to-2020.2.md index bb0f4665d4c..eab5318316a 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Upgrading-from-2020.1-to-2020.2.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Upgrading-from-2020.1-to-2020.2.md @@ -49,6 +49,8 @@ For project migrating from old 9.x.x-preview package. There is a change in the o From 10.x, the debug lens attenuation has been removed, however the lens attenuation can now be set in the HDRP Default setting Panel as either modelling a perfect lens or an imperfect one. +From 10.x, the [Screen Space Reflection](Override-Screen-Space-Reflection.md) effect always use the color pyramid generate after the Before Refraction transparent pass. Thus the color buffer only includes transparent GameObjects that use the **BeforeRefraction** [Rendering Pass](Surface-Type.md). Previously the content was dependending on activation of Distortion effect. + ## Shadows From 10.x, it is no longer necessary to change the [HDRP Config package](HDRP-Config-Package.md) to set the [shadow filtering quality](HDRP-Asset.md#FilteringQualities) for deferred rendering. Instead, you can now change the filtering quality directly on the [HDRP Asset](HDRP-Asset.md#FilteringQualities). Note if you previously had not set the shadow filtering quality to **Medium** on the HDRP Asset, the automatic project upgrade process changes the shadow quality which means you may need to manually change it back to its original value. diff --git a/com.unity.render-pipelines.high-definition/Documentation~/whats-new-10-0.md b/com.unity.render-pipelines.high-definition/Documentation~/whats-new-10-0.md index 22401435653..ea5560832be 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/whats-new-10-0.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/whats-new-10-0.md @@ -1,4 +1,4 @@ -# What's new in version 10.0 +# What's new in version 10 This page contains an overview of new features, improvements, and issues resolved in version 10 of the High Definition Render Pipeline (HDRP). @@ -205,6 +205,14 @@ HDRP, being a high-end modern renderer, contains a lot of compute shader passes. Planar reflection probe filtering is a process that combines the result of planar reflection and surfaces smoothness. Up until this version, the implementation for planar reflection probe filtering did not always produce results of fantastic quality. This version of HDRP includes a new implementation that is closer to being physically-based and improves on the image quality significantly. +### Screen space reflection + +[Screen Space Reflection](Override-Screen-Space-Reflection.md) effect always use the color pyramid generate after the Before Refraction transparent pass. Thus the color buffer only includes transparent GameObjects that use the **BeforeRefraction** [Rendering Pass](Surface-Type.md). + +### Distortion + +Distortion effect now support a rough distortion effect which is disabled by default. Disabling Rough Distortion allow to save the cost of generating a color pyramid for the effect and instead rely on a copy of the screen. + ### Platform stability In the past, HDRP experienced stability issues for DirectX12, Vulkan, Metal, Linux. This version includes improvements to stability on these platforms. From 0506a7dbb9dece98435fca01ab075c23cbf73623 Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Tue, 20 Oct 2020 18:33:42 +0200 Subject: [PATCH 10/10] update doc --- .../Documentation~/Upgrading-from-2020.1-to-2020.2.md | 2 +- .../Documentation~/whats-new-10-0.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Upgrading-from-2020.1-to-2020.2.md b/com.unity.render-pipelines.high-definition/Documentation~/Upgrading-from-2020.1-to-2020.2.md index eab5318316a..9d82351806f 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Upgrading-from-2020.1-to-2020.2.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Upgrading-from-2020.1-to-2020.2.md @@ -49,7 +49,7 @@ For project migrating from old 9.x.x-preview package. There is a change in the o From 10.x, the debug lens attenuation has been removed, however the lens attenuation can now be set in the HDRP Default setting Panel as either modelling a perfect lens or an imperfect one. -From 10.x, the [Screen Space Reflection](Override-Screen-Space-Reflection.md) effect always use the color pyramid generate after the Before Refraction transparent pass. Thus the color buffer only includes transparent GameObjects that use the **BeforeRefraction** [Rendering Pass](Surface-Type.md). Previously the content was dependending on activation of Distortion effect. +From 10.x, the [Screen Space Reflection](Override-Screen-Space-Reflection.md) effect always uses the color pyramid HDRP generates after the Before Refraction transparent pass. This means the color buffer only includes transparent GameObjects that use the **BeforeRefraction** [Rendering Pass](Surface-Type.md). Previously the content depended on whether the Distortion effect was active. ## Shadows diff --git a/com.unity.render-pipelines.high-definition/Documentation~/whats-new-10-0.md b/com.unity.render-pipelines.high-definition/Documentation~/whats-new-10-0.md index ea5560832be..c17aad75252 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/whats-new-10-0.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/whats-new-10-0.md @@ -211,7 +211,7 @@ Planar reflection probe filtering is a process that combines the result of plana ### Distortion -Distortion effect now support a rough distortion effect which is disabled by default. Disabling Rough Distortion allow to save the cost of generating a color pyramid for the effect and instead rely on a copy of the screen. +The distortion effect now supports a rough distortion which is disabled by default. Disabling Rough Distortion saves resources as the effect does not generate a color pyramid and instead uses a copy of the screen. ### Platform stability