Change SSAO ScriptableRendererFeature at runtime

I’m trying to change the SSAO radius at runtime but have come to a dead-end. This is what I got so far:

public ForwardRendererData forwardRendererData;
...
private void Awake()
{

    List<ScriptableRendererFeature> feat;
    feat = forwardRendererData.rendererFeatures;
   
    for (int x = 0; x < feat.Count; x++)
    {

        if (feat[x].name == "ScreenSpaceAmbientOcclusion")
        {

            // feat[x].SetActive(false); <- This works

            var t = feat[x].GetType().GetProperty("m_Settings", BindingFlags.NonPublic);

            // t == null, no t.Radius etc.

        }

    }

}

Any help appreciated.

Radius and intensity should have been stored on a volume component. The general idea is to put performance/quality options on a render feature, so they can vary per renderer or quality level. But anything that may differ per scene, should be on a volume component. Ironically, Unity didn’t follow their own design for SSAO :stuck_out_tongue:

Your value ‘t’ is an abstract value, so you won’t be able to access properties like radius or intensity directly. Instead you have to cast it to a ScreenSpaceAmbientOcclusionSettings type. Which is internal, so you’d have to use reflection to get that first. And likely use reflection for any other properties. So the rabbit hole goes deeper still!

Thanks, yes I noticed that ScreenSpaceAmbientOcclusionSettings is internal. I was hoping for a more future-safe way of doing this stuff but I guess I’m out of luck.

I’m having trouble getting to the internal class using reflection. Any pointers? =)

Hello, Any solution found? ScreenSpaceAmbientOcclusionSettings how to change?

Meet the same problem. Is there any solution yet?

Amazing, it’s almost the end of 2026, and there’s still no way to fix this issue.