- Post processing is a huge part
of making a good-looking game.
To those who are unfamiliar with the term,
post processing basically
means image effects
that we can apply to change
the look of our game.
Usually, you add post processing
as a nice last touch to a game,
but sometimes it can even be used
to create a completely different look.
We've created a video on
post processing before,
but since then it's been
completely revamped,
and it's now easier than ever.
So in this video, we'll have a look at how
you can add post processing to your game,
and we'll also go over
each individual effect
to give you a good idea of
what you can do with it.
But first, this video is
sponsored by AmbiensVR.
AmbiensVR are the creators of the amazing
Unity plugin AT+Explore.
This plugin is designed to
allow artists and architects
to create interactive environments
without worrying about coding.
It provides you with a
series of visual tools
to manage cameras and interactions.
With a few clicks, you're able to create
interactive environments for Android, iOS,
PC, Oculus Go and Quest
and OpenVR devices.
The plugin also comes with
prepackaged interactions
like material switching, working
doors, windows and drawers,
and a visual scripting system.
The team is made up of
architects and computer engineers
who are always ready to help.
So if this sounds interesting to you,
simply click the link in the
description to get started.
Now, before we get into
it, we have to mention
that post processing is
a little bit different
depending on if you're using URP or HDRP.
The workflow is pretty much the same,
but HDRP does offer some
more advanced effects.
In this video we'll focus on URP,
since that's the most commonly used,
and most of what you'll
learn here should just apply
to HDRP as well.
And with that said, let's jump into it
and play around with some colours.
So as you can see, we
are here in Unity 2019.3,
and the demo scene we're using here
is the RPG Poly Pack Lite,
which is free on the Asset Store.
We'll, of course, have link
for that in the description.
Now, to add post processing,
we first have to create a volume.
To do this, we right
click in the Hierarchy,
go under Volume and select Global Volume.
This object is responsible for adding
post processing to our camera.
But first we have to create a profile.
We do this by simply clicking New.
As you can see, this
creates a profile object
that we can add effects to.
In Unity, effects are called overrides.
If you click Add Override, we get a list
of effects to choose from.
Let's just add a vignette.
As you can see, all of
the effect properties
are blurred out.
This is because we can
choose what settings
we want to influence.
If, for example, we want
to adjust the intensity,
we simply check the box next to Intensity
and adjust the slider to whatever we want.
Now, at this point you might be confused
as to why nothing is happening,
at least I was until I found
this secret magic button
hidden in the camera
under Rendering Settings.
- [Child's Voice] Wow!
- You won't believe how long it took me
to find this setting.
Well, moving on.
Another thing to enable is HDR,
which you can find under your
Render Pipeline settings.
HDR stands for high dynamic range,
and is a way of packing more
colour data into your image.
This gives us greater control
over the look of the scene
when we start applying image effects
and helps us avoid clipping,
while you lose colour information
in very bright or dark spots.
And that's it for setup.
Of course, the new post processing stack
is using a volume system.
This allows us to blend
between different profiles
on the fly, depending on
the camera's position.
This is great when you
want different effects
in different areas, such
as when going underwater
or inside a cave.
Inside of Unity, we can
choose between either Global,
where the camera is always affected,
or Local, which allows
you to select a collider
to use as the area for the volume.
This means that the
camera is only affected
while inside the area.
Now, with that explanation out of the way,
let's make things pretty.
There are a lot of
effects supported in URP,
so we'll split them into a few categories
to make things a bit easier to grasp:
Colour correction, lens
stuff, camera and effects.
There are, of course, timestamps
for all the effects in the description
if you're looking for
something in particular.
Now, let's start with colour correction.
The tonemapper maps colours
from HDR colour space
to something the monitor can display.
Here you have two options:
Neutral, which has minimal
impact on the colours
and is a great starting
point when you want
more control when colour correcting,
or ACES, which is an
industry-standard tonemapper
for achieving a more cinematic look.
I'll throw a link in the
description if you want to know more
about how ACES works.
Just remember that you should always use
some kind of tonemapper
when you have HDR enabled.
White Balance allows you to
adjust the colour temperature
to shift the colours toward
blue, cold or yellow, warm.
You can use Tint to do the same thing,
but between green and purple.
Fun fact: It's actually
called White Balance
because on real cameras you adjust this
until the white parts of your
image actually look white,
and not weirdly coloured under
different lighting conditions.
Colour Adjustment is
used to tweak the overall
colour brightness and
contrast of the image.
This one is pretty self-explanatory,
but I will give you a quick tip.
I find that using the ACES tonemapper,
while also increasing
the post exposure a bit,
often gives a really nice
and bright appearance.
The Channel Mixer allows you to tint
the red, green and blue colour channel.
You can adjust the influence
of red, green and blue
for each channel.
To be honest, I don't find
this one very intuitive
so I don't use it a lot, but
it's there if you need it.
Now, Colour Curves is
a very versatile tool.
The most common use case is to adjust
the luminesce of the image.
If you've every used the
Curves adjustment in Photoshop,
you already know what this does.
The X-axis of the graph
represents input luminesce
and the Y-axis represents
output luminesce.
In other words, you
can remap the luminesce
at different intensities.
At the lower-left side
the input luminesce is 0,
so completely dark,
and top-right is 1, aka max brightness.
If we lift the key up, the
dark parts of the image
will become brighter.
With this, we can create
curves that remap luminosity
just the way we want.
And this applies for
each channel, as well.
If we want less red in the highlights,
we can simply go to the red
channel and turn it down.
Now, that's the basic use case,
but Unity has more tricks up its sleeves.
You might have noticed that there are
four additional curves to
select in the drop-down.
These let you control
brightness and colour
in completely different ways.
I won't go into detail with all of them,
but I will show you a couple
of cool use cases I stumbled across.
For example, I think the sky in this scene
could use a bit more colour,
so I'll select the Hue
Vs Saturation curve.
Here we can adjust the
saturation at a specific hue.
In my case, that is light blue,
so let's turn that up a bit.
That's better.
Now, I don't really like the
colour of this sky either.
I would like it to be
a bit more a deep blue,
so let's fix that as well.
The Hue Vs Hue curve works the same way,
but instead of increasing saturation
we instead adjust a hue at
a specific hue or colour.
So let's isolate blue again and adjust it.
Perfect.
Another cool effect you can
make is a colour splash effect.
In other words, the image
is completely grayscale
except for one colour.
We can do this by going into
the Hue Vs Saturation curve
and turning everything down.
As you can see, the
image is now grayscale.
Now we isolate the colour we want
and turn that all the way up.
So I'll select green to make
the grass and trees stand out.
You can even go ahead
and hue shift it as well,
to get even crazier.
As you can see, the sky's
the limit with this one.
Get it? 'Cause we can
adjust the colour of the...
Anyways.
Shadows, Midtones and
Highlights allows you
to separately control
the tint and brightness
of the shadows, midtones
and highlights of the image.
You can also define the ranges of each.
This is just a very intuitive
tool for colour grading.
Lift, Gamma and Gain works just like
Shadows, Midtones and Highlights,
but instead of letting
you define the ranges,
it instead uses the ASC CDL
colour grading standard.
Phew, that's right. PhD
in acronyms over here.
I find that the colour
grading from this produces
more natural results than
Shadows, Midtones and Highlights.
Now, that could really use an acronym.
Split Toning works by tinting
the shadows and highlights
to specific colours.
This often produces a
very stylized effect.
However, a very cool thing here
is that you can adjust the balance
between the two tints using a slider.
What if I told you that
everything we just went over
can be accomplished with a single effect?
That is the Colour Lookup
Table, or LUT for short.
Here Unity looks at every pixel
and changes its colour based
on the supplied LUT file.
So here's how to do it.
Number one: Take a screenshot
of the scene from your game.
Number two: Import the screenshot
into the photo editor of your choice.
I'm using Photoshop.
Here you do all the colour
adjustments that you need.
Number three: Apply the same adjustments
to a neutral LUT and save it as a PNG.
This is now your LUT file.
And number four, assign the LUT file
inside of Unity, and viola!
Your scene now looks
like the edited photo.
Phew. All right, that's
it for colour settings.
Now let's look at some effects.
Bloom lets bright areas bleed
into the surrounding pixels,
or in other words, it
makes bright areas glow.
The threshold determines
how bright an area should be
for bloom to be applied.
Without HDR, a threshold of 1 would mean
that only completely white
areas would have bloom applied,
but now that we are working with HDR,
areas can have values greater than 1,
which is very useful because
it gives us full control
over how much something should glow.
We can control the overall
intensity of the bloom
using the Intensity property,
and the spread of the glow
by adjusting the Scatter.
The Bloom effect also
has a lens dirt option.
This overlays a texture on the bloom,
simulating stuff like smudges or scratches
on the camera lens.
We'll have a link to some
free lens dirt textures
in the description that you can use.
Chromatic Aberration splits the colours
around edges of the game view
into their red, green and blue channels.
This is normally seen in
low-quality camera lenses,
but is now often used to
create a cool distorted look.
Film Grain overlays classic film noise
onto the image for a cinematic view.
URP comes with a bunch
of different grain types,
but you can also supply your own.
Vignette darkens the
edges of the game view.
This is also often seen in
low-quality camera lenses,
but it is now being used
for a dramatic effect a lot.
Here you can control
intensity, colour, smoothness
and, yeah, it's pretty self-explanatory.
Now onto so camera lens effects.
Depth of Field simulates focus.
This means that everything that isn't
at a certain distance from
the camera gets blurred out.
You can choose between Gaussian,
which uses a common image blur technique
to create a pretty cheap and
quick depth of field effect,
or Bokeh, which much, much
more accurately simulates
the way light behaves when
entering a real-life camera lens.
Here you can adjust
real camera properties,
such as focal length and aperture,
to get the look you're going for.
Motion Blur simulates the blur that occurs
when a real camera is moving
while the shutter's open.
This essentially stretches the light
in the direction of the movement,
which makes it feel
more natural and smooth.
Lens Distortion distorts
or curves the image.
This allows you to create
effects such as fisheye,
and what I've personally named
the hyper speed effect. (humming)
Panini Projection corrects
perspective cameras
with high FOV.
This helps reduce stretching
in the corners of the screen,
as well as keeps vertical lines straight.
This one gets a bit wonky
when used with moving cameras.
Might be great for a
drawn character, though.
Finally, we have a few
more settings to look at.
These, however, are located
on the camera itself.
Dithering applies noise
to the image to prevent
larger patterns when
encountering quantization errors.
Even though modern screens can
produce some million colours,
that's not always enough,
especially in dark areas,
so dithering helps eliminate
some of the artefacts.
Anti-Aliasing helps to
reduce jagged edges.
It adds interpolation to
smooth out stair-stepped lines.
At the moment there are
two options: FXAA and SMAA.
FXAA is more performant,
while SMAA has better quality.
Some of you might have noticed
that there's also another setting
with the name Anti-Aliasing.
This one is located under
the Render Pipeline settings.
This is a third type of
anti-aliasing called MSAA,
and it can be applied on top of the other
anti-aliasing methods to really make sure
that those lines stay smooth.
And that's pretty much it for this video.
If you liked it, make sure to subscribe,
and ring that notification bell
so you don't miss the next one.
And hopefully that gave you a good base
to start using these effects in your game.
Well, of course, I have some
links in the description
to where you can learn more.
Also, don't forget to check out AmbiensVR
and their plugin AT+Explore.
Start creating interactive
environments for your projects
now by simply clicking the
link in the description.
On that, thanks for watching,
and I will see you in the next video.
Thanks to all of the
awesome Patreon supporters
who donated in May, and a
special thanks to faisal marafie,
Lost to Violence, Loved
Forever, Replica Studios,
Nubby Ninja, SRT Mike, JAson Uritescu,
Leo Sesetre, Piano
Sathornlak, Donatien Gascoin,
Dante_Sam, Jacob Sanford, Naoki Iwasaki,
Marc-Antoine Girard, Gregory Pierce,
Michail Korobov,
TheMightyZeus, Owen Cooper,
Alison the Fierce, Erasmus and SiriusWolf.
You guys rock.
