Bokeh

Bokeh is another phenomenon related to the lens imperfection. In the world of photography, bokeh describes the way a lens handles out of focus regions. As we already have a way to blur out of focus pixels, we will be focusing on how bokeh handles very bright unfocused pixels. The following image shows how bokeh affects bright light sources that are out of focus:

Bokeh

As you can see, instead of getting blurred, the bright areas in the image form distinct shapes we will call bokeh highlights. This recipe will provide an easy way to render the bokeh highlights.

Getting ready

In this recipe we will accumulate the bokeh shape information into a buffer ...

Get HLSL Development Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.