2018-10-26 – Blender Conference 2018 Lightning Talk: Optical Elements in Cycles

The content of this article was first presented at the Blender Conference 2018, Amsterdam.


The idea to simulate optical lenses came to me after renderings of a 3D-scanned rock came out disappointing. The particle system that I used to make hundreds of light points produced mathematically perfect bokeh circles, as always – but I wanted a more realistic, imperfect photographical look. Adding a virtual aperture with arbitrary-shaped holes is a well-known technique to manipulate the shape of bokeh circles, but this works more like a mask and wasn't enough for me.

Since bokeh is a direct result of the optical system that was used to make a photo, the bokeh can be manipulated in a path tracer such as Cycles, by creating actual lens elements in front of the virtual camera. However, some knowledge about optical design is required to get functioning constructions.

With the help of OpticalRayTracer, I built a lens design that produces a focussed area in the middle of the picture, but has a strong blur in the outer areas. The bokeh produced by this construction is far from perfect, but it adds a strong artistic effect to the image – which was my ultimate goal.

This approach currently has these problems:

  • Hard to construct and control. Basic knowledge about optical design becomes mandatory.
  • Longer render times.
  • Not all optical abberations can be simulated in Cycles, since it doesn't support wavelength tracing (i.e. no chromatic abberation), but it might work in Physically Based Renderers that support it.
  • Have to deal with the same optical problems (i.e. pincushion distortion, coma etc.) as in reality.