Understanding Bokeh and DOF in CGI
Camera Imperfections in 3D Rendering
Blauw Films

What is Bokeh?
Bokeh is a photographic lens effect in which distant bright spots of light, blur into a variety of shapes based on the aperture in the lens.
Bokeh can come in an infinite variety of shapes, softness, brightness and colours. And each type of bokeh gives a completely different effect to the image.
Depth of field brings a sense of focus (literally) to the image by only considering a slice of the world to be sharp. A shallow depth of field exaggerates this effect to only focus on a thin slice of space. While a deep depth of field allows you to take in a lot more of the world.

Bokeh, or blur disks
When you look at a fairly lights in the distance and you blur out your eyesight by focusing on something close by — take a moment to analyze your out-of-focus area.
Circles with a soft core and a gradient of rings glow agains the blurry background. These are the blur disks of your eye. And that is the bokeh of your image.

Camera-lenses or your human eyes have varying degrees of optical aberrations. This makes every image unique in the way the blur looks and more importantly, feels.
You can make an image feel magical through the use of bokeh. And you can also make it feel claustrophobic or disorienting.

The out-of-focus areas of your image take on a magnified shape of the light passing the lens elements. As the light ultimately passes through the aperture it has been filtered and cut into the shape of your bokeh.

How Bokeh works in CGI
In Computer Graphics it really works no different than in physical optics. Bokeh is calculated during the 3D-rendering process based on the same properties. F-Stop, aperture shape, vignetting, anisotropy and overlay textures define the lens characteristics.
These settings give you all the flexibility you need to create the textured out-of-focus areas in your render.

Artists can use this for additional creative effects as well. CG bokeh is, in essence, using a sprite to process the light rays hitting the camera. The more a ray is out-of-focus, the more the bokeh sprite will be magnified in front of it.


Animated Bokeh
Following the same train of thought, that bokeh in CGI is simply a sprite, one can imagine adding an animated image sequence as their bokeh map. Imagine, an aperture map sequence that starts of with a soft-core and a ring of light around the edges. But after a certain number of frames the aperture map starts changing — introducing chromatic aberration or darkening in the core.
This added flexibility can come in handy when in need of artistically timed effects.

Pixar made use of this technique very effectively in Encanto (2021). There they used animated bokeh to emphasize the magical realism of fire. Floating embers and sparks could transform as they became out of focus. Or they could have an animated glint effect as mentioned in this SideFX Houdini article.
CG Bokeh gives animators and look-dev artists even more control in creating the scene you intend to make. Important aspects of cinema such as conveying emotions and storytelling, can be aided through the bokeh of a scene.

Conclusion
Now that you've covered the basics of bokeh, depth of field and aperture maps in 3D rendering, it's time to become a master! :)
Personally I'd suggest you just start making as many renders as you can while you actively experiment with your depth of field. The more practice you have, the more you will get comfortable with what you're looking for in your 3d renders.
I constantly ask myself "How much should we be seeing?" and then it's just about changing the settings to achieve that result.
I'd like to leave you with a few further reads on this subject: Photorealistic Depth of Field in 3D, How Camera Apertures affect Bokeh in CGI and Understanding Lens Aberrations in 3D.
Thank you for reading and good luck!
0 Comments