diff --git a/TestProjects/HDRP_DXR_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/101_ReflectionsPerfFullRes.png b/TestProjects/HDRP_DXR_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/101_ReflectionsPerfFullRes.png index ef073d25f16..c8ca173e2db 100644 --- a/TestProjects/HDRP_DXR_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/101_ReflectionsPerfFullRes.png +++ b/TestProjects/HDRP_DXR_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/101_ReflectionsPerfFullRes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7736808255850b815b212d69943c54549b2a23668c047a3a12d61911825a4f6b -size 75333 +oid sha256:fda7ffe4224937278c9385bb315506d827d1936c7e1559bbaaec1e8d2f816078 +size 73039 diff --git a/TestProjects/HDRP_DXR_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/102_ReflectionsPerfHalfRes.png b/TestProjects/HDRP_DXR_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/102_ReflectionsPerfHalfRes.png index ce3475f1f6d..4de911b30b7 100644 --- a/TestProjects/HDRP_DXR_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/102_ReflectionsPerfHalfRes.png +++ b/TestProjects/HDRP_DXR_Tests/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D12/None/102_ReflectionsPerfHalfRes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ea4621323514e023eeef5f50269a4969270c757782a35d0833abd2be872620f9 -size 99767 +oid sha256:c0a090174d200bbf162672e5bd138ca0b3e99e5e69183023c395c3d6cce4028b +size 88268 diff --git a/TestProjects/HDRP_DXR_Tests/Assets/Scenes/905_Materials_SG_TransparentRTR/TransparentRTR.asset b/TestProjects/HDRP_DXR_Tests/Assets/Scenes/905_Materials_SG_TransparentRTR/TransparentRTR.asset index ade36c70780..7ba8dd04c04 100644 --- a/TestProjects/HDRP_DXR_Tests/Assets/Scenes/905_Materials_SG_TransparentRTR/TransparentRTR.asset +++ b/TestProjects/HDRP_DXR_Tests/Assets/Scenes/905_Materials_SG_TransparentRTR/TransparentRTR.asset @@ -52,6 +52,27 @@ MonoBehaviour: hdriSky: m_OverrideState: 1 m_Value: {fileID: 8900000, guid: 614ae0372d7dfb847a1926990e89fa06, type: 3} + enableDistortion: + m_OverrideState: 0 + m_Value: 0 + procedural: + m_OverrideState: 0 + m_Value: 1 + flowmap: + m_OverrideState: 0 + m_Value: {fileID: 0} + upperHemisphereOnly: + m_OverrideState: 0 + m_Value: 1 + scrollDirection: + m_OverrideState: 0 + m_Value: 0 + min: 0 + max: 360 + scrollSpeed: + m_OverrideState: 0 + m_Value: 2 + min: 0 enableBackplate: m_OverrideState: 0 m_Value: 0 @@ -201,16 +222,6 @@ MonoBehaviour: rayTracing: m_OverrideState: 1 m_Value: 1 - minSmoothness: - m_OverrideState: 1 - m_Value: 0 - min: 0 - max: 1 - smoothnessFadeStart: - m_OverrideState: 0 - m_Value: 0.9 - min: 0 - max: 1 reflectSky: m_OverrideState: 0 m_Value: 1 @@ -229,33 +240,9 @@ MonoBehaviour: m_Value: serializedVersion: 2 m_Bits: 4294967295 - rayLength: - m_OverrideState: 1 - m_Value: 50 - min: 0.001 - max: 50 - clampValue: - m_OverrideState: 0 - m_Value: 1 - min: 0.001 - max: 10 - denoise: - m_OverrideState: 1 - m_Value: 0 - denoiserRadius: - m_OverrideState: 0 - m_Value: 8 - min: 1 - max: 32 mode: - m_OverrideState: 0 - m_Value: 2 - upscaleRadius: - m_OverrideState: 0 + m_OverrideState: 1 m_Value: 2 - fullResolution: - m_OverrideState: 0 - m_Value: 0 sampleCount: m_OverrideState: 0 m_Value: 1 @@ -266,6 +253,42 @@ MonoBehaviour: m_Value: 1 min: 1 max: 31 + m_MinSmoothness: + m_OverrideState: 1 + m_Value: 0 + min: 0 + max: 1 + m_SmoothnessFadeStart: + m_OverrideState: 0 + m_Value: 0.9 + min: 0 + max: 1 m_RayMaxIterations: m_OverrideState: 0 m_Value: 32 + m_RayLength: + m_OverrideState: 1 + m_Value: 50 + min: 0.001 + max: 50 + m_ClampValue: + m_OverrideState: 0 + m_Value: 1 + min: 0.001 + max: 10 + m_UpscaleRadius: + m_OverrideState: 0 + m_Value: 2 + min: 2 + max: 6 + m_FullResolution: + m_OverrideState: 0 + m_Value: 0 + m_Denoise: + m_OverrideState: 1 + m_Value: 0 + m_DenoiserRadius: + m_OverrideState: 0 + m_Value: 8 + min: 1 + max: 32 diff --git a/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/RayTracedReflectionsNoisy.asset b/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/RayTracedReflectionsNoisy.asset index eb668fd2aa7..3583746e366 100644 --- a/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/RayTracedReflectionsNoisy.asset +++ b/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/RayTracedReflectionsNoisy.asset @@ -68,6 +68,27 @@ MonoBehaviour: hdriSky: m_OverrideState: 1 m_Value: {fileID: 8900000, guid: 5fb993a599e7e9b4b825e1a28e6d2c07, type: 3} + enableDistortion: + m_OverrideState: 0 + m_Value: 0 + procedural: + m_OverrideState: 0 + m_Value: 1 + flowmap: + m_OverrideState: 0 + m_Value: {fileID: 0} + upperHemisphereOnly: + m_OverrideState: 0 + m_Value: 1 + scrollDirection: + m_OverrideState: 0 + m_Value: 0 + min: 0 + max: 360 + scrollSpeed: + m_OverrideState: 0 + m_Value: 2 + min: 0 enableBackplate: m_OverrideState: 0 m_Value: 0 @@ -163,16 +184,6 @@ MonoBehaviour: rayTracing: m_OverrideState: 1 m_Value: 1 - minSmoothness: - m_OverrideState: 1 - m_Value: 0.5 - min: 0 - max: 1 - smoothnessFadeStart: - m_OverrideState: 1 - m_Value: 0.7 - min: 0 - max: 1 reflectSky: m_OverrideState: 1 m_Value: 1 @@ -191,33 +202,9 @@ MonoBehaviour: m_Value: serializedVersion: 2 m_Bits: 4294967295 - rayLength: - m_OverrideState: 1 - m_Value: 50 - min: 0.001 - max: 50 - clampValue: - m_OverrideState: 1 - m_Value: 0.75 - min: 0.001 - max: 10 - denoise: - m_OverrideState: 0 - m_Value: 0 - denoiserRadius: - m_OverrideState: 0 - m_Value: 16 - min: 1 - max: 32 mode: m_OverrideState: 1 m_Value: 2 - upscaleRadius: - m_OverrideState: 0 - m_Value: 4 - fullResolution: - m_OverrideState: 0 - m_Value: 0 sampleCount: m_OverrideState: 0 m_Value: 1 @@ -228,6 +215,42 @@ MonoBehaviour: m_Value: 1 min: 1 max: 31 + m_MinSmoothness: + m_OverrideState: 1 + m_Value: 0.5 + min: 0 + max: 1 + m_SmoothnessFadeStart: + m_OverrideState: 1 + m_Value: 0.7 + min: 0 + max: 1 m_RayMaxIterations: m_OverrideState: 1 m_Value: 22 + m_RayLength: + m_OverrideState: 1 + m_Value: 50 + min: 0.001 + max: 50 + m_ClampValue: + m_OverrideState: 1 + m_Value: 0.75 + min: 0.001 + max: 10 + m_UpscaleRadius: + m_OverrideState: 0 + m_Value: 4 + min: 2 + max: 6 + m_FullResolution: + m_OverrideState: 0 + m_Value: 0 + m_Denoise: + m_OverrideState: 1 + m_Value: 0 + m_DenoiserRadius: + m_OverrideState: 0 + m_Value: 16 + min: 1 + max: 32 diff --git a/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/RayTracedReflectionsPerfFull.asset b/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/RayTracedReflectionsPerfFull.asset index 05d940c7a43..f2d11c8f251 100644 --- a/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/RayTracedReflectionsPerfFull.asset +++ b/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/RayTracedReflectionsPerfFull.asset @@ -52,6 +52,27 @@ MonoBehaviour: hdriSky: m_OverrideState: 1 m_Value: {fileID: 8900000, guid: 75f8ba90acb52d14d9ead53b2a9e4190, type: 3} + enableDistortion: + m_OverrideState: 0 + m_Value: 0 + procedural: + m_OverrideState: 0 + m_Value: 1 + flowmap: + m_OverrideState: 0 + m_Value: {fileID: 0} + upperHemisphereOnly: + m_OverrideState: 0 + m_Value: 1 + scrollDirection: + m_OverrideState: 0 + m_Value: 0 + min: 0 + max: 360 + scrollSpeed: + m_OverrideState: 0 + m_Value: 2 + min: 0 enableBackplate: m_OverrideState: 0 m_Value: 0 @@ -289,6 +310,39 @@ MonoBehaviour: m_OverrideState: 0 m_Value: 1 min: 0.001 + weightTextureMask: + m_OverrideState: 0 + m_Value: {fileID: 0} + histogramPercentages: + m_OverrideState: 0 + m_Value: {x: 40, y: 90} + min: 0 + max: 100 + histogramUseCurveRemapping: + m_OverrideState: 0 + m_Value: 0 + targetMidGray: + m_OverrideState: 0 + m_Value: 0 + centerAroundExposureTarget: + m_OverrideState: 0 + m_Value: 0 + proceduralCenter: + m_OverrideState: 0 + m_Value: {x: 0.5, y: 0.5} + proceduralRadii: + m_OverrideState: 0 + m_Value: {x: 0.15, y: 0.15} + maskMinIntensity: + m_OverrideState: 0 + m_Value: -30 + maskMaxIntensity: + m_OverrideState: 0 + m_Value: 30 + proceduralSoftness: + m_OverrideState: 0 + m_Value: 0.5 + min: 0 --- !u!114 &3564700782616824417 MonoBehaviour: m_ObjectHideFlags: 3 @@ -304,24 +358,14 @@ MonoBehaviour: active: 1 m_AdvancedMode: 0 quality: - m_OverrideState: 0 - m_Value: 1 + m_OverrideState: 1 + m_Value: 3 enabled: m_OverrideState: 1 m_Value: 1 rayTracing: m_OverrideState: 1 m_Value: 1 - minSmoothness: - m_OverrideState: 0 - m_Value: 0.9 - min: 0 - max: 1 - smoothnessFadeStart: - m_OverrideState: 0 - m_Value: 0.9 - min: 0 - max: 1 reflectSky: m_OverrideState: 0 m_Value: 1 @@ -340,33 +384,9 @@ MonoBehaviour: m_Value: serializedVersion: 2 m_Bits: 4294967295 - rayLength: - m_OverrideState: 1 - m_Value: 15.7 - min: 0.001 - max: 50 - clampValue: - m_OverrideState: 0 - m_Value: 1 - min: 0.001 - max: 10 - denoise: - m_OverrideState: 0 - m_Value: 0 - denoiserRadius: - m_OverrideState: 0 - m_Value: 16 - min: 1 - max: 32 mode: m_OverrideState: 1 m_Value: 1 - upscaleRadius: - m_OverrideState: 1 - m_Value: 2 - fullResolution: - m_OverrideState: 1 - m_Value: 1 sampleCount: m_OverrideState: 0 m_Value: 1 @@ -377,9 +397,45 @@ MonoBehaviour: m_Value: 1 min: 1 max: 31 + m_MinSmoothness: + m_OverrideState: 0 + m_Value: 0.9 + min: 0 + max: 1 + m_SmoothnessFadeStart: + m_OverrideState: 0 + m_Value: 0.9 + min: 0 + max: 1 m_RayMaxIterations: m_OverrideState: 0 m_Value: 32 + m_RayLength: + m_OverrideState: 1 + m_Value: 15.7 + min: 0.001 + max: 50 + m_ClampValue: + m_OverrideState: 0 + m_Value: 1 + min: 0.001 + max: 10 + m_UpscaleRadius: + m_OverrideState: 1 + m_Value: 2 + min: 2 + max: 6 + m_FullResolution: + m_OverrideState: 1 + m_Value: 1 + m_Denoise: + m_OverrideState: 0 + m_Value: 0 + m_DenoiserRadius: + m_OverrideState: 0 + m_Value: 16 + min: 1 + max: 32 --- !u!114 &8436036751141806562 MonoBehaviour: m_ObjectHideFlags: 3 diff --git a/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/RayTracedReflectionsPerfHalf.asset b/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/RayTracedReflectionsPerfHalf.asset index 9cb704c7457..a462a78ac70 100644 --- a/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/RayTracedReflectionsPerfHalf.asset +++ b/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/RayTracedReflectionsPerfHalf.asset @@ -52,6 +52,27 @@ MonoBehaviour: hdriSky: m_OverrideState: 1 m_Value: {fileID: 8900000, guid: 75f8ba90acb52d14d9ead53b2a9e4190, type: 3} + enableDistortion: + m_OverrideState: 0 + m_Value: 0 + procedural: + m_OverrideState: 0 + m_Value: 1 + flowmap: + m_OverrideState: 0 + m_Value: {fileID: 0} + upperHemisphereOnly: + m_OverrideState: 0 + m_Value: 1 + scrollDirection: + m_OverrideState: 0 + m_Value: 0 + min: 0 + max: 360 + scrollSpeed: + m_OverrideState: 0 + m_Value: 2 + min: 0 enableBackplate: m_OverrideState: 0 m_Value: 0 @@ -289,6 +310,39 @@ MonoBehaviour: m_OverrideState: 0 m_Value: 1 min: 0.001 + weightTextureMask: + m_OverrideState: 0 + m_Value: {fileID: 0} + histogramPercentages: + m_OverrideState: 0 + m_Value: {x: 40, y: 90} + min: 0 + max: 100 + histogramUseCurveRemapping: + m_OverrideState: 0 + m_Value: 0 + targetMidGray: + m_OverrideState: 0 + m_Value: 0 + centerAroundExposureTarget: + m_OverrideState: 0 + m_Value: 0 + proceduralCenter: + m_OverrideState: 0 + m_Value: {x: 0.5, y: 0.5} + proceduralRadii: + m_OverrideState: 0 + m_Value: {x: 0.15, y: 0.15} + maskMinIntensity: + m_OverrideState: 0 + m_Value: -30 + maskMaxIntensity: + m_OverrideState: 0 + m_Value: 30 + proceduralSoftness: + m_OverrideState: 0 + m_Value: 0.5 + min: 0 --- !u!114 &3564700782616824417 MonoBehaviour: m_ObjectHideFlags: 3 @@ -304,24 +358,14 @@ MonoBehaviour: active: 1 m_AdvancedMode: 0 quality: - m_OverrideState: 0 - m_Value: 1 + m_OverrideState: 1 + m_Value: 3 enabled: m_OverrideState: 1 m_Value: 1 rayTracing: m_OverrideState: 1 m_Value: 1 - minSmoothness: - m_OverrideState: 0 - m_Value: 0.9 - min: 0 - max: 1 - smoothnessFadeStart: - m_OverrideState: 0 - m_Value: 0.9 - min: 0 - max: 1 reflectSky: m_OverrideState: 0 m_Value: 1 @@ -340,33 +384,9 @@ MonoBehaviour: m_Value: serializedVersion: 2 m_Bits: 4294967295 - rayLength: - m_OverrideState: 1 - m_Value: 15.7 - min: 0.001 - max: 50 - clampValue: - m_OverrideState: 0 - m_Value: 1 - min: 0.001 - max: 10 - denoise: - m_OverrideState: 0 - m_Value: 0 - denoiserRadius: - m_OverrideState: 0 - m_Value: 16 - min: 1 - max: 32 mode: m_OverrideState: 1 m_Value: 1 - upscaleRadius: - m_OverrideState: 1 - m_Value: 2 - fullResolution: - m_OverrideState: 1 - m_Value: 0 sampleCount: m_OverrideState: 0 m_Value: 1 @@ -377,9 +397,45 @@ MonoBehaviour: m_Value: 1 min: 1 max: 31 + m_MinSmoothness: + m_OverrideState: 0 + m_Value: 0.9 + min: 0 + max: 1 + m_SmoothnessFadeStart: + m_OverrideState: 0 + m_Value: 0.9 + min: 0 + max: 1 m_RayMaxIterations: m_OverrideState: 0 m_Value: 32 + m_RayLength: + m_OverrideState: 1 + m_Value: 15.7 + min: 0.001 + max: 50 + m_ClampValue: + m_OverrideState: 0 + m_Value: 1 + min: 0.001 + max: 10 + m_UpscaleRadius: + m_OverrideState: 1 + m_Value: 2 + min: 2 + max: 6 + m_FullResolution: + m_OverrideState: 1 + m_Value: 0 + m_Denoise: + m_OverrideState: 0 + m_Value: 0 + m_DenoiserRadius: + m_OverrideState: 0 + m_Value: 16 + min: 1 + max: 32 --- !u!114 &8436036751141806562 MonoBehaviour: m_ObjectHideFlags: 3 diff --git a/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/RayTracedReflectionsQuality.asset b/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/RayTracedReflectionsQuality.asset index 147a0e78358..d104e30b99d 100644 --- a/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/RayTracedReflectionsQuality.asset +++ b/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RayTracedReflectionsData/RayTracedReflectionsQuality.asset @@ -52,6 +52,27 @@ MonoBehaviour: hdriSky: m_OverrideState: 1 m_Value: {fileID: 8900000, guid: 75f8ba90acb52d14d9ead53b2a9e4190, type: 3} + enableDistortion: + m_OverrideState: 0 + m_Value: 0 + procedural: + m_OverrideState: 0 + m_Value: 1 + flowmap: + m_OverrideState: 0 + m_Value: {fileID: 0} + upperHemisphereOnly: + m_OverrideState: 0 + m_Value: 1 + scrollDirection: + m_OverrideState: 0 + m_Value: 0 + min: 0 + max: 360 + scrollSpeed: + m_OverrideState: 0 + m_Value: 2 + min: 0 enableBackplate: m_OverrideState: 0 m_Value: 0 @@ -289,6 +310,39 @@ MonoBehaviour: m_OverrideState: 0 m_Value: 1 min: 0.001 + weightTextureMask: + m_OverrideState: 0 + m_Value: {fileID: 0} + histogramPercentages: + m_OverrideState: 0 + m_Value: {x: 40, y: 90} + min: 0 + max: 100 + histogramUseCurveRemapping: + m_OverrideState: 0 + m_Value: 0 + targetMidGray: + m_OverrideState: 0 + m_Value: 0 + centerAroundExposureTarget: + m_OverrideState: 0 + m_Value: 0 + proceduralCenter: + m_OverrideState: 0 + m_Value: {x: 0.5, y: 0.5} + proceduralRadii: + m_OverrideState: 0 + m_Value: {x: 0.15, y: 0.15} + maskMinIntensity: + m_OverrideState: 0 + m_Value: -30 + maskMaxIntensity: + m_OverrideState: 0 + m_Value: 30 + proceduralSoftness: + m_OverrideState: 0 + m_Value: 0.5 + min: 0 --- !u!114 &3564700782616824417 MonoBehaviour: m_ObjectHideFlags: 3 @@ -304,24 +358,14 @@ MonoBehaviour: active: 1 m_AdvancedMode: 0 quality: - m_OverrideState: 0 - m_Value: 1 + m_OverrideState: 1 + m_Value: 3 enabled: m_OverrideState: 1 m_Value: 1 rayTracing: m_OverrideState: 1 m_Value: 1 - minSmoothness: - m_OverrideState: 0 - m_Value: 0.9 - min: 0 - max: 1 - smoothnessFadeStart: - m_OverrideState: 0 - m_Value: 0.9 - min: 0 - max: 1 reflectSky: m_OverrideState: 0 m_Value: 1 @@ -340,33 +384,9 @@ MonoBehaviour: m_Value: serializedVersion: 2 m_Bits: 4294967295 - rayLength: - m_OverrideState: 1 - m_Value: 50 - min: 0.001 - max: 50 - clampValue: - m_OverrideState: 0 - m_Value: 1 - min: 0.001 - max: 10 - denoise: - m_OverrideState: 0 - m_Value: 0 - denoiserRadius: - m_OverrideState: 0 - m_Value: 16 - min: 1 - max: 32 mode: m_OverrideState: 1 m_Value: 2 - upscaleRadius: - m_OverrideState: 1 - m_Value: 2 - fullResolution: - m_OverrideState: 1 - m_Value: 1 sampleCount: m_OverrideState: 0 m_Value: 1 @@ -377,9 +397,45 @@ MonoBehaviour: m_Value: 2 min: 1 max: 31 + m_MinSmoothness: + m_OverrideState: 0 + m_Value: 0.9 + min: 0 + max: 1 + m_SmoothnessFadeStart: + m_OverrideState: 0 + m_Value: 0.9 + min: 0 + max: 1 m_RayMaxIterations: m_OverrideState: 0 m_Value: 32 + m_RayLength: + m_OverrideState: 1 + m_Value: 50 + min: 0.001 + max: 50 + m_ClampValue: + m_OverrideState: 0 + m_Value: 1 + min: 0.001 + max: 10 + m_UpscaleRadius: + m_OverrideState: 1 + m_Value: 2 + min: 2 + max: 6 + m_FullResolution: + m_OverrideState: 1 + m_Value: 1 + m_Denoise: + m_OverrideState: 1 + m_Value: 0 + m_DenoiserRadius: + m_OverrideState: 0 + m_Value: 16 + min: 1 + max: 32 --- !u!114 &8436036751141806562 MonoBehaviour: m_ObjectHideFlags: 3 diff --git a/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RecursiveRenderingData/RecursiveRenderingDisabled.asset b/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RecursiveRenderingData/RecursiveRenderingDisabled.asset index d3ea07499df..8a76c32cc5b 100644 --- a/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RecursiveRenderingData/RecursiveRenderingDisabled.asset +++ b/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RecursiveRenderingData/RecursiveRenderingDisabled.asset @@ -155,6 +155,27 @@ MonoBehaviour: hdriSky: m_OverrideState: 1 m_Value: {fileID: 8900000, guid: a615f6de0224d55408b4e74da3b0bac0, type: 3} + enableDistortion: + m_OverrideState: 0 + m_Value: 0 + procedural: + m_OverrideState: 0 + m_Value: 1 + flowmap: + m_OverrideState: 0 + m_Value: {fileID: 0} + upperHemisphereOnly: + m_OverrideState: 0 + m_Value: 1 + scrollDirection: + m_OverrideState: 0 + m_Value: 0 + min: 0 + max: 360 + scrollSpeed: + m_OverrideState: 0 + m_Value: 2 + min: 0 enableBackplate: m_OverrideState: 0 m_Value: 0 @@ -317,6 +338,11 @@ MonoBehaviour: m_Value: 50 min: 0 max: 50 + minSmoothness: + m_OverrideState: 0 + m_Value: 0.5 + min: 0 + max: 1 --- !u!114 &-196050169322963185 MonoBehaviour: m_ObjectHideFlags: 3 @@ -456,19 +482,12 @@ MonoBehaviour: quality: m_OverrideState: 0 m_Value: 1 + enabled: + m_OverrideState: 0 + m_Value: 1 rayTracing: m_OverrideState: 1 m_Value: 1 - minSmoothness: - m_OverrideState: 0 - m_Value: 0.9 - min: 0 - max: 1 - smoothnessFadeStart: - m_OverrideState: 0 - m_Value: 0.9 - min: 0 - max: 1 reflectSky: m_OverrideState: 0 m_Value: 1 @@ -487,33 +506,9 @@ MonoBehaviour: m_Value: serializedVersion: 2 m_Bits: 4294967295 - rayLength: - m_OverrideState: 0 - m_Value: 10 - min: 0.001 - max: 50 - clampValue: - m_OverrideState: 0 - m_Value: 1 - min: 0.001 - max: 10 - denoise: - m_OverrideState: 0 - m_Value: 0 - denoiserRadius: - m_OverrideState: 0 - m_Value: 16 - min: 1 - max: 32 mode: - m_OverrideState: 0 + m_OverrideState: 1 m_Value: 2 - upscaleRadius: - m_OverrideState: 0 - m_Value: 4 - fullResolution: - m_OverrideState: 0 - m_Value: 0 sampleCount: m_OverrideState: 0 m_Value: 1 @@ -524,9 +519,45 @@ MonoBehaviour: m_Value: 1 min: 1 max: 31 + m_MinSmoothness: + m_OverrideState: 0 + m_Value: 0.9 + min: 0 + max: 1 + m_SmoothnessFadeStart: + m_OverrideState: 0 + m_Value: 0.9 + min: 0 + max: 1 m_RayMaxIterations: m_OverrideState: 0 m_Value: 32 + m_RayLength: + m_OverrideState: 1 + m_Value: 10 + min: 0.001 + max: 50 + m_ClampValue: + m_OverrideState: 0 + m_Value: 1 + min: 0.001 + max: 10 + m_UpscaleRadius: + m_OverrideState: 0 + m_Value: 4 + min: 2 + max: 6 + m_FullResolution: + m_OverrideState: 0 + m_Value: 0 + m_Denoise: + m_OverrideState: 0 + m_Value: 0 + m_DenoiserRadius: + m_OverrideState: 0 + m_Value: 16 + min: 1 + max: 32 --- !u!114 &8140916672878358342 MonoBehaviour: m_ObjectHideFlags: 3 diff --git a/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RecursiveRenderingData/Scene Settings Profile.asset b/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RecursiveRenderingData/Scene Settings Profile.asset index 7380e0ae273..7a51f714c7a 100644 --- a/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RecursiveRenderingData/Scene Settings Profile.asset +++ b/TestProjects/HDRP_DXR_Tests/Assets/Scenes/RecursiveRenderingData/Scene Settings Profile.asset @@ -18,6 +18,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,9 @@ MonoBehaviour: m_OverrideState: 0 m_Value: 0.4115012 min: 0 + upperHemisphereLuxColor: + m_OverrideState: 0 + m_Value: {x: 0, y: 0, z: 0} desiredLuxValue: m_OverrideState: 0 m_Value: 20000 @@ -147,6 +155,76 @@ MonoBehaviour: hdriSky: m_OverrideState: 1 m_Value: {fileID: 8900000, guid: a615f6de0224d55408b4e74da3b0bac0, type: 3} + enableDistortion: + m_OverrideState: 0 + m_Value: 0 + procedural: + m_OverrideState: 0 + m_Value: 1 + flowmap: + m_OverrideState: 0 + m_Value: {fileID: 0} + upperHemisphereOnly: + m_OverrideState: 0 + m_Value: 1 + scrollDirection: + m_OverrideState: 0 + m_Value: 0 + min: 0 + max: 360 + scrollSpeed: + m_OverrideState: 0 + m_Value: 2 + min: 0 + 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!114 &-3615765744027532288 MonoBehaviour: m_ObjectHideFlags: 3 @@ -260,6 +338,11 @@ MonoBehaviour: m_Value: 50 min: 0 max: 50 + minSmoothness: + m_OverrideState: 0 + m_Value: 0.5 + min: 0 + max: 1 --- !u!114 &-196050169322963185 MonoBehaviour: m_ObjectHideFlags: 3 @@ -396,19 +479,15 @@ MonoBehaviour: m_EditorClassIdentifier: active: 1 m_AdvancedMode: 0 + quality: + m_OverrideState: 0 + m_Value: 1 + enabled: + m_OverrideState: 0 + m_Value: 1 rayTracing: m_OverrideState: 1 m_Value: 1 - minSmoothness: - m_OverrideState: 0 - m_Value: 0.9 - min: 0 - max: 1 - smoothnessFadeStart: - m_OverrideState: 0 - m_Value: 0.9 - min: 0 - max: 1 reflectSky: m_OverrideState: 0 m_Value: 1 @@ -422,54 +501,63 @@ MonoBehaviour: m_Value: 0.1 min: 0 max: 1 - rayMaxIterations: - m_OverrideState: 0 - m_Value: 32 layerMask: m_OverrideState: 0 m_Value: serializedVersion: 2 m_Bits: 4294967295 - rayLength: + mode: + m_OverrideState: 1 + m_Value: 2 + sampleCount: + m_OverrideState: 0 + m_Value: 1 + min: 1 + max: 32 + bounceCount: + m_OverrideState: 0 + m_Value: 1 + min: 1 + max: 31 + m_MinSmoothness: + m_OverrideState: 0 + m_Value: 0.9 + min: 0 + max: 1 + m_SmoothnessFadeStart: + m_OverrideState: 0 + m_Value: 0.9 + min: 0 + max: 1 + m_RayMaxIterations: + m_OverrideState: 0 + m_Value: 32 + m_RayLength: m_OverrideState: 0 m_Value: 10 min: 0.001 max: 50 - clampValue: + m_ClampValue: m_OverrideState: 0 m_Value: 1 min: 0.001 max: 10 - denoise: - m_OverrideState: 0 - m_Value: 0 - denoiserRadius: - m_OverrideState: 0 - m_Value: 16 - min: 1 - max: 32 - upscaleRadius: + m_UpscaleRadius: m_OverrideState: 0 m_Value: 4 - fullResolution: + min: 2 + max: 6 + m_FullResolution: m_OverrideState: 0 m_Value: 0 - deferredMode: + m_Denoise: m_OverrideState: 0 m_Value: 0 - rayBinning: + m_DenoiserRadius: m_OverrideState: 0 - m_Value: 0 - sampleCount: - m_OverrideState: 0 - m_Value: 1 + m_Value: 16 min: 1 max: 32 - bounceCount: - m_OverrideState: 0 - m_Value: 1 - min: 1 - max: 31 --- !u!114 &8140916672878358342 MonoBehaviour: m_ObjectHideFlags: 3 diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index b1a2fc0499e..1062fb1374e 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -153,6 +153,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added Cull Mode option for opaque materials and ShaderGraphs. - Added scene view exposure override. - Added support for exposure curve remapping for min/max limits. +- Added presets for ray traced reflections. ### Fixed - Fix when rescale probe all direction below zero (1219246) @@ -688,6 +689,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed an exception occuring when a camera doesn't have an HDAdditionalCameraData (1254383). - Fixed ray tracing with XR single-pass. - Fixed warning in HDAdditionalLightData OnValidate (cases 1250864, 1244578) +- Fixed a bug related to denoising ray traced reflections. ### Changed - Improve MIP selection for decals on Transparents @@ -832,6 +834,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Changing the default SSGI radius for the all configurations. - Changed the default parameters for quality RTGI to match expected behavior. - Add color clear pass while rendering XR occlusion mesh to avoid leaks. +- Only use one texture for ray traced reflection upscaling. +- Adjust the upscale radius based on the roughness value. ## [7.1.1] - 2019-09-05 diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDScreenSpaceReflectionEditor.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDScreenSpaceReflectionEditor.cs index cb69020cfb7..1a1d9457be6 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDScreenSpaceReflectionEditor.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDScreenSpaceReflectionEditor.cs @@ -72,8 +72,104 @@ public override void OnEnable() m_BounceCount = Unpack(o.Find(x => x.bounceCount)); } + static public readonly GUIContent k_RayTracingText = EditorGUIUtility.TrTextContent("Ray Tracing (Preview)", "Enable ray traced reflections."); + static public readonly GUIContent k_ReflectSkyText = EditorGUIUtility.TrTextContent("Reflect Sky", "When enabled, SSR handles sky reflection."); + static public readonly GUIContent k_LayerMaskText = EditorGUIUtility.TrTextContent("Layer Mask", "Layer mask used to include the objects for screen space reflection."); + static public readonly GUIContent k_MinimumSmoothnessText = EditorGUIUtility.TrTextContent("Minimum Smoothness", "Controls the smoothness value at which HDRP activates SSR and the smoothness-controlled fade out stops."); + static public readonly GUIContent k_SmoothnessFadeStartText = EditorGUIUtility.TrTextContent("Smoothness Fade Start", "Controls the smoothness value at which the smoothness-controlled fade out starts. The fade is in the range [Min Smoothness, Smoothness Fade Start]."); + static public readonly GUIContent k_ScreenFaceDistanceText = EditorGUIUtility.TrTextContent("Screen Edge Fade Distance", "Controls the distance at which HDRP fades out SSR near the edge of the screen."); + static public readonly GUIContent k_DepthBufferThicknessText = EditorGUIUtility.TrTextContent("Object Thickness", "Controls the typical thickness of objects the reflection rays may pass behind."); + static public readonly GUIContent k_RayMaxIterationsText = EditorGUIUtility.TrTextContent("Max Ray Steps", "Sets the maximum number of steps HDRP uses for raytracing. Affects both correctness and performance."); + static public readonly GUIContent k_RayLengthText = EditorGUIUtility.TrTextContent("Ray Length", "Controls the length of reflection rays."); + static public readonly GUIContent k_ClampValueText = EditorGUIUtility.TrTextContent("Clamp Value", "Clamps the exposed intensity."); + static public readonly GUIContent k_SampleCountText = EditorGUIUtility.TrTextContent("Sample Count", "Number of samples for reflections."); + static public readonly GUIContent k_BounceCountText = EditorGUIUtility.TrTextContent("Bounce Count", "Number of bounces for reflection rays."); + static public readonly GUIContent k_ModeText = EditorGUIUtility.TrTextContent("Mode", "Controls which version of the effect should be used."); + static public readonly GUIContent k_DenoiseText = EditorGUIUtility.TrTextContent("Denoise", "Enable denoising on the ray traced reflections."); + static public readonly GUIContent k_UpscaleRadiusText = EditorGUIUtility.TrTextContent("Upscale Radius", "Controls the size of the upscale radius."); + static public readonly GUIContent k_FullResolutionText = EditorGUIUtility.TrTextContent("Full Resolution", "Enables full resolution mode."); + static public readonly GUIContent k_DenoiseRadiusText = EditorGUIUtility.TrTextContent("Denoiser Radius", "Controls the radius of reflection denoiser."); + + void RayTracingQualityModeGUI() + { + PropertyField(m_MinSmoothness, k_MinimumSmoothnessText); + PropertyField(m_SmoothnessFadeStart, k_SmoothnessFadeStartText); + m_SmoothnessFadeStart.value.floatValue = Mathf.Max(m_MinSmoothness.value.floatValue, m_SmoothnessFadeStart.value.floatValue); + PropertyField(m_RayLength, k_RayLengthText); + PropertyField(m_ClampValue, k_ClampValueText); + PropertyField(m_SampleCount, k_SampleCountText); + PropertyField(m_BounceCount, k_BounceCountText); + PropertyField(m_Denoise, k_DenoiseText); + { + EditorGUI.indentLevel++; + PropertyField(m_DenoiserRadius, k_DenoiseRadiusText); + EditorGUI.indentLevel--; + } + } + + + void RayTracingPerformanceModeGUI() + { + base.OnInspectorGUI(); + GUI.enabled = useCustomValue; + { + EditorGUI.indentLevel++; + PropertyField(m_MinSmoothness, k_MinimumSmoothnessText); + PropertyField(m_SmoothnessFadeStart, k_SmoothnessFadeStartText); + m_SmoothnessFadeStart.value.floatValue = Mathf.Max(m_MinSmoothness.value.floatValue, m_SmoothnessFadeStart.value.floatValue); + PropertyField(m_RayLength, k_RayLengthText); + PropertyField(m_ClampValue, k_ClampValueText); + PropertyField(m_UpscaleRadius, k_UpscaleRadiusText); + PropertyField(m_FullResolution, k_FullResolutionText); + PropertyField(m_Denoise, k_DenoiseText); + { + EditorGUI.indentLevel++; + PropertyField(m_DenoiserRadius, k_DenoiseRadiusText); + EditorGUI.indentLevel--; + } + EditorGUI.indentLevel--; + } + GUI.enabled = true; + } + + void RayTracedReflectionGUI() + { + HDRenderPipelineAsset currentAsset = HDRenderPipeline.currentAsset; + PropertyField(m_ReflectSky, k_ReflectSkyText); + PropertyField(m_LayerMask, k_LayerMaskText); + + if (currentAsset.currentPlatformRenderPipelineSettings.supportedRayTracingMode == RenderPipelineSettings.SupportedRayTracingMode.Both) + { + PropertyField(m_Mode, k_ModeText); + EditorGUI.indentLevel++; + switch (m_Mode.value.GetEnumValue()) + { + case RayTracingMode.Performance: + { + RayTracingPerformanceModeGUI(); + } + break; + case RayTracingMode.Quality: + { + RayTracingQualityModeGUI(); + } + break; + } + EditorGUI.indentLevel--; + } + else if (currentAsset.currentPlatformRenderPipelineSettings.supportedRayTracingMode == RenderPipelineSettings.SupportedRayTracingMode.Quality) + { + RayTracingQualityModeGUI(); + } + else + { + RayTracingPerformanceModeGUI(); + } + } + public override void OnInspectorGUI() { + // This whole editor has nothing to display if the SSR feature is not supported HDRenderPipelineAsset currentAsset = HDRenderPipeline.currentAsset; if (!currentAsset?.currentPlatformRenderPipelineSettings.supportSSR ?? false) { @@ -84,72 +180,31 @@ public override void OnInspectorGUI() PropertyField(m_Enable, EditorGUIUtility.TrTextContent("Enable")); + // The ray tracing enabling checkbox is only displayed if the asset supports ray tracing bool rayTracingSupported = HDRenderPipeline.pipelineSupportsRayTracing; if (rayTracingSupported) - PropertyField(m_RayTracing, EditorGUIUtility.TrTextContent("Ray Tracing (Preview)", "Enable ray traced reflections.")); - - // Shared Data - PropertyField(m_MinSmoothness, EditorGUIUtility.TrTextContent("Minimum Smoothness", "Controls the smoothness value at which HDRP activates SSR and the smoothness-controlled fade out stops.")); - PropertyField(m_SmoothnessFadeStart, EditorGUIUtility.TrTextContent("Smoothness Fade Start", "Controls the smoothness value at which the smoothness-controlled fade out starts. The fade is in the range [Min Smoothness, Smoothness Fade Start].")); - PropertyField(m_ReflectSky, EditorGUIUtility.TrTextContent("Reflect Sky", "When enabled, SSR handles sky reflection.")); - m_SmoothnessFadeStart.value.floatValue = Mathf.Max(m_MinSmoothness.value.floatValue, m_SmoothnessFadeStart.value.floatValue); + PropertyField(m_RayTracing, k_RayTracingText); - // If ray tracing is supported and it is enabled on this volume, display the ray tracing options. + // The rest of the ray tracing UI is only displayed if the asset supports ray tracing and the checkbox is checked. if (rayTracingSupported && m_RayTracing.overrideState.boolValue && m_RayTracing.value.boolValue) { - PropertyField(m_LayerMask, EditorGUIUtility.TrTextContent("Layer Mask", "Layer mask used to include the objects for screen space reflection.")); - PropertyField(m_RayLength, EditorGUIUtility.TrTextContent("Ray Length", "Controls the length of reflection rays.")); - PropertyField(m_ClampValue, EditorGUIUtility.TrTextContent("Clamp Value", "Clamps the exposed intensity.")); - - if (currentAsset.currentPlatformRenderPipelineSettings.supportedRayTracingMode == RenderPipelineSettings.SupportedRayTracingMode.Both) - { - PropertyField(m_Mode, EditorGUIUtility.TrTextContent("Mode", "Controls which version of the effect should be used.")); - EditorGUI.indentLevel++; - switch (m_Mode.value.GetEnumValue()) - { - case RayTracingMode.Performance: - { - PropertyField(m_UpscaleRadius, EditorGUIUtility.TrTextContent("Upscale Radius", "Controls the size of the upscale radius.")); - PropertyField(m_FullResolution, EditorGUIUtility.TrTextContent("Full Resolution", "Enables full resolution mode.")); - } - break; - case RayTracingMode.Quality: - { - PropertyField(m_SampleCount, EditorGUIUtility.TrTextContent("Sample Count", "Number of samples for reflections.")); - PropertyField(m_BounceCount, EditorGUIUtility.TrTextContent("Bounce Count", "Number of bounces for reflection rays.")); - } - break; - } - EditorGUI.indentLevel--; - } - else if (currentAsset.currentPlatformRenderPipelineSettings.supportedRayTracingMode == RenderPipelineSettings.SupportedRayTracingMode.Quality) - { - PropertyField(m_SampleCount, EditorGUIUtility.TrTextContent("Sample Count", "Number of samples for reflections.")); - PropertyField(m_BounceCount, EditorGUIUtility.TrTextContent("Bounce Count", "Number of bounces for reflection rays.")); - } - else - { - PropertyField(m_UpscaleRadius, EditorGUIUtility.TrTextContent("Upscale Radius", "Controls the size of the upscale radius.")); - PropertyField(m_FullResolution, EditorGUIUtility.TrTextContent("Full Resolution", "Enables full resolution mode.")); - } - - PropertyField(m_Denoise, EditorGUIUtility.TrTextContent("Denoise", "Enable denoising on the ray traced reflections.")); - { - EditorGUI.indentLevel++; - PropertyField(m_DenoiserRadius, EditorGUIUtility.TrTextContent("Denoiser Radius", "Controls the radius of reflection denoiser.")); - EditorGUI.indentLevel--; - } + RayTracedReflectionGUI(); } else { - PropertyField(m_ScreenFadeDistance, EditorGUIUtility.TrTextContent("Screen Edge Fade Distance", "Controls the distance at which HDRP fades out SSR near the edge of the screen.")); - PropertyField(m_DepthBufferThickness, EditorGUIUtility.TrTextContent("Object Thickness", "Controls the typical thickness of objects the reflection rays may pass behind.")); + // Shared Data + PropertyField(m_MinSmoothness, k_MinimumSmoothnessText); + PropertyField(m_SmoothnessFadeStart, k_SmoothnessFadeStartText); + PropertyField(m_ReflectSky, k_ReflectSkyText); + m_SmoothnessFadeStart.value.floatValue = Mathf.Max(m_MinSmoothness.value.floatValue, m_SmoothnessFadeStart.value.floatValue); + PropertyField(m_ScreenFadeDistance, k_ScreenFaceDistanceText); + PropertyField(m_DepthBufferThickness, k_DepthBufferThicknessText); m_DepthBufferThickness.value.floatValue = Mathf.Clamp(m_DepthBufferThickness.value.floatValue, 0.001f, 1.0f); base.OnInspectorGUI(); GUI.enabled = useCustomValue; - PropertyField(m_RayMaxIterations, EditorGUIUtility.TrTextContent("Max Ray Steps", "Sets the maximum number of steps HDRP uses for raytracing. Affects both correctness and performance.")); + PropertyField(m_RayMaxIterations, k_RayMaxIterationsText); m_RayMaxIterations.value.intValue = Mathf.Max(0, m_RayMaxIterations.value.intValue); GUI.enabled = true; } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/GlobalIllumination.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/GlobalIllumination.cs index 499cfe3f48e..eba7d983fef 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/GlobalIllumination.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/GlobalIllumination.cs @@ -9,6 +9,11 @@ namespace UnityEngine.Rendering.HighDefinition [Serializable, VolumeComponentMenu("Lighting/Screen Space Global Illumination (Preview)")] public sealed class GlobalIllumination : VolumeComponentWithQuality { + bool UsesQualityMode() + { + return mode.overrideState && mode == RayTracingMode.Quality; + } + /// /// Enable screen space global illumination. /// @@ -133,7 +138,7 @@ public float rayLength { get { - if (!UsesQualitySettings() || mode == RayTracingMode.Quality) + if (!UsesQualitySettings() || UsesQualityMode()) return m_RayLength.value; else return GetLightingQualitySettings().RTGIRayLength[(int)quality.value]; @@ -148,7 +153,7 @@ public float clampValue { get { - if (!UsesQualitySettings() || mode == RayTracingMode.Quality) + if (!UsesQualitySettings() || UsesQualityMode()) return m_ClampValue.value; else return GetLightingQualitySettings().RTGIClampValue[(int)quality.value]; @@ -214,7 +219,7 @@ public bool denoise { get { - if (!UsesQualitySettings() || mode == RayTracingMode.Quality) + if (!UsesQualitySettings() || UsesQualityMode()) return m_Denoise.value; else return GetLightingQualitySettings().RTGIDenoise[(int)quality.value]; @@ -229,7 +234,7 @@ public bool halfResolutionDenoiser { get { - if (!UsesQualitySettings() || mode == RayTracingMode.Quality) + if (!UsesQualitySettings() || UsesQualityMode()) return m_HalfResolutionDenoiser.value; else return GetLightingQualitySettings().RTGIHalfResDenoise[(int)quality.value]; @@ -244,7 +249,7 @@ public float denoiserRadius { get { - if (!UsesQualitySettings() || mode == RayTracingMode.Quality) + if (!UsesQualitySettings() || UsesQualityMode()) return m_DenoiserRadius.value; else return GetLightingQualitySettings().RTGIDenoiserRadius[(int)quality.value]; @@ -259,7 +264,7 @@ public bool secondDenoiserPass { get { - if (!UsesQualitySettings() || mode == RayTracingMode.Quality) + if (!UsesQualitySettings() || UsesQualityMode()) return m_SecondDenoiserPass.value; else return GetLightingQualitySettings().RTGISecondDenoise[(int)quality.value]; @@ -274,7 +279,7 @@ public float secondDenoiserRadius { get { - if (!UsesQualitySettings() || mode == RayTracingMode.Quality) + if (!UsesQualitySettings() || UsesQualityMode()) return m_SecondDenoiserRadius.value; else return GetLightingQualitySettings().RTGISecondDenoiserRadius[(int)quality.value]; @@ -285,7 +290,7 @@ public float secondDenoiserRadius // RTGI [SerializeField, FormerlySerializedAs("rayLength")] [Tooltip("Controls the length of GI rays.")] - public ClampedFloatParameter m_RayLength = new ClampedFloatParameter(50.0f, 0f, 50f); + private ClampedFloatParameter m_RayLength = new ClampedFloatParameter(50.0f, 0f, 50f); [SerializeField, FormerlySerializedAs("clampValue")] [Tooltip("Controls the clamp of intensity.")] @@ -293,30 +298,30 @@ public float secondDenoiserRadius [SerializeField, FormerlySerializedAs("fullResolution")] [Tooltip("Full Resolution")] - public BoolParameter m_FullResolution = new BoolParameter(false); + private BoolParameter m_FullResolution = new BoolParameter(false); [SerializeField, FormerlySerializedAs("upscaleRadius")] [Tooltip("Upscale Radius")] - public ClampedIntParameter m_UpscaleRadius = new ClampedIntParameter(2, 2, 4); + private ClampedIntParameter m_UpscaleRadius = new ClampedIntParameter(2, 2, 4); [SerializeField, FormerlySerializedAs("denoise")] [Tooltip("Denoise the ray-traced GI.")] - public BoolParameter m_Denoise = new BoolParameter(true); + private BoolParameter m_Denoise = new BoolParameter(true); [SerializeField, FormerlySerializedAs("halfResolutionDenoiser")] [Tooltip("Use a half resolution denoiser.")] - public BoolParameter m_HalfResolutionDenoiser = new BoolParameter(false); + private BoolParameter m_HalfResolutionDenoiser = new BoolParameter(false); [SerializeField, FormerlySerializedAs("denoiserRadius")] [Tooltip("Controls the radius of the GI denoiser (First Pass).")] - public ClampedFloatParameter m_DenoiserRadius = new ClampedFloatParameter(0.6f, 0.001f, 1.0f); + private ClampedFloatParameter m_DenoiserRadius = new ClampedFloatParameter(0.6f, 0.001f, 1.0f); [SerializeField, FormerlySerializedAs("secondDenoiserPass")] [Tooltip("Enable second denoising pass.")] - public BoolParameter m_SecondDenoiserPass = new BoolParameter(true); + private BoolParameter m_SecondDenoiserPass = new BoolParameter(true); [SerializeField, FormerlySerializedAs("secondDenoiserRadius")] [Tooltip("Controls the radius of the GI denoiser (Second Pass).")] - public ClampedFloatParameter m_SecondDenoiserRadius = new ClampedFloatParameter(0.3f, 0.001f, 0.5f); + private ClampedFloatParameter m_SecondDenoiserRadius = new ClampedFloatParameter(0.3f, 0.001f, 0.5f); } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceReflection.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceReflection.cs index aba548f1aa1..181f57109c7 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceReflection.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/ScreenSpaceLighting/ScreenSpaceReflection.cs @@ -9,6 +9,17 @@ namespace UnityEngine.Rendering.HighDefinition [Serializable, VolumeComponentMenu("Lighting/Screen Space Reflection")] public class ScreenSpaceReflection : VolumeComponentWithQuality { + bool UsesRayTracingQualityMode() + { + return mode.overrideState && mode == RayTracingMode.Quality; + } + + bool UsesRayTracing() + { + var hdAsset = HDRenderPipeline.currentAsset; + return hdAsset != null && hdAsset.currentPlatformRenderPipelineSettings.supportRayTracing && rayTracing.overrideState && rayTracing.value; + } + /// Enable Screen Space Reflections. [Tooltip("Enable Screen Space Reflections.")] public BoolParameter enabled = new BoolParameter(true); @@ -22,12 +33,32 @@ public class ScreenSpaceReflection : VolumeComponentWithQuality /// /// Controls the smoothness value at which HDRP activates SSR and the smoothness-controlled fade out stops. /// - public ClampedFloatParameter minSmoothness = new ClampedFloatParameter(0.9f, 0.0f, 1.0f); + public float minSmoothness + { + get + { + if ((UsesRayTracing() && (UsesRayTracingQualityMode() || !UsesQualitySettings())) || !UsesRayTracing()) + return m_MinSmoothness.value; + else + return GetLightingQualitySettings().RTRMinSmoothness[(int)quality.value]; + } + set { m_MinSmoothness.value = value; } + } /// /// Controls the smoothness value at which the smoothness-controlled fade out starts. The fade is in the range [Min Smoothness, Smoothness Fade Start] /// - public ClampedFloatParameter smoothnessFadeStart = new ClampedFloatParameter(0.9f, 0.0f, 1.0f); + public float smoothnessFadeStart + { + get + { + if ((UsesRayTracing() && (UsesRayTracingQualityMode() || !UsesQualitySettings())) || !UsesRayTracing()) + return m_SmoothnessFadeStart.value; + else + return GetLightingQualitySettings().RTRSmoothnessFadeStart[(int)quality.value]; + } + set { m_SmoothnessFadeStart.value = value; } + } /// /// When enabled, SSR handles sky reflection. @@ -53,23 +84,62 @@ public class ScreenSpaceReflection : VolumeComponentWithQuality /// /// Controls the length of reflection rays. /// - public ClampedFloatParameter rayLength = new ClampedFloatParameter(10f, 0.001f, 50f); + public float rayLength + { + get + { + if (!UsesQualitySettings() || UsesRayTracingQualityMode()) + return m_RayLength.value; + else + return GetLightingQualitySettings().RTRRayLength[(int)quality.value]; + } + set { m_RayLength.value = value; } + } /// /// Clamps the exposed intensity. /// - public ClampedFloatParameter clampValue = new ClampedFloatParameter(1.0f, 0.001f, 10.0f); + public float clampValue + { + get + { + if (!UsesQualitySettings() || UsesRayTracingQualityMode()) + return m_ClampValue.value; + else + return GetLightingQualitySettings().RTRClampValue[(int)quality.value]; + } + set { m_ClampValue.value = value; } + } /// /// Enable denoising on the ray traced reflections. /// - public BoolParameter denoise = new BoolParameter(false); + public bool denoise + { + get + { + if (!UsesQualitySettings() || UsesRayTracingQualityMode()) + return m_Denoise.value; + else + return GetLightingQualitySettings().RTRDenoise[(int)quality.value]; + } + set { m_Denoise.value = value; } + } /// /// Controls the radius of reflection denoiser. /// - public ClampedIntParameter denoiserRadius = new ClampedIntParameter(8, 1, 32); - + public int denoiserRadius + { + get + { + if (!UsesQualitySettings() || UsesRayTracingQualityMode()) + return m_DenoiserRadius.value; + else + return GetLightingQualitySettings().RTRDenoiserRadius[(int)quality.value]; + } + set { m_DenoiserRadius.value = value; } + } /// /// Controls which version of the effect should be used. /// @@ -79,11 +149,33 @@ public class ScreenSpaceReflection : VolumeComponentWithQuality /// /// Controls the size of the upscale radius. /// - public IntParameter upscaleRadius = new ClampedIntParameter(2, 2, 6); + public int upscaleRadius + { + get + { + if (!UsesQualitySettings()) + return m_UpscaleRadius.value; + else + return GetLightingQualitySettings().RTRUpScaleRadius[(int)quality.value]; + } + set { m_UpscaleRadius.value = value; } + } + /// - /// Enables full resolution mode. + /// Defines if the effect should be evaluated at full resolution. /// - public BoolParameter fullResolution = new BoolParameter(false); + public bool fullResolution + { + get + { + if (!UsesQualitySettings()) + return m_FullResolution.value; + else + return GetLightingQualitySettings().RTRFullResolution[(int)quality.value]; + } + set { m_FullResolution.value = value; } + } + // Quality /// @@ -110,7 +202,37 @@ public int rayMaxIterations set { m_RayMaxIterations.value = value; } } + [SerializeField, FormerlySerializedAs("minSmoothness")] + private ClampedFloatParameter m_MinSmoothness = new ClampedFloatParameter(0.9f, 0.0f, 1.0f); + + [SerializeField, FormerlySerializedAs("smoothnessFadeStart")] + private ClampedFloatParameter m_SmoothnessFadeStart = new ClampedFloatParameter(0.9f, 0.0f, 1.0f); + [SerializeField, FormerlySerializedAs("rayMaxIterations")] private IntParameter m_RayMaxIterations = new IntParameter(32); + + [SerializeField, FormerlySerializedAs("rayLength")] + [Tooltip("Controls the length of reflection rays.")] + private ClampedFloatParameter m_RayLength = new ClampedFloatParameter(50.0f, 0f, 50f); + + [SerializeField, FormerlySerializedAs("clampValue")] + [Tooltip("Controls the clamp of intensity.")] + private ClampedFloatParameter m_ClampValue = new ClampedFloatParameter(1.0f, 0.001f, 10.0f); + + [SerializeField, FormerlySerializedAs("upscaleRadius")] + [Tooltip("Upscale Radius")] + private ClampedIntParameter m_UpscaleRadius = new ClampedIntParameter(2, 2, 6); + + [SerializeField, FormerlySerializedAs("fullResolution")] + [Tooltip("Full Resolution")] + private BoolParameter m_FullResolution = new BoolParameter(false); + + [SerializeField, FormerlySerializedAs("denoise")] + [Tooltip("Denoise the ray-traced reflection.")] + private BoolParameter m_Denoise = new BoolParameter(true); + + [SerializeField, FormerlySerializedAs("denoiserRadius")] + [Tooltip("Controls the radius of the ray traced reflection denoiser.")] + private ClampedIntParameter m_DenoiserRadius = new ClampedIntParameter(8, 1, 32); } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/GlobalLightingQualitySettings.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/GlobalLightingQualitySettings.cs index 76d529d58d2..53d57e53904 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/GlobalLightingQualitySettings.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/GlobalLightingQualitySettings.cs @@ -48,10 +48,6 @@ internal GlobalLightingQualitySettings() SSGIRaySteps[(int)ScalableSettingLevelParameter.Level.Medium] = 32; SSGIRaySteps[(int)ScalableSettingLevelParameter.Level.High] = 64; - SSGIResolution[(int)ScalableSettingLevelParameter.Level.Low] = false; - SSGIResolution[(int)ScalableSettingLevelParameter.Level.Medium] = true; - SSGIResolution[(int)ScalableSettingLevelParameter.Level.High] = true; - SSGIRadius[(int)ScalableSettingLevelParameter.Level.Low] = 1.5f; SSGIRadius[(int)ScalableSettingLevelParameter.Level.Medium] = 5.0f; SSGIRadius[(int)ScalableSettingLevelParameter.Level.High] = 20.0f; @@ -121,6 +117,39 @@ internal GlobalLightingQualitySettings() RTGISecondDenoiserRadius[(int)ScalableSettingLevelParameter.Level.Low] = 0.33f; RTGISecondDenoiserRadius[(int)ScalableSettingLevelParameter.Level.Medium] = 0.33f; RTGISecondDenoiserRadius[(int)ScalableSettingLevelParameter.Level.High] = 0.5f; + + // RTR + RTRMinSmoothness[(int)ScalableSettingLevelParameter.Level.Low] = 0.6f; + RTRMinSmoothness[(int)ScalableSettingLevelParameter.Level.Medium] = 0.4f; + RTRMinSmoothness[(int)ScalableSettingLevelParameter.Level.High] = 0.0f; + + RTRSmoothnessFadeStart[(int)ScalableSettingLevelParameter.Level.Low] = 0.7f; + RTRSmoothnessFadeStart[(int)ScalableSettingLevelParameter.Level.Medium] = 0.5f; + RTRSmoothnessFadeStart[(int)ScalableSettingLevelParameter.Level.High] = 0.0f; + + RTRRayLength[(int)ScalableSettingLevelParameter.Level.Low] = 50.0f; + RTRRayLength[(int)ScalableSettingLevelParameter.Level.Medium] = 50.0f; + RTRRayLength[(int)ScalableSettingLevelParameter.Level.High] = 50.0f; + + RTRClampValue[(int)ScalableSettingLevelParameter.Level.Low] = 0.8f; + RTRClampValue[(int)ScalableSettingLevelParameter.Level.Medium] = 1.0f; + RTRClampValue[(int)ScalableSettingLevelParameter.Level.High] = 1.2f; + + RTRUpScaleRadius[(int)ScalableSettingLevelParameter.Level.Low] = 4; + RTRUpScaleRadius[(int)ScalableSettingLevelParameter.Level.Medium] = 4; + RTRUpScaleRadius[(int)ScalableSettingLevelParameter.Level.High] = 3; + + RTRFullResolution[(int)ScalableSettingLevelParameter.Level.Low] = false; + RTRFullResolution[(int)ScalableSettingLevelParameter.Level.Medium] = false; + RTRFullResolution[(int)ScalableSettingLevelParameter.Level.High] = true; + + RTRDenoise[(int)ScalableSettingLevelParameter.Level.Low] = true; + RTRDenoise[(int)ScalableSettingLevelParameter.Level.Medium] = true; + RTRDenoise[(int)ScalableSettingLevelParameter.Level.High] = true; + + RTRDenoiserRadius[(int)ScalableSettingLevelParameter.Level.Low] = 8; + RTRDenoiserRadius[(int)ScalableSettingLevelParameter.Level.Medium] = 12; + RTRDenoiserRadius[(int)ScalableSettingLevelParameter.Level.High] = 16; } internal static GlobalLightingQualitySettings NewDefault() => new GlobalLightingQualitySettings(); @@ -147,16 +176,19 @@ internal GlobalLightingQualitySettings() // Screen Space Global Illumination [System.NonSerialized] + /// Screen space global illumination step count for the ray marching. public int[] SSGIRaySteps = new int[s_QualitySettingCount]; [System.NonSerialized] - public bool[] SSGIResolution = new bool[s_QualitySettingCount]; - [System.NonSerialized] + /// Screen space global illumination's world space maximal radius. public float[] SSGIRadius = new float[s_QualitySettingCount]; [System.NonSerialized] + /// Screen space global illumination flag to define if the effect is computed at full resolution. public bool[] SSGIFullResolution = new bool[s_QualitySettingCount]; [System.NonSerialized] + /// Screen space global illumination signal clamping value. public float[] SSGIClampValue = new float[s_QualitySettingCount]; [System.NonSerialized] + /// Screen space global illumination's filter size. public int[] SSGIFilterRadius = new int[s_QualitySettingCount]; // Ray Traced Ambient Occlusion @@ -189,6 +221,24 @@ internal GlobalLightingQualitySettings() /// Flag that defines the radius of the second denoiser. public float[] RTGISecondDenoiserRadius = new float[s_QualitySettingCount]; + // Ray Traced Reflections + /// Controls the minimal smoothness. + public float[] RTRMinSmoothness = new float[s_QualitySettingCount]; + /// Controls the minimal smoothness. + public float[] RTRSmoothnessFadeStart = new float[s_QualitySettingCount]; + /// Controls the length of ray traced reflection rays. + public float[] RTRRayLength = new float[s_QualitySettingCount]; + /// Clamp value used to reduce the variance in the integration signal. + public float[] RTRClampValue = new float[s_QualitySettingCount]; + /// Radius for the up-sample pass. + public int[] RTRUpScaleRadius = new int[s_QualitySettingCount]; + /// Controls if the effect should be computed at full resolution. + public bool[] RTRFullResolution = new bool[s_QualitySettingCount]; + /// Flag that enables the first denoising pass. + public bool[] RTRDenoise = new bool[s_QualitySettingCount]; + /// Flag that defines the radius of the first denoiser. + public int[] RTRDenoiserRadius = new int[s_QualitySettingCount]; + // TODO: Volumetric fog quality // TODO: Shadows. This needs to be discussed further as there is an idiosyncracy here as we have different level of quality settings, 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 37e438fbe9b..5e511adc466 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.cs @@ -1309,8 +1309,8 @@ void UpdateShaderVariablesRaytracingCB(HDCamera hdCamera, CommandBuffer cmd) m_ShaderVariablesRayTracingCB._RayCountEnabled = m_RayCountManager.RayCountIsEnabled(); m_ShaderVariablesRayTracingCB._RaytracingCameraNearPlane = hdCamera.camera.nearClipPlane; m_ShaderVariablesRayTracingCB._RaytracingPixelSpreadAngle = GetPixelSpreadAngle(hdCamera.camera.fieldOfView, hdCamera.actualWidth, hdCamera.actualHeight); - m_ShaderVariablesRayTracingCB._RaytracingReflectionMinSmoothness = screenSpaceReflection.minSmoothness.value; - m_ShaderVariablesRayTracingCB._RaytracingReflectionSmoothnessFadeStart = screenSpaceReflection.smoothnessFadeStart.value; + m_ShaderVariablesRayTracingCB._RaytracingReflectionMinSmoothness = screenSpaceReflection.minSmoothness; + m_ShaderVariablesRayTracingCB._RaytracingReflectionSmoothnessFadeStart = screenSpaceReflection.smoothnessFadeStart; ConstantBuffer.PushGlobal(cmd, m_ShaderVariablesRayTracingCB, HDShaderIDs._ShaderVariablesRaytracing); } @@ -4359,8 +4359,8 @@ RenderSSRParameters PrepareSSRParameters(HDCamera hdCamera, in HDUtils.PackedMip cb._SsrIterLimit = volumeSettings.rayMaxIterations; cb._SsrReflectsSky = volumeSettings.reflectSky.value ? 1 : 0; cb._SsrStencilBit = (int)StencilUsage.TraceReflectionRay; - float roughnessFadeStart = 1 - volumeSettings.smoothnessFadeStart.value; - cb._SsrRoughnessFadeEnd = 1 - volumeSettings.minSmoothness.value; + float roughnessFadeStart = 1 - volumeSettings.smoothnessFadeStart; + cb._SsrRoughnessFadeEnd = 1 - volumeSettings.minSmoothness; float roughnessFadeLength = cb._SsrRoughnessFadeEnd - roughnessFadeStart; cb._SsrRoughnessFadeEndTimesRcpLength = (roughnessFadeLength != 0) ? (cb._SsrRoughnessFadeEnd * (1.0f / roughnessFadeLength)) : 1; cb._SsrRoughnessFadeRcpLength = (roughnessFadeLength != 0) ? (1.0f / roughnessFadeLength) : 0; diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingReflection.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingReflection.cs index f8dd305551a..2a775e8dbe2 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingReflection.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingReflection.cs @@ -80,10 +80,10 @@ void BindRayTracedReflectionData(CommandBuffer cmd, HDCamera hdCamera, RayTracin cmd.SetRayTracingAccelerationStructure(reflectionShader, HDShaderIDs._RaytracingAccelerationStructureName, accelerationStructure); // Global reflection parameters - m_ShaderVariablesRayTracingCB._RaytracingIntensityClamp = settings.clampValue.value; + m_ShaderVariablesRayTracingCB._RaytracingIntensityClamp = settings.clampValue; m_ShaderVariablesRayTracingCB._RaytracingIncludeSky = settings.reflectSky.value ? 1 : 0; // Inject the ray generation data - m_ShaderVariablesRayTracingCB._RaytracingRayMaxLength = settings.rayLength.value; + m_ShaderVariablesRayTracingCB._RaytracingRayMaxLength = settings.rayLength; m_ShaderVariablesRayTracingCB._RaytracingNumSamples = settings.sampleCount.value; // Set the number of bounces for reflections m_ShaderVariablesRayTracingCB._RaytracingMaxRecursion = settings.bounceCount.value; @@ -133,7 +133,7 @@ DeferredLightingRTParameters PrepareReflectionDeferredLightingRTParameters(HDCam deferredParameters.rayBinning = true; deferredParameters.layerMask.value = (int)RayTracingRendererFlag.Reflection; deferredParameters.diffuseLightingOnly = false; - deferredParameters.halfResolution = !settings.fullResolution.value; + deferredParameters.halfResolution = !settings.fullResolution; deferredParameters.rayCountType = (int)RayCountValues.ReflectionDeferred; // Camera data @@ -159,8 +159,8 @@ DeferredLightingRTParameters PrepareReflectionDeferredLightingRTParameters(HDCam } deferredParameters.globalCB = m_ShaderVariablesRayTracingCB; - deferredParameters.globalCB._RaytracingRayMaxLength = settings.rayLength.value; - deferredParameters.globalCB._RaytracingIntensityClamp = settings.clampValue.value; + deferredParameters.globalCB._RaytracingRayMaxLength = settings.rayLength; + deferredParameters.globalCB._RaytracingIntensityClamp = settings.clampValue; deferredParameters.globalCB._RaytracingIncludeSky = settings.reflectSky.value ? 1 : 0; deferredParameters.globalCB._RaytracingPreExposition = 0; deferredParameters.globalCB._RaytracingDiffuseRay = 0; @@ -198,7 +198,7 @@ void RenderReflectionsPerformance(HDCamera hdCamera, CommandBuffer cmd, RTHandle using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.RaytracingIntegrateReflection))) { // Fetch the new sample kernel - if (settings.fullResolution.value) + if (settings.fullResolution) { currentKernel = transparent ? m_RaytracingReflectionsTransparentFullResKernel : m_RaytracingReflectionsFullResKernel; } @@ -219,14 +219,14 @@ void RenderReflectionsPerformance(HDCamera hdCamera, CommandBuffer cmd, RTHandle cmd.SetComputeTextureParam(reflectionShaderCS, currentKernel, HDShaderIDs._StencilTexture, m_SharedRTManager.GetDepthStencilBuffer(), 0, RenderTextureSubElement.Stencil); // Bind all the required scalars - m_ShaderVariablesRayTracingCB._RaytracingIntensityClamp = settings.clampValue.value; + m_ShaderVariablesRayTracingCB._RaytracingIntensityClamp = settings.clampValue; m_ShaderVariablesRayTracingCB._RaytracingIncludeSky = settings.reflectSky.value ? 1 : 0; ConstantBuffer.PushGlobal(cmd, m_ShaderVariablesRayTracingCB, HDShaderIDs._ShaderVariablesRaytracing); // Bind the output buffers cmd.SetComputeTextureParam(reflectionShaderCS, currentKernel, HDShaderIDs._RaytracingDirectionBuffer, intermediateBuffer1); - if (settings.fullResolution.value) + if (settings.fullResolution) { // Evaluate the dispatch parameters numTilesXHR = (texWidth + (areaTileSize - 1)) / areaTileSize; @@ -250,7 +250,7 @@ void RenderReflectionsPerformance(HDCamera hdCamera, CommandBuffer cmd, RTHandle RenderRaytracingDeferredLighting(cmd, deferredParamters, deferredResources); // Fetch the right filter to use - if (settings.fullResolution.value) + if (settings.fullResolution) { currentKernel = reflectionFilter.FindKernel("ReflectionIntegrationUpscaleFullRes"); } @@ -267,8 +267,8 @@ void RenderReflectionsPerformance(HDCamera hdCamera, CommandBuffer cmd, RTHandle cmd.SetComputeTextureParam(reflectionFilter, currentKernel, HDShaderIDs._BlueNoiseTexture, blueNoise.textureArray16RGB); cmd.SetComputeTextureParam(reflectionFilter, currentKernel, "_RaytracingReflectionTexture", outputTexture); cmd.SetComputeTextureParam(reflectionFilter, currentKernel, HDShaderIDs._ScramblingTexture, m_Asset.renderPipelineResources.textures.scramblingTex); - cmd.SetComputeIntParam(reflectionFilter, HDShaderIDs._SpatialFilterRadius, settings.upscaleRadius.value); - cmd.SetComputeIntParam(reflectionFilter, HDShaderIDs._RaytracingDenoiseRadius, settings.denoise.value ? settings.denoiserRadius.value : 0); + cmd.SetComputeIntParam(reflectionFilter, HDShaderIDs._SpatialFilterRadius, settings.upscaleRadius); + cmd.SetComputeIntParam(reflectionFilter, HDShaderIDs._RaytracingDenoiseRadius, settings.denoise ? settings.denoiserRadius : 0); numTilesXHR = (texWidth + (areaTileSize - 1)) / areaTileSize; numTilesYHR = (texHeight + (areaTileSize - 1)) / areaTileSize; @@ -283,7 +283,7 @@ void RenderReflectionsPerformance(HDCamera hdCamera, CommandBuffer cmd, RTHandle using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.RaytracingFilterReflection))) { - if (settings.denoise.value && !transparent) + if (settings.denoise && !transparent) { // Grab the history buffer RTHandle reflectionHistory = hdCamera.GetCurrentFrameRT((int)HDCameraFrameHistoryType.RaytracedReflection) @@ -299,7 +299,7 @@ void RenderReflectionsPerformance(HDCamera hdCamera, CommandBuffer cmd, RTHandle historyValidity *= ValidRayTracingHistory(hdCamera) ? 1.0f : 0.0f; HDReflectionDenoiser reflectionDenoiser = GetReflectionDenoiser(); - reflectionDenoiser.DenoiseBuffer(cmd, hdCamera, settings.denoiserRadius.value, outputTexture, reflectionHistory, intermediateBuffer0, historyValidity: historyValidity); + reflectionDenoiser.DenoiseBuffer(cmd, hdCamera, settings.denoiserRadius, outputTexture, reflectionHistory, intermediateBuffer0, historyValidity: historyValidity); HDUtils.BlitCameraTexture(cmd, intermediateBuffer0, outputTexture); } } @@ -339,7 +339,7 @@ void RenderReflectionsQuality(HDCamera hdCamera, CommandBuffer cmd, RTHandle out using (new ProfilingScope(cmd, ProfilingSampler.Get(HDProfileId.RaytracingFilterReflection))) { - if (settings.denoise.value && !transparent) + if (settings.denoise && !transparent) { // Grab the history buffer RTHandle reflectionHistory = hdCamera.GetCurrentFrameRT((int)HDCameraFrameHistoryType.RaytracedReflection) @@ -355,7 +355,7 @@ void RenderReflectionsQuality(HDCamera hdCamera, CommandBuffer cmd, RTHandle out historyValidity *= ValidRayTracingHistory(hdCamera) ? 1.0f : 0.0f; HDReflectionDenoiser reflectionDenoiser = GetReflectionDenoiser(); - reflectionDenoiser.DenoiseBuffer(cmd, hdCamera, settings.denoiserRadius.value, intermediateBuffer0, reflectionHistory, outputTexture, historyValidity: historyValidity); + reflectionDenoiser.DenoiseBuffer(cmd, hdCamera, settings.denoiserRadius, intermediateBuffer0, reflectionHistory, outputTexture, historyValidity: historyValidity); } else { diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/Denoising/ReflectionDenoiser.compute b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/Denoising/ReflectionDenoiser.compute index 2be98977c86..ca6004140da 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/Denoising/ReflectionDenoiser.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/Denoising/ReflectionDenoiser.compute @@ -16,11 +16,11 @@ #include "Packages/com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/TemporalAntialiasing.hlsl" #define BILATERAL_ROUGHNESS #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/Denoising/BilateralFilter.hlsl" - +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/ShaderVariablesRaytracing.cs.hlsl" // Tile size of this compute #define REFLECTION_FILTER_TILE_SIZE 8 -//#pragma enable_d3d11_debug_symbols +// #pragma enable_d3d11_debug_symbols // Thereshold at which we decide to reject the reflection history #define REFLECTION_HISTORY_REJECTION_THRESHOLD 0.75 @@ -122,7 +122,6 @@ void CopyHistory(uint3 dispatchThreadId : SV_DispatchThreadID) } int _DenoiserFilterRadius; -float _RaytracingReflectionMinSmoothness; TEXTURE2D(_ReflectionFilterMapping); // Separated bilateral filter (two passes, each with 2*Radius taps) @@ -160,7 +159,7 @@ void BILATERAL_FILTER(uint3 dispatchThreadId : SV_DispatchThreadID, uint2 groupT float3 finalColor = LOAD_TEXTURE2D_X(_DenoiseInputTexture, centerCoord).xyz; // If this pixels does not have ray traced reflections anyway, just skip it. - if (_RaytracingReflectionMinSmoothness < PerceptualRoughnessToPerceptualSmoothness(center.roughness)) + if (_RaytracingReflectionMinSmoothness <= PerceptualRoughnessToPerceptualSmoothness(center.roughness)) { // Initialize variables for accumulation float3 colorSum = float3(0.0, 0.0, 0.0); diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/RaytracingReflectionFilter.compute b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/RaytracingReflectionFilter.compute index ee10a7fe067..a648a539ce1 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/RaytracingReflectionFilter.compute +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/Shaders/RaytracingReflectionFilter.compute @@ -47,9 +47,6 @@ void REFLECTION_INTEGRATION_UPSCALE(uint3 dispatchThreadId : SV_DispatchThreadID uint2 sourceCoord = targetCoord; #endif - // Compute the index of the noise texture to use - int noiseIndex = (int)(clamp((int)(_ScramblingTexture[sourceCoord].y * 32.0f), 0, 31)); - // Compute the subpixel index that matches this full screen pixel. int localIndex = (targetCoord.x & 1) + (targetCoord.y & 1) * 2; @@ -89,11 +86,13 @@ void REFLECTION_INTEGRATION_UPSCALE(uint3 dispatchThreadId : SV_DispatchThreadID float4 resultSum = float4(0.0 ,0.0, 0.0, 0.0); uint sampleCount = 0; - float radiusSq = _SpatialFilterRadius * _SpatialFilterRadius; + // We want to avoid overblur for smoothsurfaces, so the upscale radius is lerped between the minimal value and the maximal value + const int upscaleRadius = lerp(2, _SpatialFilterRadius, normalData.perceptualRoughness); + const float radiusSq = upscaleRadius * upscaleRadius; - for(int y = -_SpatialFilterRadius; y < _SpatialFilterRadius; ++y) + for(int y = -upscaleRadius; y < upscaleRadius; ++y) { - for(int x = -_SpatialFilterRadius; x < _SpatialFilterRadius; ++x) + for(int x = -upscaleRadius; x < upscaleRadius; ++x) { float radiusDistanceSq = (y*y + x*x); if(radiusDistanceSq > radiusSq) continue; @@ -131,7 +130,7 @@ void REFLECTION_INTEGRATION_UPSCALE(uint3 dispatchThreadId : SV_DispatchThreadID if(sampleDepth == 0.0f) continue; // Compute the target pixel that it will impact - float sample = _BlueNoiseTexture[int3(relativeHRShift, noiseIndex)].x; + float sample = _BlueNoiseTexture[int3(relativeHRShift, 0)].x; int index = clamp(floor(sample * 4.0f), 0, 3); if (index != localIndex) continue;