diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index 9badf14..459ac4a 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -319,6 +319,7 @@ MonoBehaviour: qualityMode: 2 performSharpenPass: 1 sharpness: 0.8 + enableHDR: 0 enableFP16: 0 enableAutoExposure: 1 preExposure: 1 @@ -331,6 +332,7 @@ MonoBehaviour: cutoffThreshold: 0.2 binaryValue: 0.9 flags: 13 + outputMotionVectors: {fileID: 0} --- !u!114 &963194230 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/SampleScenePPV2Post.unity b/Assets/Scenes/SampleScenePPV2Post.unity index 25cc259..20ab8d8 100644 --- a/Assets/Scenes/SampleScenePPV2Post.unity +++ b/Assets/Scenes/SampleScenePPV2Post.unity @@ -322,6 +322,7 @@ MonoBehaviour: qualityMode: 3 performSharpenPass: 1 sharpness: 0.8 + enableHDR: 0 enableFP16: 0 enableAutoExposure: 1 preExposure: 1 @@ -334,6 +335,7 @@ MonoBehaviour: cutoffThreshold: 0.2 binaryValue: 0.9 flags: 13 + outputMotionVectors: {fileID: 0} --- !u!114 &963194230 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/SampleSceneTwoCamera.unity b/Assets/Scenes/SampleSceneTwoCamera.unity index 868bb30..db32d91 100644 --- a/Assets/Scenes/SampleSceneTwoCamera.unity +++ b/Assets/Scenes/SampleSceneTwoCamera.unity @@ -491,6 +491,7 @@ MonoBehaviour: qualityMode: 3 performSharpenPass: 1 sharpness: 0.8 + enableHDR: 0 enableFP16: 0 enableAutoExposure: 1 preExposure: 1 diff --git a/Assets/Scripts/Fsr2ImageEffect.cs b/Assets/Scripts/Fsr2ImageEffect.cs index 86c9369..927e139 100644 --- a/Assets/Scripts/Fsr2ImageEffect.cs +++ b/Assets/Scripts/Fsr2ImageEffect.cs @@ -44,6 +44,8 @@ namespace FidelityFX [Tooltip("Strength of the sharpening effect.")] [Range(0, 1)] public float sharpness = 0.8f; + [Tooltip("Enable this if you're passing a pre-tonemapping HDR image to the upscaler.")] + public bool enableHDR = false; [Tooltip("Allow the use of half precision compute operations, potentially improving performance if the platform supports it.")] public bool enableFP16 = false; @@ -132,7 +134,7 @@ namespace FidelityFX // Initialize FSR2 context Fsr2.InitializationFlags flags = 0; - if (_renderCamera.allowHDR) flags |= Fsr2.InitializationFlags.EnableHighDynamicRange; + if (enableHDR) flags |= Fsr2.InitializationFlags.EnableHighDynamicRange; if (enableFP16) flags |= Fsr2.InitializationFlags.EnableFP16Usage; if (enableAutoExposure) flags |= Fsr2.InitializationFlags.EnableAutoExposure; @@ -352,7 +354,7 @@ namespace FidelityFX RenderTexture.active = dest; } - private RenderTextureFormat GetDefaultFormat() => _renderCamera.allowHDR ? RenderTextureFormat.DefaultHDR : RenderTextureFormat.Default; + private RenderTextureFormat GetDefaultFormat() => enableHDR ? RenderTextureFormat.DefaultHDR : RenderTextureFormat.Default; private Vector2Int GetDisplaySize() {