Home Reference Source
import {BokehMaterial} from 'postprocessing/src/materials/BokehMaterial.js'
public class | source

BokehMaterial

Extends:

three~ShaderMaterial → BokehMaterial

Depth of Field shader (Bokeh).

Original shader code by Martins Upitis: http://artmartinsh.blogspot.com/2010/02/glsl-lens-blur-filter-with-bokeh.html

Constructor Summary

Public Constructor
public

constructor(camera: PerspectiveCamera, options: Object)

Constructs a new bokeh material.

Method Summary

Public Methods
public

adoptCameraSettings(camera: PerspectiveCamera)

Adopts the settings of the given camera.

Public Constructors

public constructor(camera: PerspectiveCamera, options: Object) source

Constructs a new bokeh material.

Params:

NameTypeAttributeDescription
camera PerspectiveCamera
  • optional

A camera.

options Object
  • optional

The options.

options.focus Number
  • optional
  • default: 1.0

The focus distance, corresponds directly with the scene depth.

options.dof Number
  • optional
  • default: 0.02

Depth of field. An area in front of and behind the focus point that still appears sharp.

options.aperture Number
  • optional
  • default: 0.025

Camera aperture scale. Bigger values for stronger blur and shallower depth of field.

options.maxBlur Number
  • optional
  • default: 1.0

Maximum blur strength.

Public Methods

public adoptCameraSettings(camera: PerspectiveCamera) source

Adopts the settings of the given camera.

Params:

NameTypeAttributeDescription
camera PerspectiveCamera
  • optional
  • default: null

A camera.