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

Bokeh2Material

Extends:

three~ShaderMaterial → Bokeh2Material

Depth of Field shader version 2.4.

Original shader code by Martins Upitis: http://blenderartists.org/forum/showthread.php?237488-GLSL-depth-of-field-with-bokeh-v2-4-(update)

Constructor Summary

Public Constructor
public

constructor(camera: PerspectiveCamera, options: Object)

Constructs a new bokeh2 material.

Method Summary

Public Methods
public

adoptCameraSettings(camera: PerspectiveCamera)

Adopts the near and far plane and the focal length of the given camera.

public

Sets the texel size.

Public Constructors

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

Constructs a new bokeh2 material.

Params:

NameTypeAttributeDescription
camera PerspectiveCamera
  • optional

The main camera.

options Object
  • optional

Additional options.

options.texelSize Vector2
  • optional

The absolute screen texel size.

options.showFocus Boolean
  • optional
  • default: false

Whether the focus point should be highlighted.

options.manualDoF Boolean
  • optional
  • default: false

Enables manual depth of field blur.

options.vignette Boolean
  • optional
  • default: false

Enables a vignette effect.

options.pentagon Boolean
  • optional
  • default: false

Enable to use a pentagonal shape to scale gathered texels.

options.shaderFocus Boolean
  • optional
  • default: true

Disable if you compute your own focalDepth (in metres!).

options.noise Boolean
  • optional
  • default: true

Disable if you don't want noise patterns for dithering.

Public Methods

public adoptCameraSettings(camera: PerspectiveCamera) source

Adopts the near and far plane and the focal length of the given camera.

Params:

NameTypeAttributeDescription
camera PerspectiveCamera

The main camera.

public setTexelSize(x: Number, y: Number) source

Sets the texel size.

Params:

NameTypeAttributeDescription
x Number

The texel width.

y Number

The texel height.