|
|
@ -218,11 +218,15 @@ namespace UnityEngine.Rendering.PostProcessing |
|
|
|
|
|
|
|
|
// Apply a mipmap bias so that textures retain their sharpness
|
|
|
// Apply a mipmap bias so that textures retain their sharpness
|
|
|
float biasOffset = Fsr2.GetMipmapBiasOffset(_renderSize.x, _displaySize.x); |
|
|
float biasOffset = Fsr2.GetMipmapBiasOffset(_renderSize.x, _displaySize.x); |
|
|
if (!float.IsNaN(biasOffset)) |
|
|
|
|
|
|
|
|
if (!float.IsNaN(biasOffset) && !float.IsInfinity(biasOffset)) |
|
|
{ |
|
|
{ |
|
|
_callbacks.ApplyMipmapBias(biasOffset); |
|
|
_callbacks.ApplyMipmapBias(biasOffset); |
|
|
_appliedBiasOffset = biasOffset; |
|
|
_appliedBiasOffset = biasOffset; |
|
|
} |
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
_appliedBiasOffset = 0f; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void DestroyFsrContext() |
|
|
private void DestroyFsrContext() |
|
|
@ -233,7 +237,7 @@ namespace UnityEngine.Rendering.PostProcessing |
|
|
_fsrContext = null; |
|
|
_fsrContext = null; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (!float.IsNaN(_appliedBiasOffset) && _appliedBiasOffset != 0f) |
|
|
|
|
|
|
|
|
if (!float.IsNaN(_appliedBiasOffset) && !float.IsInfinity(_appliedBiasOffset) && _appliedBiasOffset != 0f) |
|
|
{ |
|
|
{ |
|
|
_callbacks.ApplyMipmapBias(-_appliedBiasOffset); |
|
|
_callbacks.ApplyMipmapBias(-_appliedBiasOffset); |
|
|
_appliedBiasOffset = 0f; |
|
|
_appliedBiasOffset = 0f; |
|
|
|