Shallower Depth of Field while retaining the same framing and aperture in Unreal Engine

- by

I tend to use an 18mm focal length for shooting in Unreal Engine, with a standard 16:9 aspect ratio. I find that it matches well what I see in the default viewport, which gives me roughly 90 degrees field of view. This leads to a relatively deep focus with an object tracked close to the camera, and it’s often not shallow enough for what I’d like to use.

Ideally I’d shoot with a longer lens to throw the background out of focus more and emphasise my subject, but that’s not always possible in confined environments. It also presents the problem that it shows less of the environment as it flattens perspective. Even with the largest aperture that Unreal Engine can render (f1.8 without tweaks), depth of field is not shallow enough for my project in most situations.

The solution is rather simple: with a larger film back, the same aperture renders a shallower depth of field. However, a larger film back with the same focal length will just render more of the background, so we need to compensate for this if we want the framing to stay the same. Take this comparison of a shot taken under the above conditions, and observe the depth of field.

On the left we see an 18mm focal length at f2.8. On the right we see 36mm also at f2.8, with a larger film back size that leaves my framing more or less intact. Below is the same 18mm lens compared to a 72mm lens, with an even larger film back.

The formula to achieve this effect is very easy to calculate:

Multiply the focal length by the same number as the sensor width and height.

In other words, an 18mm focal length with a sensor size of 23mm by 13mm shows the same framing as a 36mm focal length with a sensor size of 46mm by 26mm. However, with the same aperture, the depth of field will be shallower.

This trick works in all 3D apps that can produce depth of field with a render, not just Unreal Engine of course. However it’s not always necessary to use since other apps may allow rendering with apertures approaching 0, which wouldn’t be possible in real life.



If you enjoy my content, please consider supporting me on Ko-fi. In return you can browse this whole site without any pesky ads! More details here.

Leave a Comment