04 August 2014

Quickly adding bloom to Unity

Recently I wanted to add bloom to a personal project I'm working on. In the Image Effects (Pro Only) package that you can import directly via the editor you have exactly what I wanted, a simple bloom effect. Attach it to the camera and boom you have bloom.

Sad thing though is that the compiler spits out a bunch of warnings when you import that package, clearly it's been a while since the package has seen some love from the Unity developers. I can understand that their priorities lie elsewhere.
Obviously I code in C# and I wanted to add the bloom effect on the main camera and change its public values via code. Since the effect was written in unityscript this was not possible.

So I spent some time converting it to C#, you can download it here if you want to use it. I did not clean the code or anything, just made sure it worked like it did before and that the compiler was completely happy with it.

2 comments:

Keannu Zeigfeld Atilano said...

Hi sir , i'm having troubles on how to use the script . can you please help me ?

Alex Vanden Abeele said...

You can just import the unitypackage into your project. Select a camera and then you select it in the menu 'Component->Image Effects->Bloom'

This will add the component with the correct shader on the selected camera.

Make sure that you don't have another class called "Bloom" or you won't be able to compile.