using UnityEngine;
namespace FidelityFX
{
///
/// A collection of callbacks required by the FSR2 process.
/// This allows some customization by the game dev on how to integrate FSR2 into their own game setup.
///
public class Fsr2Callbacks
{
public virtual void Message(Fsr2.MessageType type, string message)
{
switch (type)
{
case Fsr2.MessageType.Warning:
Debug.LogWarning(message);
break;
case Fsr2.MessageType.Error:
Debug.LogError(message);
break;
}
}
public virtual Shader LoadShader(string name)
{
return Resources.Load(name);
}
public virtual ComputeShader LoadComputeShader(string name)
{
return Resources.Load(name);
}
public virtual void UnloadComputeShader(ComputeShader shader)
{
Resources.UnloadAsset(shader);
}
public virtual void ApplyMipmapBias(float biasOffset)
{
foreach (var texture in Resources.FindObjectsOfTypeAll())
{
texture.mipMapBias += biasOffset;
}
}
}
}