Thin Lense Camera

The thin lense camera model achieves a good representation of an actual photograph. With a real camera there is always a lense which focuses the light at a certain focal point. This lense can only focus objects at a certain distance. For the same reason humans eyes need to adapt depending on the distance of the object of interest. As a lense can not focus perfectly on every part of an image at once, the parts that are not roughly on our plane of focus will appear blurry.

The Thin Lense Camera essentially simulates this effect by sampling multiple times with some variance that is proportional to the distance of the object and the plane of focus. For this we have two parameters:

  • The focal distance which defines the distance at which we want the objects to be perfectly sharp
  • The aperture, which essentially defines the variance

To generate a ray in this camera model which is casted for pixel (x,y) we first cast a ray starting at the film plane at the corresponding pixel position going through the middle of our lense. This ray will then intersect our plane of focus. We then generate a new ray that originates somewhere on our lense (the radius of our lense is defined by the aperture). We know that the image should be perfectly sharp at our plane of focus, which means that the ray should go through the same point on this plane as the ray we generated previously. With this information we determine the direction of the second ray, which is then used for all the upcoming steps in our ray tracer.

Thin Lense Off Thin Lense On

In the vase model is from Seatla Morake, however our renderer does not support the bsdfs applied so they are just black, still, they show the effect pretty well.

For this lense model to good look it may need a higher amount of samples, as for the correct blurr we want to sample multiple different points for every pixel. With one sample most pixels would essentially just be offset in a random direction.

In Lightwave we normally use fov instead of focal length to define the span of our image. Which makes the implementation from sources like PBRT a bit more confusing, but actually, this does not really matter to much if we just use the fov to define the size of our film plane and take a focal distance of 1 like in lightwaves conventions.