Thinlens Camera & Custom Bokeh Shapes

To implement our Thinlens Camera model we followed this tutorial in the PBR-Book. For Custom Bokeh Shapes we load an optional texture for our aperture for which we then do rejection sampling based on the texture's luminance. The only real problems we encountered were that Pi2 is Pi/2 and not Pi*2 which lead to errors sampling points on our aperture and that we don't get the feature points for this because we can only use one camera for our scene 😔. Below you can see a few renders with a thinlens camera with equal focal length and increasing aperture size as well as some bokeh-tomfoolery.

Code:

  • src/cameras/thinlens.cpp
    aperture=0
    aperture=0.2
    aperture=0.5
    aperture=1
    regular bokeh
    star bokeh
    amogus bokeh
Spoiler: Implementation of this feature in our final render
    There is no Thinlens Camera in Ba Sing Se.