|
|
|
@ -44,8 +44,6 @@ namespace FidelityFX |
|
|
|
[Tooltip("Strength of the sharpening effect.")] |
|
|
|
[Range(0, 1)] public float sharpness = 0.8f; |
|
|
|
|
|
|
|
[Tooltip("Make use of high-dynamic range render texture formats and tonemapping adjustment during upscaling.")] |
|
|
|
public bool enableHDR = true; |
|
|
|
[Tooltip("Allow the use of half precision compute operations, potentially improving performance if the platform supports it.")] |
|
|
|
public bool enableFP16 = false; |
|
|
|
|
|
|
|
@ -144,7 +142,7 @@ namespace FidelityFX |
|
|
|
|
|
|
|
// Initialize FSR2 context
|
|
|
|
Fsr2.InitializationFlags flags = 0; |
|
|
|
if (enableHDR) flags |= Fsr2.InitializationFlags.EnableHighDynamicRange; |
|
|
|
if (_renderCamera.allowHDR) flags |= Fsr2.InitializationFlags.EnableHighDynamicRange; |
|
|
|
if (enableFP16) flags |= Fsr2.InitializationFlags.EnableFP16Usage; |
|
|
|
if (enableAutoExposure) flags |= Fsr2.InitializationFlags.EnableAutoExposure; |
|
|
|
|
|
|
|
@ -366,8 +364,14 @@ namespace FidelityFX |
|
|
|
// Shut up the Unity warning about not writing to the destination texture
|
|
|
|
RenderTexture.active = dest; |
|
|
|
} |
|
|
|
|
|
|
|
private RenderTextureFormat GetDefaultFormat() => enableHDR ? RenderTextureFormat.DefaultHDR : RenderTextureFormat.Default; |
|
|
|
|
|
|
|
private RenderTextureFormat GetDefaultFormat() |
|
|
|
{ |
|
|
|
if (_originalRenderTarget != null) |
|
|
|
return _originalRenderTarget.format; |
|
|
|
|
|
|
|
return _renderCamera.allowHDR ? RenderTextureFormat.DefaultHDR : RenderTextureFormat.Default; |
|
|
|
} |
|
|
|
|
|
|
|
private Vector2Int GetDisplaySize() |
|
|
|
{ |
|
|
|
|