- Home /
URP change SSAO Settings at Runtime
I cant access the settings inside my script. With this code i can only toogle on/off:
var rpAsset = UnityEngine.Rendering.GraphicsSettings.renderPipelineAsset;
var urpAsset = (UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset) rpAsset;
var _rendererFeatures = urpAsset.scriptableRenderer.GetType()
.GetProperty("rendererFeatures", BindingFlags.NonPublic | BindingFlags.Instance)
?.GetValue(urpAsset.scriptableRenderer, null) as List<ScriptableRendererFeature>;
_rendererFeatures[0].SetActive(!_rendererFeatures[0].isActive);
I think i need to cast "_rendererFeatures[0]" to ScreenSpaceAmbientOcclusion but it seems to be not a public class... Someone got an idea?
Debug.Log(_rendererFeatures[0].GetType().ToString()); Even gives me as Output: UnityEngine.Rendering.Universal.ScreenSpaceAmbientOcclusion
Comment
Your answer
Follow this Question
Related Questions
Shaders and ambient occlusion 1 Answer
Toggle OnValueChanged ignore on start 2 Answers
Depth buffer access via GLSL shaders 0 Answers
Need help porting shader to CG 0 Answers
SSAO showing through my character 1 Answer