Let's learn how to make this glow effect in Unity with a little bit of post-processing. Let's get started.
How Does Post Processing in Unity Work?
Post-processing works essentially by adding a filter over the main camera, but because of this, we need to isolate the layer that the camera is on. By default, the main camera is on the "default" layer, so we need to create a new layer for the camera to sit on.
Watch the Video:
Step 1: Install Post Processing
Window > Package manager > Post Processing > Install
Step 2: Post-Processing Setup
On your main camera object, you'll need two things for this to work:
- Post Process Layer
- Post Process Volume
The post-process layer tells unity where to place our effects, so this is where we get to choose the camera and layer to put the effects on (which we just created).
The post-process volume is where we get to set up our effects and alter other settings like priority and blending, but we really don’t need those for this tutorial as we’re only doing one post-processing layer.
Since I want this effect to apply to the whole scene, I'm checking "Is Global". If you're working with multiple layers, you may not want this option.
There are a lot of cool post-processing effects here, but the one that is going to make our object glow is the bloom effect. None of the settings are set up by default so we have to go in and check the ones we want—the first 3 are all we really need for this, but this is one of those things where it’s nice to have a starting line and then you can play around with the other effects and get used to what they do.
Here's a general rundown of what the settings do:
How Does Bloom Work?
Bloom works by taking light and bleeding the edges of the light, so to make objects glow they have to have…well, light.
Making an Object Glow
So if bloom requires a light source, how do we do that on an object? Luckily we can create a material that has an emission component that will allow your object to emit light.
Create > New Material > Check Emission Box > Select Glow Color
Create a new 3d object and assign your new material to it.
- This is for the built-in render pipeline, URP and HDRP have slightly different workflows.
- Make sure your intensity on the bloom effect is above 0! For some reason, the default is 0 when checked, which will not produce any effects.
- Make sure you have a light source in your scene. Your object will still glow without one, but it probably won't look as expected.
- It may help to remove the default skybox (since it's so light) to really see the glow effect.