I just recently switched to URP from SRP (uninstalled old Post-Processing as well, restarted Unity) and am trying to redo some vignette logic using the URP post processing. I have a couple of vignettes of different colors, I activate them in response to certain events, they have different priorities yada yada yada.
At the moment I am just working with a single vignette, wanting to toggle it off and on. I have a GameObject with a Global Volume on it, with a Profile define, weight 1.
I am using a Cinemachine camera, which has a Cinemachine Volume Settings extension on it, assigned to the same profile, focus tracking set to none.
At runtime, when I make changes to my GameObject’s vignette state via the inspector, it reflects on the Cinemachine Volume Settings, toggles on and off perfectly fine, expected behavior.
When I toggle it via script though:
if (postProcessVolume.profile.TryGet<Vignette>(out vignette))
{
vignette.active = state;
}
It doesn’t do this. The GameObject’s Vignette enables like I expect, but the Vignette on the Cinemachine Volume Settings doesn’t sync with it. It also breaks the previously working connection between the two. Changes to one of these volume profiles no longer affects the other. If I exit Play Mode and then re-enter it, they sync back up and start working again, until I attempt to change the state of the vignette via script.
I don’t understand why changing the state via script would break the connection between the two, while changing it via the inspector (also in play mode) works as expected. Seems like a bug to me, but I am also only just starting to use the URP Post-Processing feature.