diff --git a/.yamato/upm-ci-hdrp.yml b/.yamato/upm-ci-hdrp.yml
index 59feca19a64..bbe4f59457f 100644
--- a/.yamato/upm-ci-hdrp.yml
+++ b/.yamato/upm-ci-hdrp.yml
@@ -234,10 +234,10 @@ All_{{ project.name }}_{{ editor.version }}:
{% else %}
- path: .yamato/upm-ci-{{ project.name | downcase }}.yml#{{ project.name }}_{{ platform.name }}_{{ win_api.name }}_{{ testplatform.name }}_{{ editor.version }}
rerun: {{ editor.rerun_strategy }}
- #{% if win_api.name == "DX12" and testplatform.name == "playmode" %}
- #- path: .yamato/upm-ci-hdrp_dxr.yml#HDRP_DXR_Win_DX12_playmode_{{ editor.version }}
- # rerun: {{ editor.rerun_strategy }}
- #{% endif %}
+ {% if win_api.name == "DX12" and testplatform.name == "playmode" %}
+ - path: .yamato/upm-ci-hdrp_dxr.yml#HDRP_DXR_Win_DX12_playmode_{{ editor.version }}
+ rerun: {{ editor.rerun_strategy }}
+ {% endif %}
{% endif %}
{% endfor %}
diff --git a/TestProjects/HDRP_DXR_Tests/Assets/Scenes/801_SubSurfaceScatteringDeferred.unity b/TestProjects/HDRP_DXR_Tests/Assets/Scenes/801_SubSurfaceScatteringDeferred.unity
index 373b7a2d40b..5327d4a9a62 100644
--- a/TestProjects/HDRP_DXR_Tests/Assets/Scenes/801_SubSurfaceScatteringDeferred.unity
+++ b/TestProjects/HDRP_DXR_Tests/Assets/Scenes/801_SubSurfaceScatteringDeferred.unity
@@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
- m_IndirectSpecularColor: {r: 0.028328251, g: 0.027931381, b: 0.02893291, a: 1}
+ m_IndirectSpecularColor: {r: 0.028464904, g: 0.028085843, b: 0.028795574, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
@@ -338,6 +338,7 @@ MonoBehaviour:
m_LightShadowRadius: 0.5
m_SemiTransparentShadow: 0
m_ColorShadow: 1
+ m_DistanceBasedFiltering: 0
m_EvsmExponent: 15
m_EvsmLightLeakBias: 0
m_EvsmVarianceBias: 0.00001
@@ -386,6 +387,9 @@ MonoBehaviour:
useVolumetric: 1
featuresFoldout: 1
showAdditionalSettings: 0
+ m_AreaLightEmissiveMeshShadowCastingMode: 0
+ m_AreaLightEmissiveMeshMotionVectorGenerationMode: 0
+ m_AreaLightEmissiveMeshLayer: -1
--- !u!108 &570065532
Light:
m_ObjectHideFlags: 0
@@ -445,6 +449,7 @@ Light:
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
+ m_UseViewFrustumForShadowCasterCull: 1
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &570065533
@@ -539,6 +544,7 @@ MonoBehaviour:
m_LightShadowRadius: 0.5
m_SemiTransparentShadow: 0
m_ColorShadow: 1
+ m_DistanceBasedFiltering: 0
m_EvsmExponent: 15
m_EvsmLightLeakBias: 0
m_EvsmVarianceBias: 0.00001
@@ -587,6 +593,9 @@ MonoBehaviour:
useVolumetric: 1
featuresFoldout: 1
showAdditionalSettings: 0
+ m_AreaLightEmissiveMeshShadowCastingMode: 0
+ m_AreaLightEmissiveMeshMotionVectorGenerationMode: 0
+ m_AreaLightEmissiveMeshLayer: -1
--- !u!108 &827110227
Light:
m_ObjectHideFlags: 0
@@ -646,6 +655,7 @@ Light:
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
+ m_UseViewFrustumForShadowCasterCull: 1
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &827110228
@@ -936,107 +946,6 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: f33dbc7bed7e0504b8fd0445f7e3b620, type: 3}
---- !u!114 &1241103833
-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: 59b6606ef2548734bb6d11b9d160bc7e, type: 3}
- m_Name:
- m_EditorClassIdentifier:
- active: 1
- m_AdvancedMode: 0
- rotation:
- m_OverrideState: 0
- m_Value: 0
- min: 0
- max: 360
- skyIntensityMode:
- m_OverrideState: 0
- m_Value: 0
- exposure:
- m_OverrideState: 0
- m_Value: -5
- multiplier:
- m_OverrideState: 0
- m_Value: 1
- min: 0
- upperHemisphereLuxValue:
- m_OverrideState: 0
- m_Value: 1
- min: 0
- upperHemisphereLuxColor:
- m_OverrideState: 0
- m_Value: {x: 0, y: 0, z: 0}
- desiredLuxValue:
- m_OverrideState: 0
- m_Value: 20000
- updateMode:
- m_OverrideState: 0
- m_Value: 0
- updatePeriod:
- m_OverrideState: 0
- m_Value: 0
- min: 0
- includeSunInBaking:
- m_OverrideState: 0
- m_Value: 0
- hdriSky:
- m_OverrideState: 0
- m_Value: {fileID: 8900000, guid: 614ae0372d7dfb847a1926990e89fa06, type: 3}
- enableBackplate:
- m_OverrideState: 0
- m_Value: 0
- backplateType:
- m_OverrideState: 0
- m_Value: 0
- groundLevel:
- m_OverrideState: 0
- m_Value: 0
- scale:
- m_OverrideState: 0
- m_Value: {x: 32, y: 32}
- projectionDistance:
- m_OverrideState: 0
- m_Value: 16
- min: 0.0000001
- plateRotation:
- m_OverrideState: 0
- m_Value: 0
- min: 0
- max: 360
- plateTexRotation:
- m_OverrideState: 0
- m_Value: 0
- min: 0
- max: 360
- plateTexOffset:
- m_OverrideState: 0
- m_Value: {x: 0, y: 0}
- blendAmount:
- m_OverrideState: 0
- m_Value: 0
- min: 0
- max: 100
- shadowTint:
- m_OverrideState: 0
- m_Value: {r: 0.5, g: 0.5, b: 0.5, a: 1}
- hdr: 0
- showAlpha: 1
- showEyeDropper: 1
- pointLightShadow:
- m_OverrideState: 0
- m_Value: 0
- dirLightShadow:
- m_OverrideState: 0
- m_Value: 0
- rectLightShadow:
- m_OverrideState: 0
- m_Value: 0
--- !u!1001 &1579846449
PrefabInstance:
m_ObjectHideFlags: 0
@@ -1156,7 +1065,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3}
m_Name:
m_EditorClassIdentifier:
- m_Version: 9
+ m_Version: 11
m_ObsoleteShadowResolutionTier: 1
m_ObsoleteUseShadowQualitySettings: 0
m_ObsoleteCustomShadowResolution: 512
@@ -1204,6 +1113,7 @@ MonoBehaviour:
m_LightShadowRadius: 0.5
m_SemiTransparentShadow: 0
m_ColorShadow: 1
+ m_DistanceBasedFiltering: 0
m_EvsmExponent: 15
m_EvsmLightLeakBias: 0
m_EvsmVarianceBias: 0.00001
@@ -1252,6 +1162,9 @@ MonoBehaviour:
useVolumetric: 1
featuresFoldout: 1
showAdditionalSettings: 0
+ m_AreaLightEmissiveMeshShadowCastingMode: 0
+ m_AreaLightEmissiveMeshMotionVectorGenerationMode: 0
+ m_AreaLightEmissiveMeshLayer: -1
--- !u!108 &1702691013
Light:
m_ObjectHideFlags: 0
@@ -1311,6 +1224,7 @@ Light:
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
+ m_UseViewFrustumForShadowCasterCull: 1
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &1702691014
@@ -1528,9 +1442,6 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_Profile: {fileID: 11400000, guid: 3a3ec6c25a1d5b846b231c284f4d2cac, type: 2}
m_StaticLightingSkyUniqueID: 1
- m_SkySettings: {fileID: 1241103833}
- m_SkySettingsFromProfile: {fileID: 7403965000729074061, guid: 3a3ec6c25a1d5b846b231c284f4d2cac,
- type: 2}
--- !u!4 &2058112915
Transform:
m_ObjectHideFlags: 1
@@ -1636,5 +1547,15 @@ PrefabInstance:
propertyPath: checkMemoryAllocation
value: 0
objectReference: {fileID: 0}
+ - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
+ type: 3}
+ propertyPath: ImageComparisonSettings.PerPixelCorrectnessThreshold
+ value: 0.0015
+ objectReference: {fileID: 0}
+ - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
+ type: 3}
+ propertyPath: ImageComparisonSettings.AverageCorrectnessThreshold
+ value: 0.00015
+ objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3}
diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1206_Lit_Transparent_Distortion.unity b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1206_Lit_Transparent_Distortion.unity
index 584127839bd..2fbbee9c8b8 100644
--- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1206_Lit_Transparent_Distortion.unity
+++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1206_Lit_Transparent_Distortion.unity
@@ -7160,16 +7160,6 @@ PrefabInstance:
propertyPath: ImageComparisonSettings.TargetHeight
value: 720
objectReference: {fileID: 0}
- - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
- type: 3}
- propertyPath: xrThresholdMultiplier
- value: 2
- objectReference: {fileID: 0}
- - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
- type: 3}
- propertyPath: xrCompatible
- value: 0
- objectReference: {fileID: 0}
- target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 3}
propertyPath: ImageComparisonSettings.AverageCorrectnessThreshold
diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1219_Lit_Light_on_Tesselation.unity b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1219_Lit_Light_on_Tesselation.unity
index e506bb07623..74e66d38755 100644
--- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1219_Lit_Light_on_Tesselation.unity
+++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/1x_Materials/1219_Lit_Light_on_Tesselation.unity
@@ -515,7 +515,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3}
m_Name:
m_EditorClassIdentifier:
- m_Material: {fileID: 0}
+ m_Material: {fileID: 2100000, guid: a3cf16179af19304a86953a01f59cf4d, type: 2}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
@@ -901,11 +901,6 @@ PrefabInstance:
propertyPath: checkMemoryAllocation
value: 0
objectReference: {fileID: 0}
- - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
- type: 3}
- propertyPath: xrCompatible
- value: 0
- objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3}
--- !u!20 &1172859778 stripped
diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2008_Light_Volumetrics.unity b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2008_Light_Volumetrics.unity
index 3b2a74c5523..f0d812f183e 100644
--- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2008_Light_Volumetrics.unity
+++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2008_Light_Volumetrics.unity
@@ -2128,16 +2128,6 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
- type: 3}
- propertyPath: xrLayout
- value: 0
- objectReference: {fileID: 0}
- - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
- type: 3}
- propertyPath: xrThresholdMultiplier
- value: 3
- objectReference: {fileID: 0}
- target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 3}
propertyPath: m_Version
diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/3x_DebugView/3003_LightingMode.unity b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/3x_DebugView/3003_LightingMode.unity
index 50d8ff8583d..1b013f86745 100644
--- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/3x_DebugView/3003_LightingMode.unity
+++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/3x_DebugView/3003_LightingMode.unity
@@ -3636,11 +3636,6 @@ PrefabInstance:
propertyPath: captureFramerate
value: 30
objectReference: {fileID: 0}
- - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
- type: 3}
- propertyPath: xrCompatible
- value: 0
- objectReference: {fileID: 0}
- target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 3}
propertyPath: ImageComparisonSettings.TargetWidth
diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4052_TAA.unity b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4052_TAA.unity
index be528f3b965..a9175d91f8a 100644
--- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4052_TAA.unity
+++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4052_TAA.unity
@@ -4387,7 +4387,7 @@ PrefabInstance:
- target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 3}
propertyPath: waitFrames
- value: 16
+ value: 64
objectReference: {fileID: 0}
- target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 3}
@@ -4397,8 +4397,8 @@ PrefabInstance:
type: 2}
- target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 3}
- propertyPath: xrCompatible
- value: 0
+ propertyPath: xrThresholdMultiplier
+ value: 1.5
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3}
diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4053_TAA-FP16Alpha.unity b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4053_TAA-FP16Alpha.unity
index 9eba779d282..b41f87d978c 100644
--- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4053_TAA-FP16Alpha.unity
+++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/4x_PostProcessing/4053_TAA-FP16Alpha.unity
@@ -4384,11 +4384,6 @@ PrefabInstance:
propertyPath: ImageComparisonSettings.TargetHeight
value: 512
objectReference: {fileID: 0}
- - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
- type: 3}
- propertyPath: waitFrames
- value: 16
- objectReference: {fileID: 0}
- target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 3}
propertyPath: renderPipelineAsset
@@ -4397,8 +4392,13 @@ PrefabInstance:
type: 2}
- target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 3}
- propertyPath: xrCompatible
- value: 0
+ propertyPath: waitFrames
+ value: 64
+ objectReference: {fileID: 0}
+ - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
+ type: 3}
+ propertyPath: xrThresholdMultiplier
+ value: 1.2
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c07ace9ab142ca9469fa377877c2f1e7, type: 3}
diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5001_Fog_FogFallback.unity b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5001_Fog_FogFallback.unity
index 39fbf073d92..4c039f24350 100644
--- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5001_Fog_FogFallback.unity
+++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5001_Fog_FogFallback.unity
@@ -3706,11 +3706,6 @@ PrefabInstance:
propertyPath: ImageComparisonSettings.TargetWidth
value: 640
objectReference: {fileID: 0}
- - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
- type: 3}
- propertyPath: xrThresholdMultiplier
- value: 2
- objectReference: {fileID: 0}
- target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 3}
propertyPath: m_Version
diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5002_Fog_DensityVolumes.unity b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5002_Fog_DensityVolumes.unity
index 4075359ea2a..ca134ed3db6 100644
--- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5002_Fog_DensityVolumes.unity
+++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5002_Fog_DensityVolumes.unity
@@ -966,16 +966,6 @@ PrefabInstance:
propertyPath: near clip plane
value: 147
objectReference: {fileID: 0}
- - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
- type: 3}
- propertyPath: xrLayout
- value: 0
- objectReference: {fileID: 0}
- - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
- type: 3}
- propertyPath: xrThresholdMultiplier
- value: 5
- objectReference: {fileID: 0}
- target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 3}
propertyPath: clearColorMode
diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5003_Fog_DensityVolumesShadows.unity b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5003_Fog_DensityVolumesShadows.unity
index 9892669773d..d5f632e4fa3 100644
--- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5003_Fog_DensityVolumesShadows.unity
+++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5003_Fog_DensityVolumesShadows.unity
@@ -1523,11 +1523,6 @@ PrefabInstance:
propertyPath: near clip plane
value: 10
objectReference: {fileID: 0}
- - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
- type: 3}
- propertyPath: xrThresholdMultiplier
- value: 1.2
- objectReference: {fileID: 0}
- target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 3}
propertyPath: clearColorMode
diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5008_FogFiltering.unity b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5008_FogFiltering.unity
index 43a89a9d66d..33754599b69 100644
--- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5008_FogFiltering.unity
+++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5008_FogFiltering.unity
@@ -1139,11 +1139,6 @@ PrefabInstance:
propertyPath: xrLayout
value: 0
objectReference: {fileID: 0}
- - target: {fileID: 114995348509370400, guid: c07ace9ab142ca9469fa377877c2f1e7,
- type: 3}
- propertyPath: xrThresholdMultiplier
- value: 4
- objectReference: {fileID: 0}
- target: {fileID: 114777190906822814, guid: c07ace9ab142ca9469fa377877c2f1e7,
type: 3}
propertyPath: m_Version
diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8101_Opaque.unity b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8101_Opaque.unity
index 77d0a88b2ef..00448ec6b12 100644
--- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8101_Opaque.unity
+++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8101_Opaque.unity
@@ -3713,11 +3713,6 @@ PrefabInstance:
propertyPath: xrLayout
value: 0
objectReference: {fileID: 0}
- - target: {fileID: 3711618258570137585, guid: 5f639aeb2b271eb458c4303b4c365c42,
- type: 3}
- propertyPath: xrThresholdMultiplier
- value: 1.5
- objectReference: {fileID: 0}
- target: {fileID: 3711618258570137585, guid: 5f639aeb2b271eb458c4303b4c365c42,
type: 3}
propertyPath: compareSGtoBI
diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8102_Transparent.unity b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8102_Transparent.unity
index f52ff70f9e4..c4c98213c7f 100644
--- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8102_Transparent.unity
+++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/8x_ShaderGraph/8102_Transparent.unity
@@ -7772,16 +7772,6 @@ PrefabInstance:
propertyPath: xrLayout
value: 0
objectReference: {fileID: 0}
- - target: {fileID: 3711618258570137585, guid: 5f639aeb2b271eb458c4303b4c365c42,
- type: 3}
- propertyPath: xrThresholdMultiplier
- value: 2
- objectReference: {fileID: 0}
- - target: {fileID: 3711618258570137585, guid: 5f639aeb2b271eb458c4303b4c365c42,
- type: 3}
- propertyPath: xrCompatible
- value: 0
- objectReference: {fileID: 0}
- target: {fileID: 3711618258570137585, guid: 5f639aeb2b271eb458c4303b4c365c42,
type: 3}
propertyPath: compareSGtoBI
diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/1710_Decals_Normal_Patch.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/1710_Decals_Normal_Patch.png
index 3160433f359..6b0d03c7ce5 100644
--- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/1710_Decals_Normal_Patch.png
+++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/1710_Decals_Normal_Patch.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:c70bf0b1d29454fd2ae35267909ea4aea9aed834361bf6e22b333743b49c88ce
-size 64825
+oid sha256:f88a489c493599efbc5b5e496ea2c111268547fcb6e0328a2b6bf678e2c3b795
+size 64762
diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/2316_ShadowTint.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/2316_ShadowTint.png
index 719eab3a10a..3de6aa28c2a 100644
--- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/2316_ShadowTint.png
+++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/2316_ShadowTint.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:556bc8905ef1f0f78382707adf52761e3d0a2a1b4e04185f255fdb8e7c72a7b4
-size 132133
+oid sha256:20eecf74d442bf8274e87a9bdf1b285a4bc300fbbba734ecfccb09dce972a029
+size 132210
diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4052_TAA.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4052_TAA.png
index b9cee295825..4534ab5eb74 100644
--- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4052_TAA.png
+++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4052_TAA.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:f90527963f85df4a36a98bf60cbbd6203cb3379d4885521eca541c3c67b8073e
-size 187901
+oid sha256:1d43ff69730e73cf5f93d14ce3a093740ee5839a8a152c89dee4e9c1c06fafe7
+size 194711
diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4053_TAA-FP16Alpha.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4053_TAA-FP16Alpha.png
index 549ada13458..ea3c26da255 100644
--- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4053_TAA-FP16Alpha.png
+++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/4053_TAA-FP16Alpha.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:186bf2559b16eda39147aba174f30a9abe574e6b414712050f889d7beba7e3cb
-size 194221
+oid sha256:5866c1b5d1defd13350f2a763578af5178acb60fee881fbb959f49c73e2d0631
+size 201221
diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/2316_ShadowTint.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/2316_ShadowTint.png
index 2f47f44b642..7b4f5b8d9e6 100644
--- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/2316_ShadowTint.png
+++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/2316_ShadowTint.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:eb2e73e1a1634b312caf56bafdf6f4ca3aa1adf1a3bbae73e2a83bbb1a46327d
-size 150635
+oid sha256:b95a631d6ffc2155cf258c1cc36b496ac5ebdd8ec068d48b1f4e885b86de5d3e
+size 132553
diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4052_TAA.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4052_TAA.png
index 0523ea16346..4dbe4daad35 100644
--- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4052_TAA.png
+++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4052_TAA.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:f9d8deaa819bce83e40bd6c9d47e90baf6c1a4547b20f6ea1ef81fbd93c444c1
-size 206330
+oid sha256:c812051d824a98920aff0d715b1f64e2065948e4d2e0d164cb3f29183ec276c1
+size 195032
diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4053_TAA-FP16Alpha.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4053_TAA-FP16Alpha.png
index 0a3fc7064a4..ea3c26da255 100644
--- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4053_TAA-FP16Alpha.png
+++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/4053_TAA-FP16Alpha.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:3082a5bf3b0789bebcc2f9900a75a089e50554b7772e989dd73dd28111af5501
-size 193535
+oid sha256:5866c1b5d1defd13350f2a763578af5178acb60fee881fbb959f49c73e2d0631
+size 201221
diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/1710_Decals_Normal_Patch.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/1710_Decals_Normal_Patch.png
index 73d9014de29..aed1136c294 100644
--- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/1710_Decals_Normal_Patch.png
+++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/1710_Decals_Normal_Patch.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:e898c5376c1bca56fb871744aeef8d5c98e7149f45b3dddc60d86c04c020f0fe
-size 73641
+oid sha256:8829e682d4f00468d26f6305c3c9504b7012e95179db779639d233f82021c285
+size 65062
diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4052_TAA.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4052_TAA.png
index 74f02c673b8..5ad4ba31e42 100644
--- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4052_TAA.png
+++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4052_TAA.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:145b0780ede384e35c9499d49c6b7cbfb63ca0656fdd04753049d863d27d9e93
-size 191494
+oid sha256:da78f222b1a08ccc6d7fea0a4ccba9f647b7ef7ee8e3f9d3680c5ffa8b0071bd
+size 219643
diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4053_TAA-FP16Alpha.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4053_TAA-FP16Alpha.png
index 82a7c7221bd..8e234a593f3 100644
--- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4053_TAA-FP16Alpha.png
+++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/4053_TAA-FP16Alpha.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:190ee024891eed677baee1202026bb46be278f34b8d81cec519f93b516185b07
-size 193796
+oid sha256:56ec8f34c3b18eae5110a53c3f6fe887d8307768e9234abba7a816ce77515bca
+size 201305
diff --git a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/9301_MotionVectorsOff-Forward-Dynamic.png b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/9301_MotionVectorsOff-Forward-Dynamic.png
index d5cef54797e..09cecfd49c3 100644
--- a/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/9301_MotionVectorsOff-Forward-Dynamic.png
+++ b/TestProjects/HDRP_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Vulkan/None/9301_MotionVectorsOff-Forward-Dynamic.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:288b7f2ff2c81867b81a9e43dcd18617dd8184d70b04546cde16138ba4617269
-size 17235
+oid sha256:f05780400cb917871e710c5b1b489647afa629b88064aa877ebe79a3af97c193
+size 14683
diff --git a/com.unity.render-pipelines.core/Runtime/Textures/RTHandleSystem.cs b/com.unity.render-pipelines.core/Runtime/Textures/RTHandleSystem.cs
index 77e517d38b2..80b43911efb 100644
--- a/com.unity.render-pipelines.core/Runtime/Textures/RTHandleSystem.cs
+++ b/com.unity.render-pipelines.core/Runtime/Textures/RTHandleSystem.cs
@@ -143,7 +143,19 @@ public void ResetReferenceSize(int width, int height)
/// Reference rendering width for subsequent rendering.
/// Reference rendering height for subsequent rendering.
/// Number of MSAA samples for multisampled textures for subsequent rendering.
- public void SetReferenceSize(int width, int height, MSAASamples msaaSamples, bool reset = false)
+ public void SetReferenceSize(int width, int height, MSAASamples msaaSamples)
+ {
+ SetReferenceSize(width, height, msaaSamples, false);
+ }
+
+ ///
+ /// Sets the reference rendering size for subsequent rendering for the RTHandle System
+ ///
+ /// Reference rendering width for subsequent rendering.
+ /// Reference rendering height for subsequent rendering.
+ /// Number of MSAA samples for multisampled textures for subsequent rendering.
+ /// If set to true, the new width and height will override the old values even if they are not bigger.
+ public void SetReferenceSize(int width, int height, MSAASamples msaaSamples, bool reset)
{
m_RTHandleProperties.previousViewportSize = m_RTHandleProperties.currentViewportSize;
m_RTHandleProperties.previousRenderTargetSize = m_RTHandleProperties.currentRenderTargetSize;
diff --git a/com.unity.render-pipelines.core/Runtime/Utilities/CoreUtils.cs b/com.unity.render-pipelines.core/Runtime/Utilities/CoreUtils.cs
index 19818aec801..81943df43d7 100644
--- a/com.unity.render-pipelines.core/Runtime/Utilities/CoreUtils.cs
+++ b/com.unity.render-pipelines.core/Runtime/Utilities/CoreUtils.cs
@@ -1124,6 +1124,32 @@ public static bool IsSceneLightingDisabled(Camera camera)
return disabled;
}
+ ///
+ /// Returns true if the "Light Overlap" scene view draw mode is enabled.
+ ///
+ /// Input camera.
+ /// True if "Light Overlap" is enabled in the scene view associated with the input camera.
+ public static bool IsLightOverlapDebugEnabled(Camera camera)
+ {
+ bool enabled = false;
+#if UNITY_EDITOR
+ if (camera.cameraType == CameraType.SceneView)
+ {
+ // Determine whether the "LightOverlap" mode is enabled for the current view.
+ for (int i = 0; i < UnityEditor.SceneView.sceneViews.Count; i++)
+ {
+ var sv = UnityEditor.SceneView.sceneViews[i] as UnityEditor.SceneView;
+ if (sv.camera == camera && sv.cameraMode.drawMode == UnityEditor.DrawCameraMode.LightOverlap)
+ {
+ enabled = true;
+ break;
+ }
+ }
+ }
+#endif
+ return enabled;
+ }
+
#if UNITY_EDITOR
static Func> materialEditors;
diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md
index c3277c8cb3d..51faa6ac56f 100644
--- a/com.unity.render-pipelines.high-definition/CHANGELOG.md
+++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md
@@ -609,6 +609,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed the show cookie atlas debug mode not displaying correctly when enabling the clear cookie atlas option.
- Fixed various multi-editing issues when changing Emission parameters.
- Fixed error when undo a Reflection Probe removal in a prefab instance. (case 1244047)
+- Tentative fix for missing include in depth of field shaders.
+- Fixed the light overlap scene view draw mode (wasn't working at all).
+- Fixed taaFrameIndex and XR tests 4052 and 4053
### Changed
- Improve MIP selection for decals on Transparents
@@ -736,6 +739,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Improved performance of reflection probe management when using a lot of probes.
- Ignoring the disable SSR flags for recursive rendering.
- Removed logic in the UI to disable parameters for contact shadows and fog volume components as it was going against the concept of the volume system.
+- Fixed the sub surface mask not being taken into account when computing ray traced sub surface scattering.
## [7.1.1] - 2019-09-05
diff --git a/com.unity.render-pipelines.high-definition/Documentation~/AOVs.md b/com.unity.render-pipelines.high-definition/Documentation~/AOVs.md
new file mode 100644
index 00000000000..f9486c807a4
--- /dev/null
+++ b/com.unity.render-pipelines.high-definition/Documentation~/AOVs.md
@@ -0,0 +1,116 @@
+# Arbitrary Output Variables
+
+Arbitrary Output Variables (AOVs) are additional images that an [HDRP Camera](HDRP-Camera.md) can generate. They can output additional information per pixel, which you can use later for compositing or additional image processing (such as denoising).
+
+Here is an example of three AOVs, containing from left to right the Albedo, Normal, and Object ID of each pixel:
+
+
+
+In HDRP, you can access and configure AOVs in the following ways:
+- Using the [HDRP Compositor tool](Compositor-Main).
+- Using the [Unity Recorder](https://docs.unity3d.com/Packages/com.unity.recorder@latest/index.html) and the [AOV Recorder](https://docs.unity3d.com/Packages/com.unity.aovrecorder@latest/index.html) packages.
+- Using the scripting API to set up a custom AOV request in any HDRP Camera in your Scene.
+
+The first two options offer a limited selection of AOVs in their User Interface, while the third option allows for much more flexibility on what data an HDRP Camera can output.
+
+## Material property AOVs
+Here is the list of Material properties that you can access with the AOV API.
+
+| Material property | Description |
+|-------------------|---------------------------|
+| **Normal** | Outputs the surface albedo. |
+| **Albedo** | Outputs the surface normal. |
+| **Smoothness** | Outputs the surface smoothness. |
+| **Ambient Occlusion** | Outputs the ambient occlusion (N/A for AxF). |
+| **Specular** | Outputs the surface specularity. |
+| **Alpha** | Outputs the surface alpha (pixel coverage). |
+
+## Lighting selection with AOVs
+You can use AOVs to output the contribution from a selected list of [Lights](Light-Component.md), or you can use them to output only specific components of the lighting.
+
+| Lighting property | Description |
+|-------------------|---------------------------|
+| **DiffuseOnly** | Renders only diffuse lighting (direct and indirect). |
+| **SpecularOnly** | Renders only specular lighting (direct and indirect). |
+| **DirectDiffuseOnly** | Renders only direct diffuse lighting. |
+| **DirectSpecularOnly** | Renders only direct specular lighting. |
+| **IndirectDiffuseOnly** | Renders only indirect diffuse lighting. |
+| **ReflectionOnly** | Renders only reflections. |
+| **RefractionOnly** | Renders only refractions. |
+| **EmissiveOnly** | Renders only emissive lighting. |
+
+## Custom Pass AOVs
+Finally, you can use AOVs to output the results of [custom passes](Custom-Pass.md). In particular, you can output the cumulative results of all custom passes that are active on every custom pass injection point. This can be useful to output arbitrary information that custom passes compute, such as the Object ID of the Scene GameObjects.
+
+## Scripting API example
+The following example script outputs albedo AOVs from an HDRP Camera and saves the resulting frames to disk as a sequence of .png images. To use the example script, attach it to an HDRP Camera and enter Play Mode.
+```
+using UnityEngine;
+using UnityEngine.Rendering;
+using UnityEngine.Rendering.HighDefinition;
+using UnityEngine.Rendering.HighDefinition.Attributes;
+
+public class AovRecorder : MonoBehaviour
+{
+ RTHandle m_TmpRT; // The RTHandle used to render the AOV
+ Texture2D m_ReadBackTexture;
+
+ int m_Frames = 0;
+
+ // Start is called before the first frame update
+ void Start()
+ {
+ var camera = gameObject.GetComponent();
+ if (camera != null)
+ {
+ var hdAdditionalCameraData = gameObject.GetComponent();
+ if (hdAdditionalCameraData != null)
+ {
+ // initialize a new AOV request
+ var aovRequest = AOVRequest.NewDefault();
+
+ AOVBuffers[] aovBuffers = null;
+ CustomPassAOVBuffers[] customPassAovBuffers = null;
+
+ // Request an AOV with the surface albedo
+ aovRequest.SetFullscreenOutput(MaterialSharedProperty.Albedo);
+ aovBuffers = new[] { AOVBuffers.Color };
+
+ // Allocate the RTHandle that will store the intermediate results
+ m_TmpRT = RTHandles.Alloc(camera.pixelWidth, camera.pixelHeight);
+
+ // Add the request to a new AOVRequestBuilder
+ var aovRequestBuilder = new AOVRequestBuilder();
+ aovRequestBuilder.Add(aovRequest,
+ bufferId => m_TmpRT,
+ null,
+ aovBuffers,
+ customPassAovBuffers,
+ bufferId => m_TmpRT,
+ (cmd, textures, customPassTextures, properties) =>
+ {
+ // callback to read back the AOV data and write them to disk
+ if (textures.Count > 0)
+ {
+ m_ReadBackTexture = m_ReadBackTexture ?? new Texture2D(camera.pixelWidth, camera.pixelHeight, TextureFormat.RGBAFloat, false);
+ RenderTexture.active = textures[0].rt;
+ m_ReadBackTexture.ReadPixels(new Rect(0, 0, camera.pixelWidth, camera.pixelHeight), 0, 0, false);
+ m_ReadBackTexture.Apply();
+ RenderTexture.active = null;
+ byte[] bytes = m_ReadBackTexture.EncodeToPNG();
+ System.IO.File.WriteAllBytes($"output_{m_Frames++}.png", bytes);
+ }
+
+ });
+
+ // Now build the AOV request
+ var aovRequestDataCollection = aovRequestBuilder.Build();
+
+ // And finally set the request to the camera
+ hdAdditionalCameraData.SetAOVRequests(aovRequestDataCollection);
+ }
+ }
+ }
+}
+
+```
\ No newline at end of file
diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Accumulation.md b/com.unity.render-pipelines.high-definition/Documentation~/Accumulation.md
new file mode 100644
index 00000000000..b0c50801f05
--- /dev/null
+++ b/com.unity.render-pipelines.high-definition/Documentation~/Accumulation.md
@@ -0,0 +1,121 @@
+## Multiframe rendering and accumulation
+
+Some rendering techniques, such as [path tracing](Ray-Tracing-Path-Tracing.md) and accumulation motion blur, combine information from multiple intermediate sub-frames to create a final "converged" frame. Each intermediate sub-frame can correspond to a slightly different point in time, effectively computing physically-based accumulation motion blur, which properly takes into account object rotations, deformations, material or lighting changes.
+
+The High Definition Render Pipeline (HDRP) provides a scripting API that allows you to control the creation of sub-frames and the convergence of multi-frame rendering effects. In particular, the API allows you to control the number of intermediate sub-frames (samples) and the points in time that correspond to each one of them. Furthermore, you can use a shutter profile to control the weights of each sub-frame. A shutter profile describes how fast the physical camera opens and closes its shutter.
+
+This API is particularly useful when recording path-traced movies. Normally, when editing a Scene, the convergence of path tracing restarts every time the Scene changes, to provide artists an interactive editing workflow that allows them to quickly visualize their changes. However such behavior is not desirable during recording.
+
+The following image shows a rotating GameObject with path tracing and accumulation motion blur, recorded using the multi-frame recording API.
+
+
+
+## API overview
+The recording API is available in HDRP and has three calls:
+- **BeginRecording**: Call this when you want to start a multi-frame render.
+- **PrepareNewSubFrame**: Call this before rendering a new subframe.
+- **EndRecording**: Call this when you want to stop the multi-frame render.
+
+The only call that takes any parameters is **BeginRecording**. Here is an explanation of the parameters:
+
+| Parameter | Description |
+|-------------------|---------------------------|
+| **Samples** | The number of sub-frames to accumulate. This parameter overrides the number of path tracing samples in the [Volume](Volumes.md). |
+| **ShutterInterval** | The amount of time the shutter is open between two subsequent frames. A value of **0** results in an instant shutter (no motion blur). A value of **1** means there is no (time) gap between two subsequent frames. |
+| **ShutterProfile** | An animation curve that specifies the shutter position during the shutter interval. Alternatively, you can also provide the time the shutter was fully open; and when the shutter begins closing. |
+
+The example script below demonstrates how to use these API calls.
+
+## Scripting API example
+The following example demonstrates how to use the multi-frame rendering API in your scripts to properly record converged animation sequences with path tracing and/or accumulation motion blur. To use it, attach the script to a Camera in your Scene and, in the component's context menu, click the “Start Recording” and “Stop Recording” actions.
+
+```
+using UnityEngine;
+using UnityEngine.Rendering;
+using UnityEngine.Rendering.HighDefinition;
+
+public class FrameManager : MonoBehaviour
+{
+ // The number of samples used for accumumation.
+ public int samples = 128;
+ [Range(0.0f, 1.0f)]
+ public float shutterInterval = 1.0f;
+
+ // The time during shutter interval when the shutter is fully open
+ [Range(0.0f, 1.0f)]
+ public float shutterFullyOpen = 0.25f;
+
+ // The time during shutter interval when the shutter begins closing.
+ [Range(0.0f, 1.0f)]
+ public float shutterBeginsClosing = 0.75f;
+
+ bool m_Recording = false;
+ int m_Iteration = 0;
+ int m_RecordedFrames = 0;
+
+ [ContextMenu("Start Recording")]
+ void BeginMultiframeRendering()
+ {
+ RenderPipelineManager.beginFrameRendering += PrepareSubFrameCallBack;
+ HDRenderPipeline renderPipeline = RenderPipelineManager.currentPipeline as HDRenderPipeline;
+ renderPipeline.BeginRecording(samples, shutterInterval, shutterFullyOpen, shutterBeginsClosing);
+ m_Recording = true;
+ m_Iteration = 0;
+ m_RecordedFrames = 0;
+ }
+
+ [ContextMenu("Stop Recording")]
+ void StopMultiframeRendering()
+ {
+ RenderPipelineManager.beginFrameRendering -= PrepareSubFrameCallBack;
+ HDRenderPipeline renderPipeline = RenderPipelineManager.currentPipeline as HDRenderPipeline;
+ renderPipeline.EndRecording();
+ m_Recording = false;
+ }
+
+ void PrepareSubFrameCallBack(ScriptableRenderContext cntx, Camera[] cams)
+ {
+ HDRenderPipeline renderPipeline = RenderPipelineManager.currentPipeline as HDRenderPipeline;
+ if (renderPipeline != null && m_Recording)
+ {
+ renderPipeline.PrepareNewSubFrame();
+ m_Iteration++;
+ }
+
+ if (m_Recording && m_Iteration % samples == 0)
+ {
+ ScreenCapture.CaptureScreenshot($"frame_{m_RecordedFrames++}.png");
+ }
+ }
+
+ void OnDestroy()
+ {
+ if (m_Recording)
+ {
+ StopMultiframeRendering();
+ }
+ }
+
+ void OnValidate()
+ {
+ // Make sure the shutter will begin closing sometime after it is fully open (and not before)
+ shutterBeginsClosing = Mathf.Max(shutterFullyOpen, shutterBeginsClosing);
+ }
+}
+```
+
+## Shutter profiles
+The **BeginRecording** call allows you to specify how fast the camera shutter opens and closes. The speed of the camera shutter defines the so called “shutter profile”. The following image demonstrates how different shutter profiles affect the appearance of motion blur on a blue sphere moving from left to right.
+
+
+
+In all cases, the speed of the sphere is the same. The only change is the shutter profile. The horizontal axis of the profile diagram corresponds to time, and the vertical axis corresponds to the openning of the shutter.
+
+You can easily define the first three profiles without using an animation curve by setting the open, close parameters to (0,1), (1,1), and (0.25, 0.75) respectively. The last profile requires the use of an animation curve.
+
+In this example, you can see that the slow open profile creates a motion trail appearance for the motion blur, which might be more desired for artists. On the other hand, the smooth open and close profile creates smoother animations than the slow open or uniform profiles.
+
+## Limitations
+The multi-frame rendering API internally changes the `Time.timeScale` of the Scene. This means that:
+- You cannot have different accumulation motion blur parameters per camera.
+- Projects that already modify this parameter per frame are not be compatible with this feature.
\ No newline at end of file
diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Images/Path-traced-DoF.png b/com.unity.render-pipelines.high-definition/Documentation~/Images/Path-traced-DoF.png
new file mode 100644
index 00000000000..699dff4285c
--- /dev/null
+++ b/com.unity.render-pipelines.high-definition/Documentation~/Images/Path-traced-DoF.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:464664685962ce66588795cb8d58929811907f5be7cd127dca7ec4824d3d0a97
+size 4711889
diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Images/aov_example.png b/com.unity.render-pipelines.high-definition/Documentation~/Images/aov_example.png
new file mode 100644
index 00000000000..ef3c8384ddf
--- /dev/null
+++ b/com.unity.render-pipelines.high-definition/Documentation~/Images/aov_example.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0c9979af1a6a84124bcf96266f99560991e5ae6dfd26d7e44690f566ae27321e
+size 3072921
diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Images/path_tracing_recording.png b/com.unity.render-pipelines.high-definition/Documentation~/Images/path_tracing_recording.png
new file mode 100644
index 00000000000..a96c0a968f1
--- /dev/null
+++ b/com.unity.render-pipelines.high-definition/Documentation~/Images/path_tracing_recording.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7dba84aa5b5f551a7079184312690dd4abc4b3efe5dbef26cd4354795dface44
+size 1731166
diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Images/shutter_profiles.png b/com.unity.render-pipelines.high-definition/Documentation~/Images/shutter_profiles.png
new file mode 100644
index 00000000000..78b0a6a40a5
--- /dev/null
+++ b/com.unity.render-pipelines.high-definition/Documentation~/Images/shutter_profiles.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:00deb98061b54c0892adf169781533e635b05c49b498d657013756ad47010a83
+size 1024825
diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Post-Processing-Depth-of-Field.md b/com.unity.render-pipelines.high-definition/Documentation~/Post-Processing-Depth-of-Field.md
index a1e102757f5..447004a2a5b 100644
--- a/com.unity.render-pipelines.high-definition/Documentation~/Post-Processing-Depth-of-Field.md
+++ b/com.unity.render-pipelines.high-definition/Documentation~/Post-Processing-Depth-of-Field.md
@@ -63,4 +63,14 @@ This example shows how the **Blade Count** and **Curvature** properties affect t
* On the left side, there is a five blade iris that is slightly open; producing a pentagonal bokeh.
* On the right side, there is a five blade iris that is wide open; producing a circular bokeh.
-
\ No newline at end of file
+
+
+## Path-traced depth of field
+
+If you enable [path tracing](Ray-Tracing-Path-Tracing) and set **Focus Mode** to **Use Physical Camera**, HDRP computes depth of field directly during path tracing instead of as a post-processing effect.
+
+Path-traced depth of field produces images without any artifacts, apart from noise when using insufficient path-tracing samples. To reduce the noise level, increase the number of samples from the [Path Tracing](Ray-Tracing-Path-Tracing) settings and/or de-noise the final frame.
+
+HDRP computes path-traced depth of field at full resolution and ignores any quality settings from the Volume.
+
+
diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Light-Cluster.md b/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Light-Cluster.md
index f93a6a0f650..dcccec16d01 100644
--- a/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Light-Cluster.md
+++ b/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Light-Cluster.md
@@ -1,6 +1,6 @@
# Light Cluster
-To compute light bounces for ray-traced effects, such as [Reflections](Ray-Traced-Reflections.html), [Global Illumination](Ray-Traced-Global-Illumination.html), [Recursive Rendering](Ray-Tracing-Recursive-Rendering.html), or Path Tracing. HDRP uses a structure to store the set of [Lights](Light-Component.html) that affect each region. In rasterization, HDRP uses the tile structure for opaque objects and the cluster structure for transparent objects. The main difference between these two structures and this one used for ray tracing is that this one is not based on the Camera frustum.
+To compute light bounces for ray-traced effects, such as [Reflections](Ray-Traced-Reflections.html), [Global Illumination](Ray-Traced-Global-Illumination.html), [Recursive Rendering](Ray-Tracing-Recursive-Rendering.html), or path tracing. HDRP uses a structure to store the set of [Lights](Light-Component.html) that affect each region. In rasterization, HDRP uses the tile structure for opaque objects and the cluster structure for transparent objects. The main difference between these two structures and this one used for ray tracing is that this one is not based on the Camera frustum.
For ray tracing, HDRP builds an axis-aligned grid which, in each cell, stores the list of Lights to fetch if an intersection occurs in that cell. Use this [Volume Override](Volume-Components.html) to change how HDRP builds this structure.

diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Path-Tracing.md b/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Path-Tracing.md
index 700289c68e4..473fce82dc1 100644
--- a/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Path-Tracing.md
+++ b/com.unity.render-pipelines.high-definition/Documentation~/Ray-Tracing-Path-Tracing.md
@@ -22,11 +22,11 @@ Path tracing shares the general requirements and setup as other ray tracing effe
## Add path tracing to your Scene
-Path Tracing uses the [Volume](Volumes.html) framework, so to enable this feature, and modify its properties, you must add a Path Tracing override to a [Volume](Volumes.html) in your Scene. To do this:
+Path tracing uses the [Volume](Volumes.html) framework, so to enable this feature, and modify its properties, you must add a Path Tracing override to a [Volume](Volumes.html) in your Scene. To do this:
1. In the Scene or Hierarchy view, select a GameObject that contains a Volume component to view it in the Inspector.
2. In the Inspector, select Add Override > Path Tracing.
-3. In the Inspector for the Path Tracing Volume Override, check the Enable option. If you do not see the Enable option, make sure your HDRP Project supports ray tracing. For information on setting up ray tracing in HDRP, see [getting started with ray tracing](Ray-Tracing-Getting-Started.html). This switches HDRP to path traced rendering and you should initially see a noisy image that converges towards a clean result.
+3. In the Inspector for the Path Tracing Volume Override, check the Enable option. If you do not see the Enable option, make sure your HDRP Project supports ray tracing. For information on setting up ray tracing in HDRP, see [getting started with ray tracing](Ray-Tracing-Getting-Started.html). This switches HDRP to path-traced rendering and you should initially see a noisy image that converges towards a clean result.
4. If the image does not converge over time, select the drop-down next to the effect toggle and enable Animated Materials.

diff --git a/com.unity.render-pipelines.high-definition/Documentation~/TableOfContents.md b/com.unity.render-pipelines.high-definition/Documentation~/TableOfContents.md
index 495bbbb3c2a..3507974c933 100644
--- a/com.unity.render-pipelines.high-definition/Documentation~/TableOfContents.md
+++ b/com.unity.render-pipelines.high-definition/Documentation~/TableOfContents.md
@@ -101,6 +101,8 @@
* [Motion Vectors](Motion-Vectors)
* [Anti-Aliasing](Anti-Aliasing)
* [Alpha Output](Alpha-Output)
+ * [Arbitrary Output Variables](AOVs)
+ * [Multiframe Rendering and Accumulation](Accumulation)
* Post-processing
* [Post-processing in HDRP](Post-Processing-Main)
* [Effect Execution Order](Post-Processing-Execution-Order)
diff --git a/com.unity.render-pipelines.high-definition/Editor/AssetProcessors/MaterialPostProcessor.cs b/com.unity.render-pipelines.high-definition/Editor/AssetProcessors/MaterialPostProcessor.cs
index c27e91ce144..3724aad3c4d 100644
--- a/com.unity.render-pipelines.high-definition/Editor/AssetProcessors/MaterialPostProcessor.cs
+++ b/com.unity.render-pipelines.high-definition/Editor/AssetProcessors/MaterialPostProcessor.cs
@@ -67,7 +67,7 @@ static void RegisterUpgraderReimport()
{
string commandLineOptions = System.Environment.CommandLine;
bool inTestSuite = commandLineOptions.Contains("-testResults");
- if (!inTestSuite && fileExist)
+ if (!inTestSuite && fileExist && !Application.isBatchMode)
{
EditorUtility.DisplayDialog("HDRP Material upgrade", "The Materials in your Project were created using an older version of the High Definition Render Pipeline (HDRP)." +
" Unity must upgrade them to be compatible with your current version of HDRP. \n" +
diff --git a/com.unity.render-pipelines.high-definition/Editor/BuildProcessors/HDRPPreprocessShaders.cs b/com.unity.render-pipelines.high-definition/Editor/BuildProcessors/HDRPPreprocessShaders.cs
index c48a9c654a5..33bf4865b58 100644
--- a/com.unity.render-pipelines.high-definition/Editor/BuildProcessors/HDRPPreprocessShaders.cs
+++ b/com.unity.render-pipelines.high-definition/Editor/BuildProcessors/HDRPPreprocessShaders.cs
@@ -409,9 +409,15 @@ static void GetAllValidHDRPAssets()
}
// Prompt a warning if we find 0 HDRP Assets.
- if (_hdrpAssets.Count == 0)
+ if (_hdrpAssets.Count == 0 && !Application.isBatchMode)
+ {
if (EditorUtility.DisplayDialog("HDRP Asset missing", "No HDRP Asset has been set in the Graphic Settings, and no potential used in the build HDRP Asset has been found. If you want to continue compiling, this might lead to VERY long compilation time.", "Ok", "Cancel"))
- throw new UnityEditor.Build.BuildFailedException("Build canceled");
+ throw new UnityEditor.Build.BuildFailedException("Build canceled");
+ }
+ else
+ {
+ Debug.LogWarning("There is no HDRP Asset provided in GraphicsSettings. Build time can be extremely long without it.");
+ }
/*
Debug.Log(string.Format("{0} HDRP assets in build:{1}",
diff --git a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugLightVolumes.compute b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugLightVolumes.compute
index 2d0faa53454..b5d937b117d 100644
--- a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugLightVolumes.compute
+++ b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugLightVolumes.compute
@@ -7,9 +7,6 @@
// Tile size of this compute
#define DEBUG_LIGHT_VOLUME_TILE_SIZE 8
-// The pixel radius to switch on the edge color
-#define RADIUS_PIXEL_BORDER 1
-
// Input Runtime textures
TEXTURE2D_X_FLOAT(_DebugLightCountBuffer);
TEXTURE2D_X(_DebugColorAccumulationBuffer);
@@ -17,6 +14,8 @@ TEXTURE2D_X(_DebugColorAccumulationBuffer);
// Data used for the computation
Texture2D _ColorGradientTexture;
int _MaxDebugLightCount;
+// The pixel radius to switch on the edge color
+float _BorderRadius;
// output texture
RW_TEXTURE2D_X(float4, _DebugLightVolumesTexture);
@@ -58,9 +57,9 @@ void LightVolumeColors(uint3 dispatchThreadId : SV_DispatchThreadID, uint2 group
// Look around this pixel to check if this should be displayed as a border
float maxLightCount = lightCount;
bool isBorder = false;
- for (int radiusX = -RADIUS_PIXEL_BORDER; radiusX <= RADIUS_PIXEL_BORDER; ++radiusX)
+ for (float radiusX = -_BorderRadius; radiusX <= _BorderRadius; ++radiusX)
{
- for (int radiusY = -RADIUS_PIXEL_BORDER; radiusY <= RADIUS_PIXEL_BORDER; ++radiusY)
+ for (float radiusY = -_BorderRadius; radiusY <= _BorderRadius; ++radiusY)
{
// Compute the target pixel
int2 targetpixel = int2((uint)currentPixelCoordinate.x + radiusX, (uint)currentPixelCoordinate.y + radiusY);
diff --git a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugLightVolumes.cs b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugLightVolumes.cs
index 47495addf93..6f09825a3dc 100644
--- a/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugLightVolumes.cs
+++ b/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugLightVolumes.cs
@@ -34,6 +34,7 @@ class DebugLightVolumes
public static readonly int _DebugLightVolumesTextureShaderID = Shader.PropertyToID("_DebugLightVolumesTexture");
public static readonly int _ColorGradientTextureShaderID = Shader.PropertyToID("_ColorGradientTexture");
public static readonly int _MaxDebugLightCountShaderID = Shader.PropertyToID("_MaxDebugLightCount");
+ public static readonly int _BorderRadiusShaderID = Shader.PropertyToID("_BorderRadius");
// Render target array for the prepass
RenderTargetIdentifier[] m_RTIDs = new RenderTargetIdentifier[2];
@@ -83,20 +84,26 @@ public struct RenderLightVolumesParameters
public ComputeShader debugLightVolumeCS;
public int debugLightVolumeKernel;
public int maxDebugLightCount;
+ public float borderRadius;
public Texture2D colorGradientTexture;
+ public bool lightOverlapEnabled;
}
public RenderLightVolumesParameters PrepareLightVolumeParameters(HDCamera hdCamera, LightingDebugSettings lightDebugSettings, CullingResults cullResults)
{
var parameters = new RenderLightVolumesParameters();
+ bool lightOverlapEnabled = CoreUtils.IsLightOverlapDebugEnabled(hdCamera.camera);
+ bool useColorAndEdge = lightDebugSettings.lightVolumeDebugByCategory == LightVolumeDebug.ColorAndEdge || lightOverlapEnabled;
parameters.hdCamera = hdCamera;
parameters.cullResults = cullResults;
parameters.debugLightVolumeMaterial = m_DebugLightVolumeMaterial;
parameters.debugLightVolumeCS = m_DebugLightVolumeCompute;
- parameters.debugLightVolumeKernel = lightDebugSettings.lightVolumeDebugByCategory == LightVolumeDebug.ColorAndEdge ? m_DebugLightVolumeColorsKernel : m_DebugLightVolumeGradientKernel;
+ parameters.debugLightVolumeKernel = useColorAndEdge ? m_DebugLightVolumeColorsKernel : m_DebugLightVolumeGradientKernel;
parameters.maxDebugLightCount = (int)lightDebugSettings.maxDebugLightCount;
+ parameters.borderRadius = lightOverlapEnabled ? 0.5f : 1f;
parameters.colorGradientTexture = m_ColorGradientTexture;
+ parameters.lightOverlapEnabled = lightOverlapEnabled;
return parameters;
}
@@ -111,104 +118,69 @@ public static void RenderLightVolumes(CommandBuffer cmd,
RTHandle destination,
MaterialPropertyBlock mpb)
{
- // Set the render target array
- CoreUtils.SetRenderTarget(cmd, accumulationMRT, depthBuffer);
- // First of all let's do the regions for the light sources (we only support Punctual and Area)
- int numLights = parameters.cullResults.visibleLights.Length;
- for (int lightIdx = 0; lightIdx < numLights; ++lightIdx)
+ if (parameters.lightOverlapEnabled)
{
- // Let's build the light's bounding sphere matrix
- Light currentLegacyLight = parameters.cullResults.visibleLights[lightIdx].light;
- if (currentLegacyLight == null) continue;
- HDAdditionalLightData currentHDRLight = currentLegacyLight.GetComponent();
- if (currentHDRLight == null) continue;
+ // We only need the accumulation buffer, not the color (we only disply the outline of the light shape in this mode).
+ CoreUtils.SetRenderTarget(cmd, accumulationMRT[0], depthBuffer);
- Matrix4x4 positionMat = Matrix4x4.Translate(currentLegacyLight.transform.position);
-
- switch(currentHDRLight.ComputeLightType(currentLegacyLight))
+ // The cullresult doesn't contains overlapping lights so we use a custom list
+ foreach (var overlappingHDLight in HDAdditionalLightData.s_overlappingHDLights)
{
- case HDLightType.Point:
- mpb.SetColor(_ColorShaderID, new Color(0.0f, 0.5f, 0.0f, 1.0f));
- mpb.SetVector(_OffsetShaderID, new Vector3(0, 0, 0));
- mpb.SetVector(_RangeShaderID, new Vector3(currentLegacyLight.range, currentLegacyLight.range, currentLegacyLight.range));
- cmd.DrawMesh(DebugShapes.instance.RequestSphereMesh(), positionMat, parameters.debugLightVolumeMaterial, 0, 0, mpb);
- break;
- case HDLightType.Spot:
- switch (currentHDRLight.spotLightShape)
- {
- case SpotLightShape.Cone:
- float bottomRadius = Mathf.Tan(currentLegacyLight.spotAngle * Mathf.PI / 360.0f) * currentLegacyLight.range;
- mpb.SetColor(_ColorShaderID, new Color(1.0f, 0.5f, 0.0f, 1.0f));
- mpb.SetVector(_RangeShaderID, new Vector3(bottomRadius, bottomRadius, currentLegacyLight.range));
- mpb.SetVector(_OffsetShaderID, new Vector3(0, 0, 0));
- cmd.DrawMesh(DebugShapes.instance.RequestConeMesh(), currentLegacyLight.gameObject.transform.localToWorldMatrix, parameters.debugLightVolumeMaterial, 0, 0, mpb);
- break;
- case SpotLightShape.Box:
- mpb.SetColor(_ColorShaderID, new Color(1.0f, 0.5f, 0.0f, 1.0f));
- mpb.SetVector(_RangeShaderID, new Vector3(currentHDRLight.shapeWidth, currentHDRLight.shapeHeight, currentLegacyLight.range));
- mpb.SetVector(_OffsetShaderID, new Vector3(0, 0, currentLegacyLight.range / 2.0f));
- cmd.DrawMesh(DebugShapes.instance.RequestBoxMesh(), currentLegacyLight.gameObject.transform.localToWorldMatrix, parameters.debugLightVolumeMaterial, 0, 0, mpb);
- break;
- case SpotLightShape.Pyramid:
- float bottomWidth = Mathf.Tan(currentLegacyLight.spotAngle * Mathf.PI / 360.0f) * currentLegacyLight.range;
- mpb.SetColor(_ColorShaderID, new Color(1.0f, 0.5f, 0.0f, 1.0f));
- mpb.SetVector(_RangeShaderID, new Vector3(currentHDRLight.aspectRatio * bottomWidth * 2, bottomWidth * 2, currentLegacyLight.range));
- mpb.SetVector(_OffsetShaderID, new Vector3(0, 0, 0));
- cmd.DrawMesh(DebugShapes.instance.RequestPyramidMesh(), currentLegacyLight.gameObject.transform.localToWorldMatrix, parameters.debugLightVolumeMaterial, 0, 0, mpb);
- break;
- }
- break;
- case HDLightType.Area:
- switch (currentHDRLight.areaLightShape)
- {
- case AreaLightShape.Rectangle:
- mpb.SetColor(_ColorShaderID, new Color(0.0f, 1.0f, 1.0f, 1.0f));
- mpb.SetVector(_OffsetShaderID, new Vector3(0, 0, 0));
- mpb.SetVector(_RangeShaderID, new Vector3(currentLegacyLight.range, currentLegacyLight.range, currentLegacyLight.range));
- cmd.DrawMesh(DebugShapes.instance.RequestSphereMesh(), positionMat, parameters.debugLightVolumeMaterial, 0, 0, mpb);
- break;
- case AreaLightShape.Tube:
- mpb.SetColor(_ColorShaderID, new Color(1.0f, 0.0f, 0.5f, 1.0f));
- mpb.SetVector(_OffsetShaderID, new Vector3(0, 0, 0));
- mpb.SetVector(_RangeShaderID, new Vector3(currentLegacyLight.range, currentLegacyLight.range, currentLegacyLight.range));
- cmd.DrawMesh(DebugShapes.instance.RequestSphereMesh(), positionMat, parameters.debugLightVolumeMaterial, 0, 0, mpb);
- break;
- default:
- break;
- }
- break;
+ RenderLightVolume(cmd, parameters, overlappingHDLight, overlappingHDLight.legacyLight, mpb);
}
}
-
- // Now let's do the same but for reflection probes
- int numProbes = parameters.cullResults.visibleReflectionProbes.Length;
- for (int probeIdx = 0; probeIdx < numProbes; ++probeIdx)
+ else
{
- // Let's build the light's bounding sphere matrix
- ReflectionProbe currentLegacyProbe = parameters.cullResults.visibleReflectionProbes[probeIdx].reflectionProbe;
- HDAdditionalReflectionData currentHDProbe = currentLegacyProbe.GetComponent();
+ // Set the render target array
+ CoreUtils.SetRenderTarget(cmd, accumulationMRT, depthBuffer);
- if (!currentHDProbe)
- continue;
-
- MaterialPropertyBlock m_MaterialProperty = new MaterialPropertyBlock();
- Mesh targetMesh = null;
- if (currentHDProbe.influenceVolume.shape == InfluenceShape.Sphere)
+ // First of all let's do the regions for the light sources (we only support Punctual and Area)
+ int numLights = parameters.cullResults.visibleLights.Length;
+ for (int lightIdx = 0; lightIdx < numLights; ++lightIdx)
{
- m_MaterialProperty.SetVector(_RangeShaderID, new Vector3(currentHDProbe.influenceVolume.sphereRadius, currentHDProbe.influenceVolume.sphereRadius, currentHDProbe.influenceVolume.sphereRadius));
- targetMesh = DebugShapes.instance.RequestSphereMesh();
+ // Let's build the light's bounding sphere matrix
+ Light currentLegacyLight = parameters.cullResults.visibleLights[lightIdx].light;
+ if (currentLegacyLight == null) continue;
+ HDAdditionalLightData currentHDRLight = currentLegacyLight.GetComponent();
+ if (currentHDRLight == null) continue;
+
+ RenderLightVolume(cmd, parameters, currentHDRLight, currentLegacyLight, mpb);
}
- else
+
+ // When we enable the light overlap mode we hide probes as they can't be baked in shadow masks
+ if (!parameters.lightOverlapEnabled)
{
- m_MaterialProperty.SetVector(_RangeShaderID, new Vector3(currentHDProbe.influenceVolume.boxSize.x, currentHDProbe.influenceVolume.boxSize.y, currentHDProbe.influenceVolume.boxSize.z));
- targetMesh = DebugShapes.instance.RequestBoxMesh();
- }
+ // Now let's do the same but for reflection probes
+ int numProbes = parameters.cullResults.visibleReflectionProbes.Length;
+ for (int probeIdx = 0; probeIdx < numProbes; ++probeIdx)
+ {
+ // Let's build the light's bounding sphere matrix
+ ReflectionProbe currentLegacyProbe = parameters.cullResults.visibleReflectionProbes[probeIdx].reflectionProbe;
+ HDAdditionalReflectionData currentHDProbe = currentLegacyProbe.GetComponent();
+
+ if (!currentHDProbe)
+ continue;
+
+ MaterialPropertyBlock m_MaterialProperty = new MaterialPropertyBlock();
+ Mesh targetMesh = null;
+ if (currentHDProbe.influenceVolume.shape == InfluenceShape.Sphere)
+ {
+ m_MaterialProperty.SetVector(_RangeShaderID, new Vector3(currentHDProbe.influenceVolume.sphereRadius, currentHDProbe.influenceVolume.sphereRadius, currentHDProbe.influenceVolume.sphereRadius));
+ targetMesh = DebugShapes.instance.RequestSphereMesh();
+ }
+ else
+ {
+ m_MaterialProperty.SetVector(_RangeShaderID, new Vector3(currentHDProbe.influenceVolume.boxSize.x, currentHDProbe.influenceVolume.boxSize.y, currentHDProbe.influenceVolume.boxSize.z));
+ targetMesh = DebugShapes.instance.RequestBoxMesh();
+ }
- m_MaterialProperty.SetColor(_ColorShaderID, new Color(1.0f, 1.0f, 0.0f, 1.0f));
- m_MaterialProperty.SetVector(_OffsetShaderID, new Vector3(0, 0, 0));
- Matrix4x4 positionMat = Matrix4x4.Translate(currentLegacyProbe.transform.position);
- cmd.DrawMesh(targetMesh, positionMat, parameters.debugLightVolumeMaterial, 0, 0, m_MaterialProperty);
+ m_MaterialProperty.SetColor(_ColorShaderID, new Color(1.0f, 1.0f, 0.0f, 1.0f));
+ m_MaterialProperty.SetVector(_OffsetShaderID, new Vector3(0, 0, 0));
+ Matrix4x4 positionMat = Matrix4x4.Translate(currentLegacyProbe.transform.position);
+ cmd.DrawMesh(targetMesh, positionMat, parameters.debugLightVolumeMaterial, 0, 0, m_MaterialProperty);
+ }
+ }
}
// Set the input params for the compute
@@ -217,6 +189,7 @@ public static void RenderLightVolumes(CommandBuffer cmd,
cmd.SetComputeTextureParam(parameters.debugLightVolumeCS, parameters.debugLightVolumeKernel, _DebugLightVolumesTextureShaderID, debugLightVolumesTexture);
cmd.SetComputeTextureParam(parameters.debugLightVolumeCS, parameters.debugLightVolumeKernel, _ColorGradientTextureShaderID, parameters.colorGradientTexture);
cmd.SetComputeIntParam(parameters.debugLightVolumeCS, _MaxDebugLightCountShaderID, parameters.maxDebugLightCount);
+ cmd.SetComputeFloatParam(parameters.debugLightVolumeCS, _BorderRadiusShaderID, parameters.borderRadius);
// Texture dimensions
int texWidth = parameters.hdCamera.actualWidth; // m_ColorAccumulationBuffer.rt.width;
@@ -235,6 +208,70 @@ public static void RenderLightVolumes(CommandBuffer cmd,
cmd.DrawProcedural(Matrix4x4.identity, parameters.debugLightVolumeMaterial, 1, MeshTopology.Triangles, 3, 1, mpb);
}
+ static void RenderLightVolume(
+ CommandBuffer cmd,
+ in RenderLightVolumesParameters parameters,
+ HDAdditionalLightData currentHDRLight,
+ Light currentLegacyLight,
+ MaterialPropertyBlock mpb)
+ {
+ Matrix4x4 positionMat = Matrix4x4.Translate(currentLegacyLight.transform.position);
+
+ switch(currentHDRLight.ComputeLightType(currentLegacyLight))
+ {
+ case HDLightType.Point:
+ mpb.SetColor(_ColorShaderID, new Color(0.0f, 0.5f, 0.0f, 1.0f));
+ mpb.SetVector(_OffsetShaderID, new Vector3(0, 0, 0));
+ mpb.SetVector(_RangeShaderID, new Vector3(currentLegacyLight.range, currentLegacyLight.range, currentLegacyLight.range));
+ cmd.DrawMesh(DebugShapes.instance.RequestSphereMesh(), positionMat, parameters.debugLightVolumeMaterial, 0, 0, mpb);
+ break;
+ case HDLightType.Spot:
+ switch (currentHDRLight.spotLightShape)
+ {
+ case SpotLightShape.Cone:
+ float bottomRadius = Mathf.Tan(currentLegacyLight.spotAngle * Mathf.PI / 360.0f) * currentLegacyLight.range;
+ mpb.SetColor(_ColorShaderID, new Color(1.0f, 0.5f, 0.0f, 1.0f));
+ mpb.SetVector(_RangeShaderID, new Vector3(bottomRadius, bottomRadius, currentLegacyLight.range));
+ mpb.SetVector(_OffsetShaderID, new Vector3(0, 0, 0));
+ cmd.DrawMesh(DebugShapes.instance.RequestConeMesh(), currentLegacyLight.gameObject.transform.localToWorldMatrix, parameters.debugLightVolumeMaterial, 0, 0, mpb);
+ break;
+ case SpotLightShape.Box:
+ mpb.SetColor(_ColorShaderID, new Color(1.0f, 0.5f, 0.0f, 1.0f));
+ mpb.SetVector(_RangeShaderID, new Vector3(currentHDRLight.shapeWidth, currentHDRLight.shapeHeight, currentLegacyLight.range));
+ mpb.SetVector(_OffsetShaderID, new Vector3(0, 0, currentLegacyLight.range / 2.0f));
+ cmd.DrawMesh(DebugShapes.instance.RequestBoxMesh(), currentLegacyLight.gameObject.transform.localToWorldMatrix, parameters.debugLightVolumeMaterial, 0, 0, mpb);
+ break;
+ case SpotLightShape.Pyramid:
+ float bottomWidth = Mathf.Tan(currentLegacyLight.spotAngle * Mathf.PI / 360.0f) * currentLegacyLight.range;
+ mpb.SetColor(_ColorShaderID, new Color(1.0f, 0.5f, 0.0f, 1.0f));
+ mpb.SetVector(_RangeShaderID, new Vector3(currentHDRLight.aspectRatio * bottomWidth * 2, bottomWidth * 2, currentLegacyLight.range));
+ mpb.SetVector(_OffsetShaderID, new Vector3(0, 0, 0));
+ cmd.DrawMesh(DebugShapes.instance.RequestPyramidMesh(), currentLegacyLight.gameObject.transform.localToWorldMatrix, parameters.debugLightVolumeMaterial, 0, 0, mpb);
+ break;
+ }
+ break;
+ case HDLightType.Area:
+ switch (currentHDRLight.areaLightShape)
+ {
+ case AreaLightShape.Rectangle:
+ mpb.SetColor(_ColorShaderID, new Color(0.0f, 1.0f, 1.0f, 1.0f));
+ mpb.SetVector(_OffsetShaderID, new Vector3(0, 0, 0));
+ mpb.SetVector(_RangeShaderID, new Vector3(currentLegacyLight.range, currentLegacyLight.range, currentLegacyLight.range));
+ cmd.DrawMesh(DebugShapes.instance.RequestSphereMesh(), positionMat, parameters.debugLightVolumeMaterial, 0, 0, mpb);
+ break;
+ case AreaLightShape.Tube:
+ mpb.SetColor(_ColorShaderID, new Color(1.0f, 0.0f, 0.5f, 1.0f));
+ mpb.SetVector(_OffsetShaderID, new Vector3(0, 0, 0));
+ mpb.SetVector(_RangeShaderID, new Vector3(currentLegacyLight.range, currentLegacyLight.range, currentLegacyLight.range));
+ cmd.DrawMesh(DebugShapes.instance.RequestSphereMesh(), positionMat, parameters.debugLightVolumeMaterial, 0, 0, mpb);
+ break;
+ default:
+ break;
+ }
+ break;
+ }
+ }
+
public void RenderLightVolumes(CommandBuffer cmd, HDCamera hdCamera, CullingResults cullResults, LightingDebugSettings lightDebugSettings, RTHandle finalRT)
{
using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.DisplayLightVolume)))
diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs
index 1ddd8c08256..f4f1c6073fa 100644
--- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs
+++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/Light/HDAdditionalLightData.cs
@@ -113,6 +113,9 @@ public static BoolScalableSetting UseContactShadow(HDRenderPipelineAsset hdrp) =
internal const float k_MinAreaLightShadowCone = 10.0f;
internal const float k_MaxAreaLightShadowCone = 179.0f;
+ /// List of the lights that overlaps when the OverlapLight scene view mode is enabled
+ internal static HashSet s_overlappingHDLights = new HashSet();
+
#region HDLight Properties API
[SerializeField, FormerlySerializedAs("displayLightIntensity")]
@@ -1643,6 +1646,7 @@ void OnDisable()
{
DisableCachedShadowSlot();
SetEmissiveMeshRendererEnabled(false);
+ s_overlappingHDLights.Remove(this);
}
void SetEmissiveMeshRendererEnabled(bool enabled)
@@ -2182,6 +2186,14 @@ void LateUpdate()
return;
#endif
+#if UNITY_EDITOR
+ // Update the list of overlapping lights for the LightOverlap scene view mode
+ if (IsOverlapping())
+ s_overlappingHDLights.Add(this);
+ else
+ s_overlappingHDLights.Remove(this);
+#endif
+
#if UNITY_EDITOR
//if not parented anymore, refresh it
if (m_ChildEmissiveMeshViewer != null && !m_ChildEmissiveMeshViewer.Equals(null))
@@ -3072,5 +3084,14 @@ internal ShadowMapType GetShadowMapType(HDLightType lightType)
? ShadowMapType.PunctualAtlas
: ShadowMapType.CascadedDirectional;
}
+
+ /// Tell if the light is overlapping for the light overlap debug mode
+ internal bool IsOverlapping()
+ {
+ var baking = GetComponent().bakingOutput;
+ bool isOcclusionSeparatelyBaked = baking.occlusionMaskChannel != -1;
+ bool isDirectUsingBakedOcclusion = baking.mixedLightingMode == MixedLightingMode.Shadowmask || baking.mixedLightingMode == MixedLightingMode.Subtractive;
+ return isDirectUsingBakedOcclusion && !isOcclusionSeparatelyBaked;
+ }
}
}
diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubsurfaceScatteringManager.cs b/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubsurfaceScatteringManager.cs
index 1d0c61a2653..b18362f541c 100644
--- a/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubsurfaceScatteringManager.cs
+++ b/com.unity.render-pipelines.high-definition/Runtime/Material/SubsurfaceScattering/SubsurfaceScatteringManager.cs
@@ -288,10 +288,6 @@ void RenderSubsurfaceScattering(HDCamera hdCamera, CommandBuffer cmd, RTHandle c
int numTilesXHR = (hdCamera.actualWidth + (areaTileSize - 1)) / areaTileSize;
int numTilesYHR = (hdCamera.actualHeight + (areaTileSize - 1)) / areaTileSize;
- // Clear the integration texture first
- cmd.SetComputeTextureParam(m_ScreenSpaceShadowsCS, m_ClearShadowTexture, HDShaderIDs._RaytracedShadowIntegration, diffuseBufferRT);
- cmd.DispatchCompute(m_ScreenSpaceShadowsCS, m_ClearShadowTexture, numTilesXHR, numTilesYHR, hdCamera.viewCount);
-
// Fetch the volume overrides that we shall be using
RayTracingShader subSurfaceShader = m_Asset.renderPipelineRayTracingResources.subSurfaceRayTracing;
RayTracingSettings rayTracingSettings = hdCamera.volumeStack.GetComponent();
@@ -302,8 +298,13 @@ void RenderSubsurfaceScattering(HDCamera hdCamera, CommandBuffer cmd, RTHandle c
RTHandle intermediateBuffer1 = GetRayTracingBuffer(InternalRayTracingBuffers.RGBA1);
RTHandle intermediateBuffer2 = GetRayTracingBuffer(InternalRayTracingBuffers.RGBA2);
RTHandle intermediateBuffer3 = GetRayTracingBuffer(InternalRayTracingBuffers.RGBA3);
+ RTHandle intermediateBuffer4 = GetRayTracingBuffer(InternalRayTracingBuffers.RGBA4);
RTHandle directionBuffer = GetRayTracingBuffer(InternalRayTracingBuffers.Direction);
+ // Clear the integration texture first
+ cmd.SetComputeTextureParam(m_ScreenSpaceShadowsCS, m_ClearShadowTexture, HDShaderIDs._RaytracedShadowIntegration, intermediateBuffer4);
+ cmd.DispatchCompute(m_ScreenSpaceShadowsCS, m_ClearShadowTexture, numTilesXHR, numTilesYHR, hdCamera.viewCount);
+
// Grab the acceleration structure for the target camera
RayTracingAccelerationStructure accelerationStructure = RequestAccelerationStructure();
@@ -358,7 +359,7 @@ void RenderSubsurfaceScattering(HDCamera hdCamera, CommandBuffer cmd, RTHandle c
cmd.SetComputeTextureParam(deferredRayTracing, currentKernel, HDShaderIDs._DiffuseLightingTextureRW, intermediateBuffer3);
// Bind the output texture (it is used for accumulation read and write)
- cmd.SetComputeTextureParam(deferredRayTracing, currentKernel, HDShaderIDs._RaytracingLitBufferRW, diffuseBufferRT);
+ cmd.SetComputeTextureParam(deferredRayTracing, currentKernel, HDShaderIDs._RaytracingLitBufferRW, intermediateBuffer4);
// Compute the Lighting
cmd.DispatchCompute(deferredRayTracing, currentKernel, numTilesXHR, numTilesYHR, hdCamera.viewCount);
@@ -380,13 +381,21 @@ void RenderSubsurfaceScattering(HDCamera hdCamera, CommandBuffer cmd, RTHandle c
// Apply temporal filtering to the buffer
HDTemporalFilter temporalFilter = GetTemporalFilter();
- temporalFilter.DenoiseBuffer(cmd, hdCamera, diffuseBufferRT, subsurfaceHistory, intermediateBuffer0, singleChannel: false, historyValidity: historyValidity);
+ temporalFilter.DenoiseBuffer(cmd, hdCamera, intermediateBuffer4, subsurfaceHistory, intermediateBuffer0, singleChannel: false, historyValidity: historyValidity);
+
+ // Now based on the mask, we need to blend the subsurface and the diffuse lighting
+ ComputeShader rayTracingSubSurfaceCS = m_Asset.renderPipelineRayTracingResources.subSurfaceRayTracingCS;
+ int m_CombineSubSurfaceKernel = rayTracingSubSurfaceCS.FindKernel("BlendSubSurfaceData");
+ cmd.SetComputeTextureParam(rayTracingSubSurfaceCS, m_CombineSubSurfaceKernel, HDShaderIDs._SubSurfaceLightingBuffer, intermediateBuffer0);
+ cmd.SetComputeTextureParam(rayTracingSubSurfaceCS, m_CombineSubSurfaceKernel, HDShaderIDs._DiffuseLightingTextureRW, diffuseBufferRT);
+ cmd.SetComputeTextureParam(rayTracingSubSurfaceCS, m_CombineSubSurfaceKernel, HDShaderIDs._SSSBufferTexture, m_SSSColor);
+ cmd.DispatchCompute(rayTracingSubSurfaceCS, m_CombineSubSurfaceKernel, numTilesXHR, numTilesYHR, hdCamera.viewCount);
// Push this version of the texture for debug
- PushFullScreenDebugTexture(hdCamera, cmd, intermediateBuffer0, FullScreenDebugMode.RayTracedSubSurface);
+ PushFullScreenDebugTexture(hdCamera, cmd, diffuseBufferRT, FullScreenDebugMode.RayTracedSubSurface);
// Combine it with the rest of the lighting
- m_CombineLightingPass.SetTexture(HDShaderIDs._IrradianceSource, intermediateBuffer0);
+ m_CombineLightingPass.SetTexture(HDShaderIDs._IrradianceSource, diffuseBufferRT );
HDUtils.DrawFullScreen(cmd, m_CombineLightingPass, colorBufferRT, depthStencilBufferRT, shaderPassId: 1);
}
}
diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldGather.compute b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldGather.compute
index 26bc1bd849b..fc7f62c8c4d 100644
--- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldGather.compute
+++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldGather.compute
@@ -1,6 +1,6 @@
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
-#include "DepthOfFieldCommon.hlsl"
+#include "Packages/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldCommon.hlsl"
#pragma only_renderers d3d11 playstation xboxone vulkan metal switch
diff --git a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldTileMax.compute b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldTileMax.compute
index 978a02dadd3..8bebde2a8ef 100644
--- a/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldTileMax.compute
+++ b/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldTileMax.compute
@@ -1,6 +1,6 @@
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
-#include "DepthOfFieldCommon.hlsl"
+#include "Packages/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/DepthOfFieldCommon.hlsl"
#pragma only_renderers d3d11 playstation xboxone vulkan metal switch
diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs
index 9151820d743..d356d8242b1 100644
--- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs
+++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Camera/HDCamera.cs
@@ -489,6 +489,10 @@ internal void Update(FrameSettings currentFrameSettings, HDRenderPipeline hdrp,
screenSize = new Vector4(screenWidth, screenHeight, 1.0f / screenWidth, 1.0f / screenHeight);
screenParams = new Vector4(screenSize.x, screenSize.y, 1 + screenSize.z, 1 + screenSize.w);
+ const int kMaxSampleCount = 8;
+ if (++taaFrameIndex >= kMaxSampleCount)
+ taaFrameIndex = 0;
+
UpdateAllViewConstants();
isFirstFrame = false;
cameraFrameCount++;
@@ -912,6 +916,8 @@ void UpdateAllViewConstants()
if (m_XRViewConstants == null || m_XRViewConstants.Length != viewCount)
{
m_XRViewConstants = new ViewConstants[viewCount];
+ resetPostProcessingHistory = true;
+ isFirstFrame = true;
}
UpdateAllViewConstants(IsTAAEnabled(), true);
@@ -1162,10 +1168,6 @@ Matrix4x4 GetJitteredProjectionMatrix(Matrix4x4 origProj)
float jitterY = HaltonSequence.Get((taaFrameIndex & 1023) + 1, 3) - 0.5f;
taaJitter = new Vector4(jitterX, jitterY, jitterX / actualWidth, jitterY / actualHeight);
- const int kMaxSampleCount = 8;
- if (++taaFrameIndex >= kMaxSampleCount)
- taaFrameIndex = 0;
-
Matrix4x4 proj;
if (camera.orthographic)
diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs
index 09de756b62f..7e061b6aec1 100644
--- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs
+++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs
@@ -4611,7 +4611,8 @@ void RenderDebug(HDCamera hdCamera, CommandBuffer cmd, CullingResults cullResult
// Light volumes
var lightingDebug = debugParams.debugDisplaySettings.data.lightingDebugSettings;
- if (lightingDebug.displayLightVolumes)
+ bool isLightOverlapDebugEnabled = CoreUtils.IsLightOverlapDebugEnabled(hdCamera.camera);
+ if (lightingDebug.displayLightVolumes || isLightOverlapDebugEnabled)
{
s_lightVolumes.RenderLightVolumes(cmd, hdCamera, cullResults, lightingDebug, m_IntermediateAfterPostProcessBuffer);
}
diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineRayTracingResources.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineRayTracingResources.cs
index 33fdca55279..5fa002e7482 100644
--- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineRayTracingResources.cs
+++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipelineRayTracingResources.cs
@@ -48,6 +48,8 @@ partial class HDRenderPipelineRayTracingResources : ScriptableObject
// Sub-Surface Scattering
[Reload("Runtime/RenderPipeline/Raytracing/Shaders/RayTracingSubSurface.raytrace")]
public RayTracingShader subSurfaceRayTracing;
+ [Reload("Runtime/RenderPipeline/Raytracing/Shaders/SubSurface/RayTracingSubSurface.compute")]
+ public ComputeShader subSurfaceRayTracingCS;
// Denoising
[Reload("Runtime/RenderPipeline/Raytracing/Shaders/Denoising/TemporalFilter.compute")]
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 51bb0335eaa..590af315417 100644
--- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs
+++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs
@@ -601,6 +601,7 @@ static class HDShaderIDs
public static readonly int _DirectionTextureRW = Shader.PropertyToID("_DirectionTextureRW");
public static readonly int _PositionTextureRW = Shader.PropertyToID("_PositionTextureRW");
public static readonly int _DiffuseLightingTextureRW = Shader.PropertyToID("_DiffuseLightingTextureRW");
+ public static readonly int _SubSurfaceLightingBuffer = Shader.PropertyToID("_SubSurfaceLightingBuffer");
// Accumulation
public static readonly int _AccumulationFrameIndex = Shader.PropertyToID("_AccumulationFrameIndex");
diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingManager.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingManager.cs
index 7e2a2b0a07a..9e64dcc10cc 100644
--- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingManager.cs
+++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingManager.cs
@@ -39,7 +39,8 @@ internal enum InternalRayTracingBuffers
RGBA0,
RGBA1,
RGBA2,
- RGBA3
+ RGBA3,
+ RGBA4
}
class HDRayTracingLights
@@ -107,6 +108,7 @@ public partial class HDRenderPipeline
RTHandle m_RayTracingIntermediateBufferRGBA1;
RTHandle m_RayTracingIntermediateBufferRGBA2;
RTHandle m_RayTracingIntermediateBufferRGBA3;
+ RTHandle m_RayTracingIntermediateBufferRGBA4;
internal void InitRayTracingManager()
{
@@ -142,6 +144,8 @@ internal void ReleaseRayTracingManager()
RTHandles.Release(m_RayTracingIntermediateBufferRGBA2);
if (m_RayTracingIntermediateBufferRGBA3 != null)
RTHandles.Release(m_RayTracingIntermediateBufferRGBA3);
+ if (m_RayTracingIntermediateBufferRGBA4 != null)
+ RTHandles.Release(m_RayTracingIntermediateBufferRGBA4);
if (m_RayTracingLightCluster != null)
m_RayTracingLightCluster.ReleaseResources();
@@ -740,6 +744,11 @@ internal RTHandle AllocateBuffer(InternalRayTracingBuffers bufferID)
m_RayTracingIntermediateBufferRGBA3 = RTHandles.Alloc(Vector2.one, TextureXR.slices, colorFormat: GraphicsFormat.R16G16B16A16_SFloat, dimension: TextureXR.dimension, enableRandomWrite: true, useDynamicScale: true, useMipMap: false, name: "RayTracingIntermediateBufferRGBA3");
return m_RayTracingIntermediateBufferRGBA3;
}
+ case InternalRayTracingBuffers.RGBA4:
+ {
+ m_RayTracingIntermediateBufferRGBA4 = RTHandles.Alloc(Vector2.one, TextureXR.slices, colorFormat: GraphicsFormat.R16G16B16A16_SFloat, dimension: TextureXR.dimension, enableRandomWrite: true, useDynamicScale: true, useMipMap: false, name: "RayTracingIntermediateBufferRGBA4");
+ return m_RayTracingIntermediateBufferRGBA4;
+ }
default:
return null;
}
@@ -769,6 +778,8 @@ internal RTHandle GetRayTracingBuffer(InternalRayTracingBuffers bufferID)
return m_RayTracingIntermediateBufferRGBA2 != null ? m_RayTracingIntermediateBufferRGBA2 : AllocateBuffer(InternalRayTracingBuffers.RGBA2);
case InternalRayTracingBuffers.RGBA3:
return m_RayTracingIntermediateBufferRGBA3 != null ? m_RayTracingIntermediateBufferRGBA3 : AllocateBuffer(InternalRayTracingBuffers.RGBA3);
+ case InternalRayTracingBuffers.RGBA4:
+ return m_RayTracingIntermediateBufferRGBA4 != null ? m_RayTracingIntermediateBufferRGBA4 : AllocateBuffer(InternalRayTracingBuffers.RGBA4);
default:
return null;
}
diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/SubSurface/RayTracingSubSurface.compute b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/SubSurface/RayTracingSubSurface.compute
new file mode 100644
index 00000000000..a1cfcee958b
--- /dev/null
+++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/SubSurface/RayTracingSubSurface.compute
@@ -0,0 +1,48 @@
+#pragma kernel BlendSubSurfaceData
+
+#pragma only_renderers d3d11
+
+// Given that this pass does not use the shadow algorithm multi-compile, we need to define SHADOW_LOW to quite the shadow algorithm error
+#define SHADOW_LOW
+
+// HDRP generic includes
+#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Macros.hlsl"
+#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
+#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Packing.hlsl"
+#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
+#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesFunctions.hlsl"
+#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Sampling/Sampling.hlsl"
+#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/Lighting.hlsl"
+#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl"
+#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoopDef.hlsl"
+#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl"
+
+// The buffer of sub surface scattering that was computed used ray tracing
+TEXTURE2D_X(_SubSurfaceLightingBuffer);
+// This buffer holds the diffuse lighting without the SSS contribution
+RW_TEXTURE2D_X(float4, _DiffuseLightingTextureRW);
+
+#define RAYTRACING_SUB_SURFACE_TILE_SIZE 8
+
+[numthreads(RAYTRACING_SUB_SURFACE_TILE_SIZE, RAYTRACING_SUB_SURFACE_TILE_SIZE, 1)]
+void BlendSubSurfaceData(uint3 dispatchThreadId : SV_DispatchThreadID, uint2 groupThreadId : SV_GroupThreadID, uint2 groupId : SV_GroupID)
+{
+ UNITY_XR_ASSIGN_VIEW_INDEX(dispatchThreadId.z);
+
+ // Compute the pixel position to process
+ uint2 currentCoord = groupId * RAYTRACING_SUB_SURFACE_TILE_SIZE + groupThreadId;
+
+ // Read the SSS Data
+ SSSData sssData;
+ DECODE_FROM_SSSBUFFER(currentCoord, sssData);
+
+ // Compute the albedo color to use based on the scattering mode
+ int profileIndex = sssData.diffusionProfileIndex;
+ uint texturingMode = GetSubsurfaceScatteringTexturingMode(profileIndex);
+ float3 albedo = ApplySubsurfaceScatteringTexturingMode(texturingMode, sssData.diffuseColor);
+
+ // Blend and we are done
+ _DiffuseLightingTextureRW[COORD_TEXTURE2D_X(currentCoord)] = float4(lerp(_DiffuseLightingTextureRW[COORD_TEXTURE2D_X(currentCoord)].xyz * albedo * GetInverseCurrentExposureMultiplier()
+ , _SubSurfaceLightingBuffer[COORD_TEXTURE2D_X(currentCoord)].xyz
+ , sssData.subsurfaceMask), 1.0);
+}
diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/SubSurface/RayTracingSubSurface.compute.meta b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/SubSurface/RayTracingSubSurface.compute.meta
new file mode 100644
index 00000000000..5fcece6b608
--- /dev/null
+++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/SubSurface/RayTracingSubSurface.compute.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 4e5684a8dba46fe42a47642f9b0a6b89
+ComputeShaderImporter:
+ externalObjects: {}
+ currentAPIMask: 262148
+ preprocessorOverride: 0
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRSystem.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRSystem.cs
index e678042bd1a..cd2a0ce01ad 100644
--- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRSystem.cs
+++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/XR/XRSystem.cs
@@ -86,6 +86,7 @@ internal static void XRSystemInit()
{
displayList[i].disableLegacyRenderer = true;
displayList[i].sRGB = true;
+ displayList[i].textureLayout = XRDisplaySubsystem.TextureLayout.Texture2DArray;
}
}
#endif
diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipelineResources/HDRenderPipelineRayTracingResources.asset b/com.unity.render-pipelines.high-definition/Runtime/RenderPipelineResources/HDRenderPipelineRayTracingResources.asset
index 593504922e7..79825bec07c 100644
--- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipelineResources/HDRenderPipelineRayTracingResources.asset
+++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipelineResources/HDRenderPipelineRayTracingResources.asset
@@ -38,6 +38,8 @@ MonoBehaviour:
type: 3}
subSurfaceRayTracing: {fileID: 4807578003741378534, guid: b29a18f967c92364492508dddf78cff7,
type: 3}
+ subSurfaceRayTracingCS: {fileID: 7200000, guid: 4e5684a8dba46fe42a47642f9b0a6b89,
+ type: 3}
temporalFilterCS: {fileID: 7200000, guid: 741979ff70f7bd6489fbcb464280ecff, type: 3}
simpleDenoiserCS: {fileID: 7200000, guid: 74a980f1da9a4f842996035350fe756c, type: 3}
diffuseDenoiserCS: {fileID: 7200000, guid: b4ed2382141619f40af1f743a84ccaea, type: 3}
diff --git a/com.unity.testing.hdrp/RP_Assets/HDRP_Test_Def.asset b/com.unity.testing.hdrp/RP_Assets/HDRP_Test_Def.asset
index 4ea302e13f4..25f0889cfd4 100644
--- a/com.unity.testing.hdrp/RP_Assets/HDRP_Test_Def.asset
+++ b/com.unity.testing.hdrp/RP_Assets/HDRP_Test_Def.asset
@@ -317,7 +317,7 @@ MonoBehaviour:
xrSettings:
singlePass: 1
occlusionMesh: 1
- cameraJitter: 0
+ cameraJitter: 1
postProcessQualitySettings:
NearBlurSampleCount: 030000000500000008000000
NearBlurMaxRadius:
diff --git a/com.unity.testing.hdrp/RP_Assets/HDRP_Test_Def_FP16_PPAlpha.asset b/com.unity.testing.hdrp/RP_Assets/HDRP_Test_Def_FP16_PPAlpha.asset
index f3747f6fa00..c9c8224e226 100644
--- a/com.unity.testing.hdrp/RP_Assets/HDRP_Test_Def_FP16_PPAlpha.asset
+++ b/com.unity.testing.hdrp/RP_Assets/HDRP_Test_Def_FP16_PPAlpha.asset
@@ -295,6 +295,7 @@ MonoBehaviour:
xrSettings:
singlePass: 1
occlusionMesh: 1
+ cameraJitter: 1
postProcessQualitySettings:
NearBlurSampleCount: 030000000500000008000000
NearBlurMaxRadius:
diff --git a/com.unity.testing.hdrp/TestRunner/HDRP_GraphicTestRunner.cs b/com.unity.testing.hdrp/TestRunner/HDRP_GraphicTestRunner.cs
index 0b0113342ac..e25f10365b8 100644
--- a/com.unity.testing.hdrp/TestRunner/HDRP_GraphicTestRunner.cs
+++ b/com.unity.testing.hdrp/TestRunner/HDRP_GraphicTestRunner.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using NUnit.Framework;
using UnityEngine;
+using UnityEngine.Rendering;
using UnityEngine.TestTools;
using UnityEngine.TestTools.Graphics;
using UnityEngine.Rendering.HighDefinition;
@@ -13,6 +14,7 @@ public class HDRP_GraphicTestRunner
{
[PrebuildSetup("SetupGraphicsTestCases")]
[UseGraphicsTestCases]
+ [Timeout(300 * 1000)] // Set timeout to 5 minutes to handle complex scenes with many shaders (default timeout is 3 minutes)
public IEnumerator Run(GraphicsTestCase testCase)
{
SceneManager.LoadScene(testCase.ScenePath);
@@ -42,11 +44,17 @@ public IEnumerator Run(GraphicsTestCase testCase)
// Increase tolerance to account for slight changes due to float precision
settings.ImageComparisonSettings.AverageCorrectnessThreshold *= settings.xrThresholdMultiplier;
settings.ImageComparisonSettings.PerPixelCorrectnessThreshold *= settings.xrThresholdMultiplier;
+
+ // Increase number of volumetric slices to compensate for initial half-resolution due to XR single-pass optimization
+ foreach (var volume in GameObject.FindObjectsOfType())
+ {
+ if (volume.profile.TryGet(out Fog fog))
+ fog.volumeSliceCount.value *= 2;
+ }
}
else
{
- // Skip incompatible XR tests
- yield break;
+ Assert.Ignore("Test scene is not compatible with XR and will be skipped.");
}
}
@@ -58,6 +66,9 @@ public IEnumerator Run(GraphicsTestCase testCase)
yield return null;
}
+ // Reset temporal effects on hdCamera
+ HDCamera.GetOrCreate(camera).Reset();
+
for (int i=0 ; i