- [Instructor] In this video, we're going to take a look
at using the post-processing stack with Cinemachine.
We're going to take a look at
how to use the post-processing extension
to activate post processes on Cinemachine virtual cameras,
and we're also going to look
at how we can blend between different post processes
on each of our virtual cameras.
The post-processing stack includes
a series of behaviors we can add to our camera
to drastically improve the aesthetics of our scenes.
In this scene, we have a simple timeline sequence
cutting between three different Cinemachine virtual cameras.
I'd like to add a number of different
post-processing effects to these shots.
Let's create a post processing layer on our main camera.
We'll set the layer of the game object
to a custom layer I've created called post processing,
then we'll assign the layer property of this component
to our custom layer.
It's worth noting that for optimal performance,
we should always have our volumes in dedicated layers
instead of the default one.
I'd like to apply some default post processes
globally across all of our cameras.
So, we'll create a post process volume on our camera,
create a new profile for our post process,
then we can apply our default post processes.
As you can see, I've added some default color grading,
depth of field and bloom effects.
Now we have three cameras with some post processing.
Our first shot looks great,
but let's maybe make a few changes.
Let's add a Cinemachine post-processing extension
and create a new profile.
Now, the default post processing is applied
as well as additional overrides we set in this profile.
Let's suppose we'd like our second shot
to look a bit different.
As our camera reaches a certain point on the track,
we'd like to blend into a different post process effect.
We can use post-processing volumes to do this.
Let's create a post processing volume.
The blend distance setting will cause the camera
to blend between its current post process
and the post process applied to the volume
as it enters the blend area.
Keeping the blend distance at zero
will cause the camera to immediately swap effects
without any blending.
Now, when the camera moves into the volume area,
our post process changes.
We can also use clip blending in timeline
to transition between different
Cinemachine post-processing states.
For example, in our final shot,
I'd really like the camera to start focused on the pillar
and pull focus to the background as it moves past.
To do this, let's duplicate the camera
and clone the post process.
We'll adjust the depth of field settings on the shot
to be focused on the background.
Now, if we swap between the two shots,
we can see the start and end states
that we'd like our camera to blend between.
If we move them together and create a blend state,
we can see that our camera now blends
between the two different states
emulating a pull focus effect.
It's also worth noting
that if we have a depth of field post process
enabled on a camera and we're tracking a target,
we can tell Cinemachine to dynamically pull focus
on our track target based on its distance from the camera.
As you can see, by using the post-processing stack
and overriding the effects with volumes
or Cinemachine post processes,
we can create some really interesting
and dynamic visual camera effects for our projects.
For more information on Cinemachine
and for more Unity tutorials,
be sure to follow the links below.
Thanks for watching.