48 lines
1.4 KiB
C#
48 lines
1.4 KiB
C#
using UnityEngine;
|
|
using UnityEngine.Rendering.Universal;
|
|
using X.Rendering.Feature;
|
|
|
|
[ExecuteAlways]
|
|
public class Test : MonoBehaviour
|
|
{
|
|
int vrs = 0;
|
|
public void OnClickVRS()
|
|
{
|
|
var asset = UniversalRenderPipeline.asset;
|
|
if (asset != null)
|
|
{
|
|
vrs++;
|
|
if (vrs > (int)RenderingPlugin.VRSPluginShadingRate.X1_PER_4X4_PIXELS)
|
|
{
|
|
vrs = 0;
|
|
}
|
|
|
|
asset.VRSRate = (RenderingPlugin.VRSPluginShadingRate)vrs;
|
|
Debug.Log("VRS RATE" + asset.VRSRate);
|
|
}
|
|
}
|
|
|
|
private void Start()
|
|
{
|
|
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)}]"
|
|
);
|
|
}
|
|
|
|
private void OnGUI()
|
|
{
|
|
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;
|
|
}
|
|
}
|
|
}
|