48 lines
1.4 KiB
C#
Raw Normal View History

2024-11-15 17:51:59 +08:00
using UnityEngine;
2024-11-22 12:09:31 +08:00
using UnityEngine.Rendering.Universal;
using X.Rendering.Feature;
2024-11-15 17:51:59 +08:00
[ExecuteAlways]
public class Test : MonoBehaviour
{
2024-11-22 12:09:31 +08:00
int vrs = 0;
public void OnClickVRS()
2024-11-15 17:51:59 +08:00
{
2024-11-22 12:09:31 +08:00
var asset = UniversalRenderPipeline.asset;
if (asset != null)
2024-11-15 17:51:59 +08:00
{
2024-11-22 12:09:31 +08:00
vrs++;
if (vrs > (int)RenderingPlugin.VRSPluginShadingRate.X1_PER_4X4_PIXELS)
2024-11-15 17:51:59 +08:00
{
2024-11-22 12:09:31 +08:00
vrs = 0;
2024-11-15 17:51:59 +08:00
}
2024-11-22 12:09:31 +08:00
asset.VRSRate = (RenderingPlugin.VRSPluginShadingRate)vrs;
Debug.Log("VRS RATE" + asset.VRSRate);
2024-11-15 17:51:59 +08:00
}
}
2024-11-22 12:09:31 +08:00
private void Start()
2024-11-15 17:51:59 +08:00
{
2024-11-22 12:09:31 +08:00
Debug.Log($"FeatureSupport--\n" +
$"VRS:[{RenderingPlugin.GetFeatureSupport(RenderingPlugin.GraphicsFeature.VRS_DRAW)} " +
$"{RenderingPlugin.GetFeatureSupport(RenderingPlugin.GraphicsFeature.VRS_PRIMITIVE)}" +
$"{RenderingPlugin.GetFeatureSupport(RenderingPlugin.GraphicsFeature.VRS_ATTACHMENT)}" +
$"]" +
$"FG:[ QCOM_AFME: {RenderingPlugin.GetFeatureSupport(RenderingPlugin.GraphicsFeature.QCOM_AFME)}]"
);
2024-11-15 17:51:59 +08:00
}
2024-11-22 12:09:31 +08:00
private void OnGUI()
2024-11-15 17:51:59 +08:00
{
2024-11-22 12:09:31 +08:00
if (GUI.Button(new Rect(100,200, 100, 50), "VRS"))
{
OnClickVRS();
}
if (GUI.Button(new Rect(100, 300, 100, 50), "FG"))
{
X.Rendering.Feature.FG.UseFG = !X.Rendering.Feature.FG.UseFG;
}
2024-11-15 17:51:59 +08:00
}
}