|
|
|
@ -17,12 +17,15 @@ namespace FidelityFX |
|
|
|
|
|
|
|
public bool performSharpenPass = true; |
|
|
|
[Range(0, 1)] public float sharpness = 0.8f; |
|
|
|
|
|
|
|
public bool enableAutoExposure = true; |
|
|
|
|
|
|
|
[Tooltip("Allow the use of half precision compute operations, potentially improving performance")] |
|
|
|
public bool enableFP16 = false; |
|
|
|
|
|
|
|
[Header("Exposure")] |
|
|
|
public bool enableAutoExposure = true; |
|
|
|
public float preExposure = 1.0f; |
|
|
|
public Texture exposure = null; |
|
|
|
|
|
|
|
[Header("Reactivity, Transparency & Composition")] |
|
|
|
public Texture reactiveMask = null; |
|
|
|
public Texture transparencyAndCompositionMask = null; |
|
|
|
@ -69,8 +72,8 @@ namespace FidelityFX |
|
|
|
|
|
|
|
// Initialize FSR2 context
|
|
|
|
Fsr2.InitializationFlags flags = 0; |
|
|
|
if (enableAutoExposure) flags |= Fsr2.InitializationFlags.EnableAutoExposure; |
|
|
|
if (enableFP16) flags |= Fsr2.InitializationFlags.EnableFP16Usage; |
|
|
|
if (enableAutoExposure) flags |= Fsr2.InitializationFlags.EnableAutoExposure; |
|
|
|
|
|
|
|
#if UNITY_EDITOR || DEVELOPMENT_BUILD
|
|
|
|
flags |= Fsr2.InitializationFlags.EnableDebugChecking; |
|
|
|
@ -196,7 +199,7 @@ namespace FidelityFX |
|
|
|
_dispatchDescription.Reactive = null; |
|
|
|
_dispatchDescription.TransparencyAndComposition = null; |
|
|
|
_dispatchDescription.Output = null; |
|
|
|
_dispatchDescription.PreExposure = 1.0f; |
|
|
|
_dispatchDescription.PreExposure = preExposure; |
|
|
|
_dispatchDescription.EnableSharpening = performSharpenPass; |
|
|
|
_dispatchDescription.Sharpness = sharpness; |
|
|
|
_dispatchDescription.MotionVectorScale.x = -_renderCamera.pixelWidth; |
|
|
|
@ -239,6 +242,11 @@ namespace FidelityFX |
|
|
|
|
|
|
|
_dispatchCommandBuffer.Clear(); |
|
|
|
|
|
|
|
if (!enableAutoExposure && exposure != null) |
|
|
|
{ |
|
|
|
_dispatchDescription.Exposure = exposure; |
|
|
|
} |
|
|
|
|
|
|
|
if (autoGenerateReactiveMask) |
|
|
|
{ |
|
|
|
_dispatchCommandBuffer.GetTemporaryRT(Fsr2Pipeline.UavAutoReactive, _renderSize.x, _renderSize.y, 0, default, GraphicsFormat.R8_UNorm, 1, true); |
|
|
|
|