Animate Sky and Fog Volume over time

I would like to change parameters of Sky and Fog Volume ( i.e. fog attenuation distance and and color tint) over time.

I tried usual workflow by key-framing, but when I changed fog properties, no animation key was added on timeline. It seems “This is by design, the Animator in Unity only supports basic properties on MonoBehaviour components.” Unity Issue Tracker - [HDRP][Animation] Unable to add key to recording Animation when changing values in Sky and Fog Volume

Then I tried create several Sky and fog Volumes and blend then by changing its weight. However this results in small glitch (when new volume is getting higher priority I believe).

So is there any other way how to animate parameters of Sky and Fog Volume in HDRP?
Thank you

Isn’t this the answer?

Make a MonoBehaviour with the values that you can access for sure, then just have them reflect into the non-monobehaviour API you need to actually access.

Sounds like a good idea. So I have referenced Sky and Fog volume (public UnityEngine.Rendering.Volume volume; ), but did not manage to access Fog override yet. I would like to change specifically its fog attenuation distance parameter. Could you give me some leads, please? I’m quite new in scripting.

Animating post process is tricky, since they are assets. This approach (animating the weight of a post process volume), while more limited, can be used effectively but getting the priorities correct can be tricky, Using ‘global’ (i.e. no volume attached) post process with highest priority and active when timeline is enabled works for simple effects.

Otherwise using a MonoBehaviour to change the parameters of a PostProcess asset will work, but will always change the values of that asset on disk, so that’s something to account for if you are using the PostProcess somewhere else in your application. You may want have the Monobehaviour create and use a clone of the asset if possible.

You can do this with Cinemachine. Add a New Cinemachine Volume profile on a Cinemachine Virtual Camera (botton of VCam settings panel)

· then add the specific overide you are looking to animate (eg: Fog, exposure, depth of field) and tweak the overide settings for the 'in"

· do the same with a new profile on a second Virtual camera with new overide settings as the “Out” and

· transition the 2 VCams in timeline and the properties will animate

*works for alot of the overides but not all. Eg: HDRP sky etc.

2 Likes