Script To Update Post Process Profile At Runtime [2018 HDRP]

I have manipulated post processing profiles at runtime previously with no problem. Now I’m using:

  • Unity 2018.4.28f1
  • Post Processing Stack v2 3.0.1
  • High Definition Render Pipeline (HDRP) 4.10.0

Main Camera has a Post Process Layer and Post Process Volume:

When entering play mode, the Profile becomes an instance:

According to documentation, this is an “Owned Profile”:

Changes will only be applied to the specified volume

  • Resets when you exit play mode
  • It is your responsibility to destroy the profile when you don’t need it anymore
  • Field name: profile

volume.profile.TryGetSettings(out ambientOcclusion)
and
volume.sharedProfile.TryGetSettings(out ambientOcclusion)
both return true.

Trying to modify any post profile effect fails:
ambientOcclusion.intensity.value = 1f;

How can I change a post processing effect at runtime using Unity 2018.4.28 with HDRP and PP stack v2 3.0.1?

Solution: When trying to modify Chromatic Aberration, don’t use ambientOcclusion. xD