Overview
In my quest to create a full lighting post process pipeline for Unity I developed a highly customizable Filmic Tonemapping effect to fix the “foggy” look issue of 3D Unity games developped with linear space.
Filmic Tonemapping is used to map HDR values to visible range while making colors more interesting and sharper. Your screen is limited by the 256 possible values for each channel of each pixels (8 bits) and by remapping those values where it matters (in mid color range of your scene) you can produce a more High Definition look while creating interesting lighting contrast. It is at the core of most modern AAA video games graphics engine.
Filmic Tonemapping is an addition to color correction. It will upgrade colors in a way that can’t be achieved with most color correction tools.
Since version 1.2, a high quality histogram based eye adaptation effect have been added. This effect is able to simulate how human eyes adapt to lighting while keeping an optimal contrast and white point.
Filmic Tonemapping DELUXE features Filmic Tonemappping
Combinable color and luminance mapping
Highly Customizable Contrast (dark and bright features)
This first scene is an indoor scene. You can see that with filmic tonemapping dark colors and bright colors pops out more while making mid-range value more clear and defined.
This second scene is an outdoor scene. With Filmic Tonemapping DELUXE, the sunlight actually look intense making the scene more vibrant (this kind of contrast cannot be done by simply tweaking the Unity light settings).
Future Versions
Now that the eye adaptation update is done, I plan on adding small features and refinements based on users feedbacks.
Hey, great asset, it really does his job. But, after updating to 1.1, i get just black image in build. In editor everything is OK, but in build - black screen.
UPD: I am getting this error in build : “Graphics.Blit: material is null”
UPD: Fixed by placing shaders into “Resources” folder. Otherwise, they are not included in build bacause nothing is referencing them.
Also, i was having a problem in previous version - using Deluxe Tonemapping kills DOF effect in build. When tonemapping is used, dof is just not there. Again, this problem was in build version only, everything ok in editor…
Unity for some reasons, won’t automatically include all shaders in builds. If you want to make it works in builds, you need to go to “Edit/Project Settings/Graphics” and add all Filmic Tonemapping DELUXE shaders to the always included shaders. This should fix it. =)
I also submitted an update (shoud be available soon) and with this version you won’t need to do this anymore.
The new version 1.1ff is now available on the store. It works in builds without any problems now. I tested with DoF and it works fine now, it was probably linked to missing shaders when generating the exe too.
It’s almost done. I had to find a couple of workarounds to build a multiplatform GPU based histogram with Unity and it was trickier than I thought. It’s now working and I am in the optimization phase.
I had no idea you could force a reset on the component since I never used this feature before (right click/reset ?) . The HDR values are set when the component is added to the camera and it won’t reset to hdr default values as a consequence. I it should be fix in the next update =)
Everything is customizable (adaptation speed up/down, exposure, exposure range, and more). The Eye adaptation is a different component so that you can use it before other effects like bloom, or use it without tonemapping.
The eye adaptation update have been accepted and published =)
I’m happy with the results and performances and I’m pretty sure there is no comparable eye adaptation algorithm done in Unity since computing a multiplatform histogram on the GPU with Unity is a big hack (with the others engines like unreal engine it requires Dx11/compute shaders. It’s working with Dx9, Dx11 and OpenGL with Filmic Tonemapping DELUXE).
With the optimization flag, on my old 2012 macbook air with intel hd 4000, it was running at about 0.3ms in-editor.
It’s currently being used with success in the game the forest.
I am so excited to try this. I have been getting decent results with the last version, but the documentation still refers to seperate components for hdr/ non hdr setup. Took me a while to find values that worked in HDR. Hopefully the new update’s eye adaptation solves this.
In this new update, there is only one way to add the tonemapping component, and I added some HDR and non-HDR (LDR) presets to get started instead (you can select them inside the component presets box). It should be more intuitive that way.
In the old version, it was really just the same component with different default values (notably, the non-hdr default values had the white point (maximum color value) set to 1 since LDR image buffers can’t handle values over 1).