|
|
@ -24,10 +24,13 @@ using System.Collections.Generic; |
|
|
using System.IO; |
|
|
using System.IO; |
|
|
using System.Reflection; |
|
|
using System.Reflection; |
|
|
using System.Text; |
|
|
using System.Text; |
|
|
|
|
|
using FidelityFX; |
|
|
using UnityEngine; |
|
|
using UnityEngine; |
|
|
|
|
|
|
|
|
public class DebugDumper : MonoBehaviour |
|
|
public class DebugDumper : MonoBehaviour |
|
|
{ |
|
|
{ |
|
|
|
|
|
private Fsr2ImageEffect _fsr; |
|
|
|
|
|
|
|
|
void Start() |
|
|
void Start() |
|
|
{ |
|
|
{ |
|
|
var sb = new StringBuilder("SystemInfo:\n"); |
|
|
var sb = new StringBuilder("SystemInfo:\n"); |
|
|
@ -37,6 +40,8 @@ public class DebugDumper : MonoBehaviour |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Debug.Log(sb); |
|
|
Debug.Log(sb); |
|
|
|
|
|
|
|
|
|
|
|
_fsr = GetComponent<Fsr2ImageEffect>(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void Update() |
|
|
void Update() |
|
|
@ -47,5 +52,50 @@ public class DebugDumper : MonoBehaviour |
|
|
ScreenCapture.CaptureScreenshot(path); |
|
|
ScreenCapture.CaptureScreenshot(path); |
|
|
Debug.Log($"Screenshot saved to: {path}"); |
|
|
Debug.Log($"Screenshot saved to: {path}"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (_fsr == null) |
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
if (Input.GetButtonDown("Fire1")) |
|
|
|
|
|
{ |
|
|
|
|
|
_fsr.enabled = !_fsr.enabled; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (Input.GetButtonDown("Fire2")) |
|
|
|
|
|
{ |
|
|
|
|
|
int quality = (int)_fsr.qualityMode; |
|
|
|
|
|
quality = (quality + 1) % Enum.GetValues(typeof(Fsr2.QualityMode)).Length; |
|
|
|
|
|
_fsr.qualityMode = (Fsr2.QualityMode)quality; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (Input.GetButtonDown("Fire3")) |
|
|
|
|
|
{ |
|
|
|
|
|
_fsr.enableAutoExposure = !_fsr.enableAutoExposure; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (Input.GetButtonDown("Jump")) |
|
|
|
|
|
{ |
|
|
|
|
|
_fsr.ResetHistory(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void OnGUI() |
|
|
|
|
|
{ |
|
|
|
|
|
if (_fsr == null) |
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
float scale = Screen.height / 720f; |
|
|
|
|
|
if (scale > Mathf.Epsilon) |
|
|
|
|
|
{ |
|
|
|
|
|
GUI.matrix = Matrix4x4.Scale(new Vector3(scale, scale, scale)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
GUILayout.Label($"FSR2: {(_fsr.enabled ? "Enabled" : "Disabled")}"); |
|
|
|
|
|
GUILayout.Label($"Quality: {_fsr.qualityMode}"); |
|
|
|
|
|
GUILayout.Label($"Auto-exposure: {(_fsr.enableAutoExposure ? "Enabled" : "Disabled")}"); |
|
|
|
|
|
if (Input.GetButton("Jump")) |
|
|
|
|
|
{ |
|
|
|
|
|
GUILayout.Label("Reset"); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |