

Light-point is projected to is clearly visible as no other information overlaps with it. Notice that in the lower part of the image there is generally very little light.

It is this effect that is commonly known as bokeh. As a result the disk that this bright point is being projected to The film-plane without overlapping other information. However if the image is mostly dark and there are some bright points these bright points are being projected onto

While the circle of confusion results in a blurry image in most scenes, as each pixel is getting information from many different parts of the scene As the aperture width of the field that is in focus most real lensesĪllow the user to reduce the lens radius by covering larger parts of the lens. This means that rather thanĬonsidering the plane of focus as an actual plane in most circumstances we can associate a region around Projected onto a single pixel on the film-plane rather than a single point. In practice we refer to a object as in focus if each point on the object is As all rays from a single point hit the same point in the scene all objectsĪppear to be in focus. The lens was infinitely small all rays would pass thorough it’s center and will notĬhange their direction. This depends on both the distance of the object as well as the size of the lens which is commonly Next we need to consider how large this disk appears on theįilm plane. In theĬase of the thin-lens model it would be imaged to a disk. Now we know that a point that does not lie on the plane of focus is imaged to a area on the film plane. Or if we reverse the logic a single point in the scene now contributes toĪ whole area on the film-plane instead of a single pixel.Īs each sample only considers a single position on the lens we need large number of samples per pixel in order toĪccurately consider all positions on the lens and thus possible different objects that may contribute to this single Parts of the object or even other objects. However if the object in the scene is not on the plane of focus different points on the lens may intersect with different Incoming rays are parallel to the z-axis und thus bundle in the focal point which as we defined earlier sets the Note that if the object distance is set to $ - \infty $ the focal distance is equal to the focal length. This dependency between the film-distance and the plane of focus is described by the gaussian lens Any point on that plane will be projected onto exactly a single This distance is described by the plane of focus. Lens instead of bundling rays that are infinitely far away we are know bundling rays from a finite distance away. However if we move the film-plane closer to the If the film-plane is placed at the focal-length we have effectively focused at objects Has a certain focal length, which describes where all rays that are parallel to the z-axis will bundle. What is bokeh ?Ĭonsider a simple lens and film-plane set-up as in the figure below.
BOKEH LENS FAIL CODE
The source code for this project can be found here besides theįile format integration all relevant code is found in “src/core/camera.h”. The method is straight forward and simple to implement an requires very little additional computation however it only considers the shape of the bokeh not it’s weight distribution. Here i propose a method to approximate the shape of the bokeh based on the position on the film plane. Modern raytracers such as pbrt, cylces or the blender render engine only provide a uniformly sampled disk shapedīokeh.

Some lenses are specifically designed to exhibit a certain shape and distribution of bokeh. Example image where the bokeh adds a artistic element to the image When this shape becomes visible on the image it is commonly referred Real lenses produce stunning images, some of which capitalize on the oddly shaped circle of confusion
