How To Enable Or Disable URP Camera SMAA At Runtime With C#

I want to enable or disable SMAA at runtime with c#? I can’t find the appropriate code to do this

This post is over a year old, but showed up first for me on searches. Hopefully this will help someone.

Here’s how I did it, making sure first that my Camera GameObject has the UniversalAdditionalCameraData script added.

using UnityEngine.Rendering.Universal;


Camera cam = GetComponent<Camera>();
UniversalAdditionalCameraData uacm = cam.GetComponent<UniversalAdditionalCameraData>();
uacm.antialiasing = AntialiasingMode.SubpixelMorphologicalAntiAliasing;
uacm.antialiasingQuality = AntialiasingQuality.High;