How to Add Camera Effects in Unity

kristielAll Topics, Tutorial, Unity Game Development

Share this Post

Camera Effects are a very important part of a game’s look and feel. Things like color correction, bloom, and film grain can add a nice polish to your game. Visual processing has been a crucial part of filmmaking for decades. There’s no reason that the same methods can’t be applied to games. Conveniently enough, Unity has built-in scripts for camera effects. In this post, I will outline how to add camera effects to your main camera in a Unity scene and talk about what some of the different effects do.

Tips for using Camera Effects in Unity

Import the Effects Package:
In order to get camera effects working, you first need to import the Effects package from Unity’s Standard Assets. You can either choose to import this package when you create your game, or you can add them to your existing project by going to Assets → Import Package → Effects.

Unity Import Effects

Add Effects to Your Camera:
Once the effects are imported, you can begin to add them to your main camera. In the Asset window, go to Standard Assets → Effects → ImageEffects → Scripts. In this folder you’ll see all the different effects you can put on your camera. In order to actually use an effect, it’s simply a matter of dragging one of the scripts and dropping it onto the component section if your main camera or onto the camera in the hierarchy. For instance, in the following screenshot, you can see I put a bloom script on the camera and customized some settings:

Unity ImageEffects

NOTE: If I disable the bloom script from my camera, you can notice a change on the game view

Unity Bloom Script off

It’s a very minor change but that’s because I used very conservative settings.

Turn HDR On:
In order to get the best looking image out of your camera, it’s recommended to turn HDR on. To do this, open up the Camera component from your Main Camera and check the box that says “HDR”.

HDR Importance

HDR allows the camera in Unity to be much more realistic as it can interpret exposure values outside of the 0 – 1 range. This allows the camera to accommodate pixel values that fall outside of the 0 – 1 range. However, because of this, it is recommended to utilize Unity’s Tonemapping script on your camera in order to process the camera back down to a low dynamic range for a more realistic look. After you’ve setup the effects that you want on the camera, you will want to drag and drop a Tonemapping script from the ImageEffects folder onto your camera.

Tonemapping

Tonemapping:
You can go through the different “Technique” options and find one that you like. Tonemapping will help neutralize your image after applying effects to it which could possibly overexpose or cause unwanted artifacts on your render. It’s important to note that once you set the camera to HDR, you will no longer be able to utilize Unity’s built-in antialiasing. You will have to utilize the antialiasing image effect in order to actually provide antialiasing to your camera’s rendering.

Commonly Used Effects:
Lastly, some of the most commonly used effects in games would be Bloom, Color Correction, Anti-aliasing, Motion Blur, Lens Flare, Depth of Field and Motion Blur. Using a combination of these effects and carefully manipulating them to your liking should help you create the kind of visual aesthetic that will bring your visuals to the next level. The trick is to add one thing at a time and tweak the settings until you get something that you prefer. If you’re feeling really adventurous, there’s nothing stopping you from opening the scripts up in MonoDevelop and modifying them to achieve a desired result.

Using the built-in camera effects that Unity provides is a great way to make your game look the way that you envision it. There are also some great effects that users have created and put up on the Unity Asset Store. I would recommend checking those out as well. Hopefully this information was helpful. Now go forth and make some awesome games! Studica offers students academic discounts on software, robotics and more. Check out our different products, related to game development.

Blogger: Mark Philipp, Application Engineer at Studica

Share this Post