diff --git a/TestProjects/HDRP_RuntimeTests/Assets/TestCaseFilters.asset b/TestProjects/HDRP_RuntimeTests/Assets/TestCaseFilters.asset
new file mode 100644
index 00000000000..ef6ee39b28c
--- /dev/null
+++ b/TestProjects/HDRP_RuntimeTests/Assets/TestCaseFilters.asset
@@ -0,0 +1,51 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!114 &11400000
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 5f6aa9f32113aec4a8bded44c1febe5c, type: 3}
+ m_Name: TestCaseFilters
+ m_EditorClassIdentifier:
+ filters:
+ - FilteredScene: {fileID: 0}
+ FilteredScenes:
+ - {fileID: 102900000, guid: b0ec7521f32466147a09e7dadff3ae0e, type: 3}
+ ColorSpace: 1
+ BuildPlatform: 5
+ GraphicsDevice: 21
+ XrSdk:
+ StereoModes: 0
+ Reason: all black on Yamato but work locally
+ - FilteredScene: {fileID: 0}
+ FilteredScenes:
+ - {fileID: 102900000, guid: b0ec7521f32466147a09e7dadff3ae0e, type: 3}
+ ColorSpace: 1
+ BuildPlatform: 24
+ GraphicsDevice: 21
+ XrSdk:
+ StereoModes: 0
+ Reason: all black on Yamato but work locally
+ - FilteredScene: {fileID: 0}
+ FilteredScenes:
+ - {fileID: 102900000, guid: 897c2870240f77a46a18884a0446b797, type: 3}
+ ColorSpace: 1
+ BuildPlatform: 5
+ GraphicsDevice: 21
+ XrSdk:
+ StereoModes: 0
+ Reason: all black on Yamato but work locally
+ - FilteredScene: {fileID: 0}
+ FilteredScenes:
+ - {fileID: 102900000, guid: 897c2870240f77a46a18884a0446b797, type: 3}
+ ColorSpace: 1
+ BuildPlatform: 24
+ GraphicsDevice: 21
+ XrSdk:
+ StereoModes: 0
+ Reason: all black on Yamato but work locally
diff --git a/TestProjects/HDRP_RuntimeTests/Assets/TestCaseFilters.asset.meta b/TestProjects/HDRP_RuntimeTests/Assets/TestCaseFilters.asset.meta
new file mode 100644
index 00000000000..9029546581b
--- /dev/null
+++ b/TestProjects/HDRP_RuntimeTests/Assets/TestCaseFilters.asset.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: f84f907c1962c284abd349fb673e854d
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 0
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2008_Light_Volumetrics/2008_Light_Volumetrics_Volume.asset b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2008_Light_Volumetrics/2008_Light_Volumetrics_Volume.asset
index 7f5daca687c..b473ebdffc3 100644
--- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2008_Light_Volumetrics/2008_Light_Volumetrics_Volume.asset
+++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/2x_Lighting/2008_Light_Volumetrics/2008_Light_Volumetrics_Volume.asset
@@ -36,7 +36,7 @@ MonoBehaviour:
m_Name: Fog
m_EditorClassIdentifier:
active: 1
- m_AdvancedMode: 0
+ m_AdvancedMode: 1
enabled:
m_OverrideState: 1
m_Value: 1
@@ -49,6 +49,12 @@ MonoBehaviour:
hdr: 1
showAlpha: 0
showEyeDropper: 1
+ tint:
+ m_OverrideState: 0
+ m_Value: {r: 1, g: 1, b: 1, a: 1}
+ hdr: 1
+ showAlpha: 0
+ showEyeDropper: 1
maxFogDistance:
m_OverrideState: 0
m_Value: 5000
@@ -72,12 +78,6 @@ MonoBehaviour:
maximumHeight:
m_OverrideState: 0
m_Value: 50
- albedo:
- m_OverrideState: 0
- m_Value: {r: 1, g: 1, b: 1, a: 1}
- hdr: 0
- showAlpha: 1
- showEyeDropper: 1
meanFreePath:
m_OverrideState: 1
m_Value: 3
@@ -85,11 +85,12 @@ MonoBehaviour:
enableVolumetricFog:
m_OverrideState: 1
m_Value: 1
- anisotropy:
+ albedo:
m_OverrideState: 0
- m_Value: 0
- min: -1
- max: 1
+ m_Value: {r: 1, g: 1, b: 1, a: 1}
+ hdr: 0
+ showAlpha: 1
+ showEyeDropper: 1
globalLightProbeDimmer:
m_OverrideState: 0
m_Value: 1
@@ -99,11 +100,22 @@ MonoBehaviour:
m_OverrideState: 0
m_Value: 64
min: 0.1
+ denoisingMode:
+ m_OverrideState: 1
+ m_Value: 0
+ anisotropy:
+ m_OverrideState: 0
+ m_Value: 0
+ min: -1
+ max: 1
sliceDistributionUniformity:
m_OverrideState: 0
m_Value: 0.75
min: 0
max: 1
+ fogControlMode:
+ m_OverrideState: 1
+ m_Value: 1
screenResolutionPercentage:
m_OverrideState: 1
m_Value: 25
@@ -114,6 +126,19 @@ MonoBehaviour:
m_Value: 128
min: 1
max: 1024
+ volumetricFogBudget:
+ m_OverrideState: 0
+ m_Value: 0.25
+ min: 0
+ max: 1
+ resolutionDepthRatio:
+ m_OverrideState: 0
+ m_Value: 0.5
+ min: 0
+ max: 1
+ directionalLightsOnly:
+ m_OverrideState: 0
+ m_Value: 0
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5001_Fog_FogFallback/Volume_Base.asset b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5001_Fog_FogFallback/Volume_Base.asset
index c23d19c35dd..f69eb0a5d65 100644
--- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5001_Fog_FogFallback/Volume_Base.asset
+++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5001_Fog_FogFallback/Volume_Base.asset
@@ -33,6 +33,9 @@ MonoBehaviour:
m_OverrideState: 1
m_Value: 1
min: 0
+ upperHemisphereLuxColor:
+ m_OverrideState: 0
+ m_Value: {x: 0, y: 0, z: 0}
desiredLuxValue:
m_OverrideState: 1
m_Value: 20000
@@ -130,7 +133,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
active: 1
- m_AdvancedMode: 0
+ m_AdvancedMode: 1
enabled:
m_OverrideState: 1
m_Value: 1
@@ -143,6 +146,12 @@ MonoBehaviour:
hdr: 1
showAlpha: 0
showEyeDropper: 1
+ tint:
+ m_OverrideState: 0
+ m_Value: {r: 1, g: 1, b: 1, a: 1}
+ hdr: 1
+ showAlpha: 0
+ showEyeDropper: 1
maxFogDistance:
m_OverrideState: 1
m_Value: 500
@@ -166,12 +175,6 @@ MonoBehaviour:
maximumHeight:
m_OverrideState: 0
m_Value: 500
- albedo:
- m_OverrideState: 1
- m_Value: {r: 1, g: 1, b: 1, a: 1}
- hdr: 0
- showAlpha: 1
- showEyeDropper: 1
meanFreePath:
m_OverrideState: 1
m_Value: 50
@@ -179,11 +182,12 @@ MonoBehaviour:
enableVolumetricFog:
m_OverrideState: 1
m_Value: 1
- anisotropy:
+ albedo:
m_OverrideState: 1
- m_Value: 0
- min: -1
- max: 1
+ m_Value: {r: 1, g: 1, b: 1, a: 1}
+ hdr: 0
+ showAlpha: 1
+ showEyeDropper: 1
globalLightProbeDimmer:
m_OverrideState: 1
m_Value: 1
@@ -193,11 +197,22 @@ MonoBehaviour:
m_OverrideState: 1
m_Value: 25
min: 0.1
+ denoisingMode:
+ m_OverrideState: 1
+ m_Value: 0
+ anisotropy:
+ m_OverrideState: 1
+ m_Value: 0
+ min: -1
+ max: 1
sliceDistributionUniformity:
m_OverrideState: 1
m_Value: 0.75
min: 0
max: 1
+ fogControlMode:
+ m_OverrideState: 1
+ m_Value: 1
screenResolutionPercentage:
m_OverrideState: 1
m_Value: 25
@@ -208,6 +223,19 @@ MonoBehaviour:
m_Value: 128
min: 1
max: 1024
+ volumetricFogBudget:
+ m_OverrideState: 0
+ m_Value: 0.25
+ min: 0
+ max: 1
+ resolutionDepthRatio:
+ m_OverrideState: 0
+ m_Value: 0.5
+ min: 0
+ max: 1
+ directionalLightsOnly:
+ m_OverrideState: 0
+ m_Value: 0
--- !u!114 &3474294613101294443
MonoBehaviour:
m_ObjectHideFlags: 3
@@ -226,6 +254,11 @@ MonoBehaviour:
m_OverrideState: 1
m_Value: 500
min: 0
+ directionalTransmissionMultiplier:
+ m_OverrideState: 0
+ m_Value: 1
+ min: 0
+ max: 1
cascadeShadowSplitCount:
m_OverrideState: 1
m_Value: 4
diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5002_Fog_DensityVolumes/Scene Settings Profile.asset b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5002_Fog_DensityVolumes/Scene Settings Profile.asset
index 0fecf7ac517..cbdc2994ffe 100644
--- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5002_Fog_DensityVolumes/Scene Settings Profile.asset
+++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5002_Fog_DensityVolumes/Scene Settings Profile.asset
@@ -13,7 +13,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
active: 1
- m_AdvancedMode: 0
+ m_AdvancedMode: 1
enabled:
m_OverrideState: 1
m_Value: 1
@@ -26,6 +26,12 @@ MonoBehaviour:
hdr: 1
showAlpha: 0
showEyeDropper: 1
+ tint:
+ m_OverrideState: 0
+ m_Value: {r: 1, g: 1, b: 1, a: 1}
+ hdr: 1
+ showAlpha: 0
+ showEyeDropper: 1
maxFogDistance:
m_OverrideState: 0
m_Value: 5000
@@ -49,12 +55,6 @@ MonoBehaviour:
maximumHeight:
m_OverrideState: 0
m_Value: 50
- albedo:
- m_OverrideState: 1
- m_Value: {r: 1, g: 1, b: 1, a: 1}
- hdr: 0
- showAlpha: 1
- showEyeDropper: 1
meanFreePath:
m_OverrideState: 1
m_Value: 1000000
@@ -62,11 +62,12 @@ MonoBehaviour:
enableVolumetricFog:
m_OverrideState: 1
m_Value: 1
- anisotropy:
+ albedo:
m_OverrideState: 1
- m_Value: 0
- min: -1
- max: 1
+ m_Value: {r: 1, g: 1, b: 1, a: 1}
+ hdr: 0
+ showAlpha: 1
+ showEyeDropper: 1
globalLightProbeDimmer:
m_OverrideState: 1
m_Value: 1
@@ -76,11 +77,22 @@ MonoBehaviour:
m_OverrideState: 0
m_Value: 64
min: 0.1
+ denoisingMode:
+ m_OverrideState: 1
+ m_Value: 0
+ anisotropy:
+ m_OverrideState: 1
+ m_Value: 0
+ min: -1
+ max: 1
sliceDistributionUniformity:
m_OverrideState: 0
m_Value: 0.75
min: 0
max: 1
+ fogControlMode:
+ m_OverrideState: 1
+ m_Value: 1
screenResolutionPercentage:
m_OverrideState: 1
m_Value: 25
@@ -91,6 +103,19 @@ MonoBehaviour:
m_Value: 128
min: 1
max: 1024
+ volumetricFogBudget:
+ m_OverrideState: 0
+ m_Value: 0.25
+ min: 0
+ max: 1
+ resolutionDepthRatio:
+ m_OverrideState: 0
+ m_Value: 0.5
+ min: 0
+ max: 1
+ directionalLightsOnly:
+ m_OverrideState: 0
+ m_Value: 0
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -128,6 +153,11 @@ MonoBehaviour:
m_OverrideState: 1
m_Value: 500
min: 0
+ directionalTransmissionMultiplier:
+ m_OverrideState: 0
+ m_Value: 1
+ min: 0
+ max: 1
cascadeShadowSplitCount:
m_OverrideState: 1
m_Value: 4
@@ -210,6 +240,9 @@ MonoBehaviour:
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
@@ -299,6 +332,12 @@ MonoBehaviour:
hdr: 0
showAlpha: 1
showEyeDropper: 1
+ tint:
+ m_OverrideState: 0
+ m_Value: {r: 1, g: 1, b: 1, a: 1}
+ hdr: 1
+ showAlpha: 0
+ showEyeDropper: 1
density:
m_OverrideState: 1
m_Value: 1
diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5003_Fog_DensityVolumesShadows/Scene Settings Profile.asset b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5003_Fog_DensityVolumesShadows/Scene Settings Profile.asset
index e3d3d9ec426..077776da839 100644
--- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5003_Fog_DensityVolumesShadows/Scene Settings Profile.asset
+++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5003_Fog_DensityVolumesShadows/Scene Settings Profile.asset
@@ -36,6 +36,11 @@ MonoBehaviour:
m_OverrideState: 1
m_Value: 500
min: 0
+ directionalTransmissionMultiplier:
+ m_OverrideState: 0
+ m_Value: 1
+ min: 0
+ max: 1
cascadeShadowSplitCount:
m_OverrideState: 1
m_Value: 4
@@ -131,6 +136,12 @@ MonoBehaviour:
hdr: 0
showAlpha: 1
showEyeDropper: 1
+ tint:
+ m_OverrideState: 0
+ m_Value: {r: 1, g: 1, b: 1, a: 1}
+ hdr: 1
+ showAlpha: 0
+ showEyeDropper: 1
density:
m_OverrideState: 1
m_Value: 1
@@ -195,7 +206,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
active: 1
- m_AdvancedMode: 0
+ m_AdvancedMode: 1
enabled:
m_OverrideState: 1
m_Value: 1
@@ -208,6 +219,12 @@ MonoBehaviour:
hdr: 1
showAlpha: 0
showEyeDropper: 1
+ tint:
+ m_OverrideState: 0
+ m_Value: {r: 1, g: 1, b: 1, a: 1}
+ hdr: 1
+ showAlpha: 0
+ showEyeDropper: 1
maxFogDistance:
m_OverrideState: 0
m_Value: 5000
@@ -231,29 +248,44 @@ MonoBehaviour:
maximumHeight:
m_OverrideState: 0
m_Value: 50
+ meanFreePath:
+ m_OverrideState: 1
+ m_Value: 100000
+ min: 1
+ enableVolumetricFog:
+ m_OverrideState: 1
+ m_Value: 1
albedo:
m_OverrideState: 1
m_Value: {r: 1, g: 1, b: 1, a: 1}
hdr: 0
showAlpha: 1
showEyeDropper: 1
- meanFreePath:
- m_OverrideState: 1
- m_Value: 100000
- min: 1
- enableVolumetricFog:
+ globalLightProbeDimmer:
m_OverrideState: 1
m_Value: 1
+ min: 0
+ max: 1
+ depthExtent:
+ m_OverrideState: 0
+ m_Value: 64
+ min: 0.1
+ denoisingMode:
+ m_OverrideState: 1
+ m_Value: 0
anisotropy:
m_OverrideState: 1
m_Value: 0
min: -1
max: 1
- globalLightProbeDimmer:
- m_OverrideState: 1
- m_Value: 1
+ sliceDistributionUniformity:
+ m_OverrideState: 0
+ m_Value: 0.75
min: 0
max: 1
+ fogControlMode:
+ m_OverrideState: 1
+ m_Value: 1
screenResolutionPercentage:
m_OverrideState: 1
m_Value: 25
@@ -264,3 +296,16 @@ MonoBehaviour:
m_Value: 128
min: 1
max: 1024
+ volumetricFogBudget:
+ m_OverrideState: 0
+ m_Value: 0.25
+ min: 0
+ max: 1
+ resolutionDepthRatio:
+ m_OverrideState: 0
+ m_Value: 0.5
+ min: 0
+ max: 1
+ directionalLightsOnly:
+ m_OverrideState: 0
+ m_Value: 0
diff --git a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5008_FogFiltering/Sky and Fog Settings Profile.asset b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5008_FogFiltering/Sky and Fog Settings Profile.asset
index 53e4a07064e..ce6087da16a 100644
--- a/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5008_FogFiltering/Sky and Fog Settings Profile.asset
+++ b/TestProjects/HDRP_Tests/Assets/GraphicTests/Scenes/5x_SkyAndFog/5008_FogFiltering/Sky and Fog Settings Profile.asset
@@ -26,6 +26,12 @@ MonoBehaviour:
hdr: 1
showAlpha: 0
showEyeDropper: 1
+ tint:
+ m_OverrideState: 0
+ m_Value: {r: 1, g: 1, b: 1, a: 1}
+ hdr: 1
+ showAlpha: 0
+ showEyeDropper: 1
maxFogDistance:
m_OverrideState: 0
m_Value: 5000
@@ -49,12 +55,6 @@ MonoBehaviour:
maximumHeight:
m_OverrideState: 0
m_Value: 50
- albedo:
- m_OverrideState: 0
- m_Value: {r: 1, g: 1, b: 1, a: 1}
- hdr: 0
- showAlpha: 1
- showEyeDropper: 1
meanFreePath:
m_OverrideState: 1
m_Value: 3
@@ -62,11 +62,12 @@ MonoBehaviour:
enableVolumetricFog:
m_OverrideState: 1
m_Value: 1
- anisotropy:
- m_OverrideState: 1
- m_Value: 0.407
- min: -1
- max: 1
+ albedo:
+ m_OverrideState: 0
+ m_Value: {r: 1, g: 1, b: 1, a: 1}
+ hdr: 0
+ showAlpha: 1
+ showEyeDropper: 1
globalLightProbeDimmer:
m_OverrideState: 0
m_Value: 1
@@ -76,11 +77,22 @@ MonoBehaviour:
m_OverrideState: 0
m_Value: 64
min: 0.1
+ denoisingMode:
+ m_OverrideState: 1
+ m_Value: 2
+ anisotropy:
+ m_OverrideState: 1
+ m_Value: 0.407
+ min: -1
+ max: 1
sliceDistributionUniformity:
m_OverrideState: 0
m_Value: 0.75
min: 0
max: 1
+ fogControlMode:
+ m_OverrideState: 1
+ m_Value: 1
screenResolutionPercentage:
m_OverrideState: 1
m_Value: 25
@@ -91,9 +103,19 @@ MonoBehaviour:
m_Value: 128
min: 1
max: 1024
- filter:
- m_OverrideState: 1
- m_Value: 1
+ volumetricFogBudget:
+ m_OverrideState: 0
+ m_Value: 0.25
+ min: 0
+ max: 1
+ resolutionDepthRatio:
+ m_OverrideState: 0
+ m_Value: 0.5
+ min: 0
+ max: 1
+ directionalLightsOnly:
+ m_OverrideState: 0
+ m_Value: 0
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -166,6 +188,9 @@ MonoBehaviour:
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
@@ -179,6 +204,15 @@ MonoBehaviour:
includeSunInBaking:
m_OverrideState: 0
m_Value: 0
+ earthPreset:
+ m_OverrideState: 0
+ m_Value: 1
+ sphericalMode:
+ m_OverrideState: 0
+ m_Value: 1
+ seaLevel:
+ m_OverrideState: 0
+ m_Value: 0
planetaryRadius:
m_OverrideState: 0
m_Value: 6378.759
@@ -186,13 +220,22 @@ MonoBehaviour:
planetCenterPosition:
m_OverrideState: 0
m_Value: {x: 0, y: -6378.759, z: 0}
- airOpacity:
+ airDensityR:
m_OverrideState: 0
- m_Value: {r: 0.816175, g: 0.980598, b: 0.999937, a: 1}
- hdr: 0
- showAlpha: 0
- showEyeDropper: 1
- airAlbedo:
+ m_Value: 0.04534
+ min: 0
+ max: 1
+ airDensityG:
+ m_OverrideState: 0
+ m_Value: 0.10237241
+ min: 0
+ max: 1
+ airDensityB:
+ m_OverrideState: 0
+ m_Value: 0.23264056
+ min: 0
+ max: 1
+ airTint:
m_OverrideState: 0
m_Value: {r: 0.9, g: 0.9, b: 1, a: 1}
hdr: 0
@@ -202,16 +245,17 @@ MonoBehaviour:
m_OverrideState: 0
m_Value: 55.262
min: 0
- aerosolOpacity:
+ aerosolDensity:
m_OverrideState: 0
- m_Value: 0.5
+ m_Value: 0.01192826
min: 0
max: 1
- aerosolAlbedo:
+ aerosolTint:
m_OverrideState: 0
- m_Value: 0.9
- min: 0
- max: 1
+ m_Value: {r: 0.9, g: 0.9, b: 0.9, a: 1}
+ hdr: 0
+ showAlpha: 0
+ showEyeDropper: 1
aerosolMaximumAltitude:
m_OverrideState: 0
m_Value: 8.28931
@@ -226,24 +270,64 @@ MonoBehaviour:
m_Value: 8
min: 1
max: 10
- groundColor:
+ groundTint:
m_OverrideState: 0
m_Value: {r: 0.4, g: 0.25, b: 0.15, a: 1}
hdr: 0
showAlpha: 0
showEyeDropper: 0
- groundAlbedoTexture:
+ groundColorTexture:
m_OverrideState: 0
m_Value: {fileID: 0}
groundEmissionTexture:
m_OverrideState: 0
m_Value: {fileID: 0}
+ groundEmissionMultiplier:
+ m_OverrideState: 0
+ m_Value: 1
+ min: 0
planetRotation:
m_OverrideState: 0
m_Value: {x: 0, y: 0, z: 0}
spaceEmissionTexture:
m_OverrideState: 0
m_Value: {fileID: 0}
+ spaceEmissionMultiplier:
+ m_OverrideState: 0
+ m_Value: 1
+ min: 0
spaceRotation:
m_OverrideState: 0
m_Value: {x: 0, y: 0, z: 0}
+ colorSaturation:
+ m_OverrideState: 0
+ m_Value: 1
+ min: 0
+ max: 1
+ alphaSaturation:
+ m_OverrideState: 0
+ m_Value: 1
+ min: 0
+ max: 1
+ alphaMultiplier:
+ m_OverrideState: 0
+ m_Value: 1
+ min: 0
+ max: 1
+ horizonTint:
+ m_OverrideState: 0
+ m_Value: {r: 1, g: 1, b: 1, a: 1}
+ hdr: 0
+ showAlpha: 0
+ showEyeDropper: 0
+ zenithTint:
+ m_OverrideState: 0
+ m_Value: {r: 1, g: 1, b: 1, a: 1}
+ hdr: 0
+ showAlpha: 0
+ showEyeDropper: 0
+ horizonZenithShift:
+ m_OverrideState: 0
+ m_Value: 0
+ min: -1
+ max: 1
diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md
index 396bb1eff4f..5b276e45196 100644
--- a/com.unity.render-pipelines.high-definition/CHANGELOG.md
+++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md
@@ -28,6 +28,7 @@ The version number for this package has increased due to a version update of a r
### Changed
- Combined occlusion meshes into one to reduce draw calls and state changes with XR single-pass.
- Claryfied doc for the LayeredLit material.
+- Various improvements for the Volumetric Fog.
## [10.1.0] - 2020-10-12
diff --git a/com.unity.render-pipelines.high-definition/Editor/Sky/AtmosphericScattering/FogEditor.cs b/com.unity.render-pipelines.high-definition/Editor/Sky/AtmosphericScattering/FogEditor.cs
index f4acccf6c7e..3e1cbb6ae18 100644
--- a/com.unity.render-pipelines.high-definition/Editor/Sky/AtmosphericScattering/FogEditor.cs
+++ b/com.unity.render-pipelines.high-definition/Editor/Sky/AtmosphericScattering/FogEditor.cs
@@ -20,15 +20,20 @@ class FogEditor : VolumeComponentEditor
protected SerializedDataParameter m_MeanFreePath;
protected SerializedDataParameter m_BaseHeight;
protected SerializedDataParameter m_MaximumHeight;
- protected SerializedDataParameter m_Anisotropy;
- protected SerializedDataParameter m_GlobalLightProbeDimmer;
+
protected SerializedDataParameter m_EnableVolumetricFog;
+ protected SerializedDataParameter m_Anisotropy;
protected SerializedDataParameter m_DepthExtent;
+ protected SerializedDataParameter m_GlobalLightProbeDimmer;
protected SerializedDataParameter m_SliceDistributionUniformity;
+ protected SerializedDataParameter m_FogControlMode;
protected SerializedDataParameter m_ScreenResolutionPercentage;
protected SerializedDataParameter m_VolumeSliceCount;
- protected SerializedDataParameter m_Filter;
-
+ protected SerializedDataParameter m_VolumetricFogBudget;
+ protected SerializedDataParameter m_ResolutionDepthRatio;
+ protected SerializedDataParameter m_DirectionalLightsOnly;
+ protected SerializedDataParameter m_DenoisingMode;
+
static GUIContent s_Enabled = new GUIContent("Enable", "Check this to enable fog in your scene.");
static GUIContent s_AlbedoLabel = new GUIContent("Albedo", "Specifies the color this fog scatters light to.");
static GUIContent s_MeanFreePathLabel = new GUIContent("Fog Attenuation Distance", "Controls the density at the base level (per color channel). Distance at which fog reduces background light intensity by 63%. Units: m.");
@@ -37,6 +42,7 @@ class FogEditor : VolumeComponentEditor
static GUIContent s_AnisotropyLabel = new GUIContent("Anisotropy", "Controls the angular distribution of scattered light. 0 is isotropic, 1 is forward scattering, and -1 is backward scattering.");
static GUIContent s_GlobalLightProbeDimmerLabel = new GUIContent("Ambient Light Probe Dimmer", "Controls the intensity reduction of the global Light Probe that the sky generates.");
static GUIContent s_EnableVolumetricFog = new GUIContent("Volumetric Fog", "When enabled, activates volumetric fog.");
+ static GUIContent s_DepthExtentLabel = new GUIContent("Volumetric Fog Distance", "Sets the distance (in meters) from the Camera's Near Clipping Plane to the back of the Camera's volumetric lighting buffer. The lower the distance is, the higher the fog quality is.");
public override bool hasAdvancedMode => true;
@@ -63,9 +69,13 @@ public override void OnEnable()
m_EnableVolumetricFog = Unpack(o.Find(x => x.enableVolumetricFog));
m_DepthExtent = Unpack(o.Find(x => x.depthExtent));
m_SliceDistributionUniformity = Unpack(o.Find(x => x.sliceDistributionUniformity));
+ m_FogControlMode = Unpack(o.Find(x => x.fogControlMode));
m_ScreenResolutionPercentage = Unpack(o.Find(x => x.screenResolutionPercentage));
m_VolumeSliceCount = Unpack(o.Find(x => x.volumeSliceCount));
- m_Filter = Unpack(o.Find(x => x.filter));
+ m_VolumetricFogBudget = Unpack(o.Find(x => x.volumetricFogBudget));
+ m_ResolutionDepthRatio = Unpack(o.Find(x => x.resolutionDepthRatio));
+ m_DirectionalLightsOnly = Unpack(o.Find(x => x.directionalLightsOnly));
+ m_DenoisingMode = Unpack(o.Find(x => x.denoisingMode));
}
public override void OnInspectorGUI()
@@ -113,16 +123,36 @@ public override void OnInspectorGUI()
EditorGUI.indentLevel++;
PropertyField(m_Albedo, s_AlbedoLabel);
- PropertyField(m_Anisotropy, s_AnisotropyLabel);
PropertyField(m_GlobalLightProbeDimmer, s_GlobalLightProbeDimmerLabel);
+ PropertyField(m_DepthExtent, s_DepthExtentLabel);
+ PropertyField(m_DenoisingMode);
if (isInAdvancedMode)
{
- PropertyField(m_DepthExtent);
PropertyField(m_SliceDistributionUniformity);
- PropertyField(m_ScreenResolutionPercentage);
- PropertyField(m_VolumeSliceCount);
- PropertyField(m_Filter);
+ PropertyField(m_FogControlMode);
+ {
+ EditorGUI.indentLevel++;
+ if ((FogControl)m_FogControlMode.value.intValue == FogControl.Balance)
+ {
+ PropertyField(m_VolumetricFogBudget);
+ PropertyField(m_ResolutionDepthRatio);
+ }
+ else
+ {
+ PropertyField(m_ScreenResolutionPercentage);
+ PropertyField(m_VolumeSliceCount);
+ }
+ EditorGUI.indentLevel--;
+ }
+
+ PropertyField(m_DirectionalLightsOnly);
+ PropertyField(m_Anisotropy, s_AnisotropyLabel);
+ if (m_Anisotropy.value.floatValue != 0.0f)
+ {
+ EditorGUILayout.Space();
+ EditorGUILayout.HelpBox("When the value is not 0, the anisotropy effect significantly increases the performance impact of volumetric fog.", MessageType.Info, wide: true);
+ }
}
EditorGUI.indentLevel--;
diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/Fog.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/Fog.cs
index 4146f87177d..112fa8c3a84 100644
--- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/Fog.cs
+++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/Fog.cs
@@ -39,10 +39,6 @@ public class Fog : VolumeComponent
public FloatParameter baseHeight = new FloatParameter(0.0f);
/// Height fog maximum height.
public FloatParameter maximumHeight = new FloatParameter(50.0f);
-
- // Common Fog Parameters (Exponential/Volumetric)
- /// Fog albedo.
- public ColorParameter albedo = new ColorParameter(Color.white);
/// Fog mean free path.
[DisplayInfo(name = "Fog Attenuation Distance")]
public MinFloatParameter meanFreePath = new MinFloatParameter(400.0f, 1.0f);
@@ -51,28 +47,54 @@ public class Fog : VolumeComponent
/// Enable volumetric fog.
[DisplayInfo(name = "Volumetric Fog")]
public BoolParameter enableVolumetricFog = new BoolParameter(false);
- /// Volumetric fog anisotropy.
- public ClampedFloatParameter anisotropy = new ClampedFloatParameter(0.0f, -1.0f, 1.0f);
+ // Common Fog Parameters (Exponential/Volumetric)
+ /// Stores the fog albedo. This defines the color of the fog.
+ public ColorParameter albedo = new ColorParameter(Color.white);
/// Multiplier for ambient probe contribution.
[DisplayInfo(name = "Ambient Light Probe Dimmer")]
public ClampedFloatParameter globalLightProbeDimmer = new ClampedFloatParameter(1.0f, 0.0f, 1.0f);
-
- /// Sets the distance (in meters) from the Camera's Near Clipping Plane to the back of the Camera's volumetric lighting buffer.
- [Tooltip("Sets the distance (in meters) from the Camera's Near Clipping Plane to the back of the Camera's volumetric lighting buffer.")]
+ /// Sets the distance (in meters) from the Camera's Near Clipping Plane to the back of the Camera's volumetric lighting buffer. The lower the distance is, the higher the fog quality is.
public MinFloatParameter depthExtent = new MinFloatParameter(64.0f, 0.1f);
+ /// Controls which denoising technique to use for the volumetric effect.
+ /// Reprojection mode is effective for static lighting but can lead to severe ghosting artifacts with highly dynamic lighting. Gaussian mode is effective with dynamic lighting. You can also use both modes together which produces high-quality results, but increases the resource intensity of processing the effect.
+ [Tooltip("Controls which denoising technique to use for the volumetric effect. Reprojection is very effective for static lighting, but can lead to severe ghosting for highly dynamic lighting. Gaussian is a good alternative for dynamic lighting. Using both techniques can give high quality results but significantly increases the resource intensity of the effect.")]
+ public FogDenoisingModeParameter denoisingMode = new FogDenoisingModeParameter(FogDenoisingMode.Gaussian);
+
+ // Advanced parameters
+ /// Controls the angular distribution of scattered light. 0 is isotropic, 1 is forward scattering, and -1 is backward scattering.
+ public ClampedFloatParameter anisotropy = new ClampedFloatParameter(0.0f, -1.0f, 1.0f);
/// Controls the distribution of slices along the Camera's focal axis. 0 is exponential distribution and 1 is linear distribution.
[Tooltip("Controls the distribution of slices along the Camera's focal axis. 0 is exponential distribution and 1 is linear distribution.")]
public ClampedFloatParameter sliceDistributionUniformity = new ClampedFloatParameter(0.75f, 0, 1);
- /// Resolution of the volumetric buffer (3D texture) along the X and Y axes relative to the resolution of the frame buffer.
- [Tooltip("Resolution of the volumetric buffer, along the x-axis and y-axis, relative to the resolution of the frame buffer.")]
- public ClampedFloatParameter screenResolutionPercentage = new ClampedFloatParameter((1.0f/8.0f) * 100, (1.0f/16.0f) * 100, 100);
+
+ // Limit parameters for the fog quality
+ internal const float minFogScreenResolutionPercentage = (1.0f / 16.0f) * 100;
+ internal const float optimalFogScreenResolutionPercentage = (1.0f / 8.0f) * 100;
+ internal const float maxFogScreenResolutionPercentage = 0.5f * 100;
+ internal const int maxFogSliceCount = 512;
+
+ /// Controls which method to use to control the performance and quality of the volumetric fog.
+ /// Balance mode allows you to use a performance-oriented approach to define the quality of the volumetric fog. Manual mode gives you access to the internal set of properties which directly control the effect.
+ [Tooltip("Controls which method to use to control the performance and quality of the volumetric fog. Balance mode allows you to use a performance-oriented approach to define the quality of the volumetric fog. Manual mode gives you access to the internal set of properties which directly control the effect.")]
+ public FogControlParameter fogControlMode = new FogControlParameter(FogControl.Balance);
+ /// Stores the resolution of the volumetric buffer (3D texture) along the x-axis and y-axis relative to the resolution of the frame buffer.
+ [Tooltip("Stores the resolution of the volumetric buffer (3D texture) along the x-axis and y-axis relative to the resolution of the frame buffer.")]
+ public ClampedFloatParameter screenResolutionPercentage = new ClampedFloatParameter(optimalFogScreenResolutionPercentage, minFogScreenResolutionPercentage, maxFogScreenResolutionPercentage);
/// Number of slices of the volumetric buffer (3D texture) along the camera's focal axis.
[Tooltip("Number of slices of the volumetric buffer (3D texture) along the camera's focal axis.")]
- public ClampedIntParameter volumeSliceCount = new ClampedIntParameter(64, 1, 1024);
+ public ClampedIntParameter volumeSliceCount = new ClampedIntParameter(64, 1, maxFogSliceCount);
+ /// Defines the performance to quality ratio of the volumetric fog. A value of 0 being the least resource-intensive and a value of 1 being the highest quality.
+ /// Try to minimize this value to find a compromise between quality and performance.
+ [Tooltip("Defines the performance to quality ratio of the volumetric fog. A value of 0 being the least resource-intensive and a value of 1 being the highest quality.")]
+ public ClampedFloatParameter volumetricFogBudget = new ClampedFloatParameter(0.25f, 0.0f, 1.0f);
+ /// Controls how Unity shares resources between Screen (XY) and Depth (Z) resolutions.
+ /// A value of 0 means Unity allocates all of the resources to the XY resolution, which reduces aliasing, but increases noise. A value of 1 means Unity allocates all of the resources to the Z resolution, which reduces noise, but increases aliasing. This property allows for linear interpolation between the two configurations.
+ [Tooltip("Controls how Unity shares resources between Screen (XY) and Depth (Z) resolutions.")]
+ public ClampedFloatParameter resolutionDepthRatio = new ClampedFloatParameter(0.5f, 0.0f, 1.0f);
- /// Applies a blur to smoothen the volumetric lighting output.
- [Tooltip("Applies a blur to smoothen the volumetric lighting output.")]
- public BoolParameter filter = new BoolParameter(false);
+ /// Indicates whether Unity includes or excludes non-directional light types when it evaluates the volumetric fog. Including non-directional lights increases the resource intensity of the effect.
+ [Tooltip("Indicates whether Unity includes or excludes non-directional light types when it evaluates the volumetric fog. Including non-directional lights increases the resource intensity of the effect.")]
+ public BoolParameter directionalLightsOnly = new BoolParameter(false);
internal static bool IsFogEnabled(HDCamera hdCamera)
{
@@ -164,8 +186,7 @@ void UpdateShaderVariablesGlobalCBFogParameters(ref ShaderVariablesGlobal cb, HD
cb._HeightFogExponents = new Vector2(1.0f / H, H);
cb._HeightFogBaseHeight = crBaseHeight;
cb._GlobalFogAnisotropy = anisotropy.value;
-
- cb._VolumetricFilteringEnabled = filter.value ? 1 : 0;
+ cb._VolumetricFilteringEnabled = ((int)denoisingMode.value & (int)FogDenoisingMode.Gaussian) != 0 ? 1 : 0;
}
}
@@ -202,4 +223,71 @@ public sealed class FogColorParameter : VolumeParameter
public FogColorParameter(FogColorMode value, bool overrideState = false)
: base(value, overrideState) { }
}
+
+ ///
+ /// Options that control the quality and resource intensity of the volumetric fog.
+ ///
+ public enum FogControl
+ {
+ ///
+ /// Use this mode if you want to change the fog control properties based on a higher abstraction level centered around performance.
+ ///
+ Balance,
+
+ ///
+ /// Use this mode if you want to have direct access to the internal properties that control volumetric fog.
+ ///
+ Manual
+ }
+
+ ///
+ /// A that holds a value.
+ ///
+ [Serializable]
+ public sealed class FogControlParameter : VolumeParameter
+ {
+ ///
+ /// Creates a new instance.
+ ///
+ /// The initial value to store in the parameter.
+ /// The initial override state for the parameter.
+ public FogControlParameter(FogControl value, bool overrideState = false) : base(value, overrideState) { }
+ }
+
+ ///
+ /// Options that control which denoising algorithms Unity should use on the volumetric fog signal.
+ ///
+ public enum FogDenoisingMode
+ {
+ ///
+ /// Use this mode to not filter the volumetric fog.
+ ///
+ None = 0,
+ ///
+ /// Use this mode to reproject data from previous frames to denoise the signal. This is effective for static lighting, but it can lead to severe ghosting artifacts for highly dynamic lighting.
+ ///
+ Reprojection = 1 << 0,
+ ///
+ /// Use this mode to reduce the aliasing patterns that can appear on the volumetric fog.
+ ///
+ Gaussian = 1 << 1,
+ ///
+ /// Use this mode to use both Reprojection and Gaussian filtering techniques. This produces high visual quality, but significantly increases the resource intensity of the effect.
+ ///
+ Both = Reprojection | Gaussian
+ }
+
+ ///
+ /// A that holds a value.
+ ///
+ [Serializable]
+ public sealed class FogDenoisingModeParameter : VolumeParameter
+ {
+ ///
+ /// Creates a new instance.
+ ///
+ /// The initial value to store in the parameter.
+ /// The initial override state for the parameter.
+ public FogDenoisingModeParameter(FogDenoisingMode value, bool overrideState = false) : base(value, overrideState) { }
+ }
}
diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricLighting.compute b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricLighting.compute
index b9be1a26c11..558461aee35 100644
--- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricLighting.compute
+++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricLighting.compute
@@ -11,6 +11,7 @@
#pragma multi_compile _ ENABLE_REPROJECTION
#pragma multi_compile _ ENABLE_ANISOTROPY
#pragma multi_compile _ VL_PRESET_OPTIMAL
+#pragma multi_compile _ SUPPORT_LOCAL_LIGHTS
#ifndef LIGHTLOOP_DISABLE_TILE_AND_CLUSTER
#define USE_BIG_TILE_LIGHTLIST
@@ -18,6 +19,7 @@
// Don't want contact shadows
#define LIGHT_EVALUATION_NO_CONTACT_SHADOWS // To define before LightEvaluation.hlsl
+// #define LIGHT_EVALUATION_NO_HEIGHT_FOG
#ifndef LIGHTLOOP_DISABLE_TILE_AND_CLUSTER
#define USE_BIG_TILE_LIGHTLIST
@@ -30,7 +32,6 @@
#define PREFER_HALF 0
#define GROUP_SIZE_1D 8
-#define SUPPORT_LOCAL_LIGHTS 1 // Local lights contribute to fog lighting
#define SHADOW_USE_DEPTH_BIAS 0 // Too expensive, not particularly effective
#define SHADOW_LOW // Too expensive
#define SHADOW_AUTO_FLIP_NORMAL 0 // No normal information, so no need to flip
@@ -558,7 +559,7 @@ void FillVolumetricLightingBuffer(LightLoopContext context, uint featureFlags,
aggregateLighting.radianceComplete += lighting.radianceComplete;
}
- #if (SUPPORT_LOCAL_LIGHTS != 0)
+ #ifdef SUPPORT_LOCAL_LIGHTS
{
VoxelLighting lighting = EvaluateVoxelLightingLocal(context, featureFlags, posInput,
lightCount, lightStart,
diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricLighting.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricLighting.cs
index db409abb3da..9e9123ee84e 100644
--- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricLighting.cs
+++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricLighting.cs
@@ -258,18 +258,35 @@ static internal Vector3Int ComputeVolumetricViewportSize(HDCamera hdCamera, ref
int viewportWidth = hdCamera.actualWidth;
int viewportHeight = hdCamera.actualHeight;
- float screenFraction = controller.screenResolutionPercentage.value * 0.01f;
- int sliceCount = controller.volumeSliceCount.value;
+
+ float screenFraction;
+ int sliceCount;
+ if (controller.fogControlMode.value == FogControl.Balance)
+ {
+ // Evaluate the ssFraction and sliceCount based on the control parameters
+ float maxScreenSpaceFraction = (1.0f - controller.resolutionDepthRatio.value) * (Fog.maxFogScreenResolutionPercentage - Fog.minFogScreenResolutionPercentage) + Fog.minFogScreenResolutionPercentage;
+ screenFraction = Mathf.Lerp(Fog.minFogScreenResolutionPercentage, maxScreenSpaceFraction, controller.volumetricFogBudget.value) * 0.01f;
+ float maxSliceCount = Mathf.Max(1.0f, controller.resolutionDepthRatio.value * Fog.maxFogSliceCount);
+ sliceCount = (int)Mathf.Lerp(1.0f, maxSliceCount, controller.volumetricFogBudget.value);
+
+ // Evaluate the voxel size
+ voxelSize = 1.0f / screenFraction;
+ }
+ else
+ {
+ screenFraction = controller.screenResolutionPercentage.value * 0.01f;
+ sliceCount = controller.volumeSliceCount.value;
+
+ if (controller.screenResolutionPercentage.value == Fog.optimalFogScreenResolutionPercentage)
+ voxelSize = 8;
+ else
+ voxelSize = 1.0f / screenFraction; // Does not account for rounding (same function, above)
+ }
int w = Mathf.RoundToInt(viewportWidth * screenFraction);
int h = Mathf.RoundToInt(viewportHeight * screenFraction);
int d = sliceCount;
- if (controller.screenResolutionPercentage.value == (1.0f/8.0f) * 100)
- voxelSize = 8;
- else
- voxelSize = 1.0f / screenFraction; // Does not account for rounding (same function, above)
-
return new Vector3Int(w, h, d);
}
@@ -863,41 +880,23 @@ VolumetricLightingParameters PrepareVolumetricLightingParameters(HDCamera hdCame
// Only available in the Play Mode because all the frame counters in the Edit Mode are broken.
parameters.tiledLighting = hdCamera.frameSettings.IsEnabled(FrameSettingsField.BigTilePrepass);
- parameters.enableReprojection = hdCamera.IsVolumetricReprojectionEnabled();
+ bool volumeAllowsReprojection = ((int)fog.denoisingMode.value & (int)FogDenoisingMode.Reprojection) != 0;
+ parameters.enableReprojection = hdCamera.IsVolumetricReprojectionEnabled() && volumeAllowsReprojection;
bool enableAnisotropy = fog.anisotropy.value != 0;
+ // The multi-pass integration is only possible if re-projection is possible and the effect is not in anisotropic mode.
bool optimal = currParams.voxelSize == 8;
-
parameters.volumetricLightingCS = m_VolumetricLightingCS;
+ parameters.volumetricLightingFilteringCS = m_VolumetricLightingFilteringCS;
parameters.volumetricLightingCS.shaderKeywords = null;
- if(!parameters.tiledLighting)
- {
- parameters.volumetricLightingCS.EnableKeyword("LIGHTLOOP_DISABLE_TILE_AND_CLUSTER");
- }
-
- if(parameters.enableReprojection)
- {
- parameters.volumetricLightingCS.EnableKeyword("ENABLE_REPROJECTION");
- }
-
- if(enableAnisotropy)
- {
- parameters.volumetricLightingCS.EnableKeyword("ENABLE_ANISOTROPY");
- }
-
- if (optimal)
- {
- parameters.volumetricLightingCS.EnableKeyword("VL_PRESET_OPTIMAL");
- }
- else
- {
- parameters.volumetricLightingCS.DisableKeyword("VL_PRESET_OPTIMAL");
- }
+ CoreUtils.SetKeyword(parameters.volumetricLightingCS, "LIGHTLOOP_DISABLE_TILE_AND_CLUSTER", !parameters.tiledLighting);
+ CoreUtils.SetKeyword(parameters.volumetricLightingCS, "ENABLE_REPROJECTION", parameters.enableReprojection);
+ CoreUtils.SetKeyword(parameters.volumetricLightingCS, "ENABLE_ANISOTROPY", enableAnisotropy);
+ CoreUtils.SetKeyword(parameters.volumetricLightingCS, "VL_PRESET_OPTIMAL", optimal);
+ CoreUtils.SetKeyword(parameters.volumetricLightingCS, "SUPPORT_LOCAL_LIGHTS", !fog.directionalLightsOnly.value);
parameters.volumetricLightingKernel = parameters.volumetricLightingCS.FindKernel("VolumetricLighting");
-
- parameters.volumetricLightingFilteringCS = m_VolumetricLightingFilteringCS;
parameters.volumetricFilteringKernelX = parameters.volumetricLightingFilteringCS.FindKernel("FilterVolumetricLightingX");
parameters.volumetricFilteringKernelY = parameters.volumetricLightingFilteringCS.FindKernel("FilterVolumetricLightingY");
@@ -905,7 +904,7 @@ VolumetricLightingParameters PrepareVolumetricLightingParameters(HDCamera hdCame
parameters.resolution = new Vector4(cvp.x, cvp.y, 1.0f / cvp.x, 1.0f / cvp.y);
parameters.viewCount = hdCamera.viewCount;
- parameters.filterVolume = fog.filter.value;
+ parameters.filterVolume = ((int)fog.denoisingMode.value & (int)FogDenoisingMode.Gaussian) != 0;
UpdateShaderVariableslVolumetrics(ref m_ShaderVariablesVolumetricCB, hdCamera, parameters.resolution, frameIndex);
parameters.volumetricCB = m_ShaderVariablesVolumetricCB;
@@ -947,7 +946,7 @@ static void FilterVolumetricLighting(in VolumetricLightingParameters parameters,
{
using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.VolumetricLightingFiltering)))
{
- ConstantBuffer.Push(cmd, parameters.volumetricCB, parameters.volumetricLightingCS, HDShaderIDs._ShaderVariablesVolumetric);
+ ConstantBuffer.Push(cmd, parameters.volumetricCB, parameters.volumetricLightingFilteringCS, HDShaderIDs._ShaderVariablesVolumetric);
// The shader defines GROUP_SIZE_1D = 8.
cmd.SetComputeTextureParam(parameters.volumetricLightingFilteringCS, parameters.volumetricFilteringKernelX, HDShaderIDs._VBufferFilteringInput, inputBuffer); // Read
diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricLightingFiltering.compute b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricLightingFiltering.compute
index cdac4487cbd..4144767dd59 100644
--- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricLightingFiltering.compute
+++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricLightingFiltering.compute
@@ -5,8 +5,9 @@
// #pragma enable_d3d11_debug_symbols
#pragma only_renderers d3d11 playstation xboxone vulkan metal switch
-#pragma kernel FilterVolumetricLightingX FilterVolumetricLighting=FilterVolumetricLightingX LIGHTLOOP_DISABLE_TILE_AND_CLUSTER VL_PRESET_HQ
-#pragma kernel FilterVolumetricLightingY FilterVolumetricLighting=FilterVolumetricLightingY LIGHTLOOP_DISABLE_TILE_AND_CLUSTER VL_PRESET_HQ VERTICAL_PASS
+#pragma kernel FilterVolumetricLightingX FilterVolumetricLighting=FilterVolumetricLightingX
+#pragma kernel FilterVolumetricLightingY FilterVolumetricLighting=FilterVolumetricLightingY VERTICAL_PASS
+
//--------------------------------------------------------------------------------------------------
// Included headers
@@ -15,17 +16,18 @@
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Builtin/BuiltinData.hlsl"
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
+#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/VolumetricLighting.cs.hlsl"
//--------------------------------------------------------------------------------------------------
// Inputs & outputs
//--------------------------------------------------------------------------------------------------
-RW_TEXTURE3D(float4, _VBufferFilteringInput);
+TEXTURE3D(_VBufferFilteringInput);
RW_TEXTURE3D(float4, _VBufferFilteringOutput);
-#define SIGMA_FILTER 2.0
-#define GROUP_SIZE_1D 8
+#define GAUSSIAN_SIGMA 1.0
+#define GROUP_SIZE_1D 8
float Gaussian(float radius, float sigma)
{
@@ -52,26 +54,29 @@ void FilterVolumetricLighting(uint3 dispatchThreadId : SV_DispatchThreadID,
// Compute the output voxel coordinate
uint3 voxelCoord = uint3(currentCoord, currentSlice + _VBufferSliceCount * unity_StereoEyeIndex);
- // Values used for accumulation
- float sumW = 0.0;
- float4 value = float4(0.0, 0.0, 0.0, 0.0);
+ // The interation direction is different depending on which pass
#ifdef VERTICAL_PASS
- int3 vec = int3(0, 1, 0);
+ const int3 vec = int3(0, 1, 0);
#else
- int3 vec = int3(1, 0, 0);
+ const int3 vec = int3(1, 0, 0);
#endif
- // Compute the radius for this slice
- int radius = currentSlice > halfSliceCount ? 2 : 1;
- // Loop through the values required for our kernel
+ // Values used for accumulation
+ float sumW = 0.0;
+ float4 value = float4(0.0, 0.0, 0.0, 0.0);
+
+ const int radius = 1;
+
for (int idx = -radius; idx <= radius; ++idx)
{
// Compute the next tapping coordinate
- int3 tapCoord = int3(voxelCoord.x, voxelCoord.y, voxelCoord.z) + vec * idx;
+ const int3 tapCoord = int3(voxelCoord.x, voxelCoord.y, voxelCoord.z) + vec * idx;
+
// Tap the value we should be tapping from
float4 currentValue = _VBufferFilteringInput[tapCoord];
+
// Compute the weight for this tap
- float weight = Gaussian(abs(idx), SIGMA_FILTER);
+ float weight = Gaussian(abs(idx), GAUSSIAN_SIGMA);
// If this is outside of the image, force the weight to 0
#ifdef VERTICAL_PASS
@@ -89,6 +94,7 @@ void FilterVolumetricLighting(uint3 dispatchThreadId : SV_DispatchThreadID,
value += currentValue * weight;
sumW += weight;
}
+
// Normalize and output
_VBufferFilteringOutput[voxelCoord] = value / sumW;
}
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 ff6c77d5cd0..9c29e1faf00 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
@@ -431,11 +431,11 @@ internal bool IsSSGIEnabled()
internal bool IsVolumetricReprojectionEnabled()
{
bool a = Fog.IsVolumetricFogEnabled(this);
- bool b = frameSettings.IsEnabled(FrameSettingsField.ReprojectionForVolumetrics);
- bool c = camera.cameraType == CameraType.Game;
- bool d = Application.isPlaying;
+ // We only enable volumetric re projection if we are processing the game view or a scene view with animated materials on
+ bool b = camera.cameraType == CameraType.Game || (camera.cameraType == CameraType.SceneView && CoreUtils.AreAnimatedMaterialsEnabled(camera));
+ bool c = frameSettings.IsEnabled(FrameSettingsField.ReprojectionForVolumetrics);
- return a && b && c && d;
+ return a && b && c;
}
// Pass all the systems that may want to update per-camera data here.