You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.3 KiB
47 lines
1.3 KiB
using UnityEngine;
|
|
|
|
namespace FidelityFX
|
|
{
|
|
/// <summary>
|
|
/// 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.
|
|
/// </summary>
|
|
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<Shader>(name);
|
|
}
|
|
|
|
public virtual ComputeShader LoadComputeShader(string name)
|
|
{
|
|
return Resources.Load<ComputeShader>(name);
|
|
}
|
|
|
|
public virtual void UnloadComputeShader(ComputeShader shader)
|
|
{
|
|
Resources.UnloadAsset(shader);
|
|
}
|
|
|
|
public virtual void ApplyMipmapBias(float biasOffset)
|
|
{
|
|
foreach (var texture in Resources.FindObjectsOfTypeAll<Texture2D>())
|
|
{
|
|
texture.mipMapBias += biasOffset;
|
|
}
|
|
}
|
|
}
|
|
}
|