msaa enable/disable for mobiles

Hi!

I am little confused here.

I want to disable/enable the antialising in my in runtime by a simple toggle.

My camera is setted to FXAA. My URP asset is setted MSAA to 8x.

How disable/enable MSAA it in urp asset?

I try in the simple way:
[SerializeField] private UniversalRenderPipelineAsset urpAsset;
and urpAsset.msaaSampleCount = 1; to none or urpAsset.msaaSampleCount = 8; to enable.
And yes, it is working, but I want to select the current urp asset without use SerializeField.

To diable in camera I am using :
Camera.main.GetComponent().antialiasing = AntialiasingMode.None

This is for Mobile application.

Can you help me to apply it?

Thank you!

@bisewski You can change the number of MSAA samples with this package: GitHub - inc8877/GraphicsConfigurator: API for managing URP asset parameters, including hacking of parameters that are forbidden to change

Configuring.CurrentURPA.AntiAliasing(MsaaQuality._4x);

This will select the currently active URP Asset automatically.

1 Like