import {RealisticBokehMaterial} from 'postprocessing/src/materials/RealisticBokehMaterial.js'
RealisticBokehMaterial
Extends:
Depth of Field shader v2.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. |
Member Summary
Public Members | ||
public |
|
Method Summary
Public Methods | ||
public |
adoptCameraSettings(camera: PerspectiveCamera) Adopts the near and far plane and the focal length of the given camera. |
|
public |
setManualDepthOfFieldEnabled(enabled: Boolean) Defines whether manual Depth of Field should be enabled. |
|
public |
setNoiseEnabled(enabled: Boolean) Defines whether the dithering should compute noise. |
|
public |
setPentagonEnabled(enabled: Boolean) Defines whether the pentagonal blur effect should be enabled. |
|
public |
setShaderFocusEnabled(enabled: Boolean) Enables or disables the automatic shader focus. |
|
public |
setShowFocusEnabled(enabled: Boolean) Defines whether the focus should be shown. |
|
public |
setTexelSize(x: Number, y: Number) Sets the texel size. |
|
public |
setVignetteEnabled(enabled: Boolean) Defines whether the Vignette effect should be enabled. |
Public Constructors
public constructor(camera: PerspectiveCamera, options: Object) source
Constructs a new bokeh2 material.
Params:
Name | Type | Attribute | Description |
camera | PerspectiveCamera |
|
The main camera. |
options | Object |
|
Additional options. |
options.texelSize | Vector2 |
|
The absolute screen texel size. |
options.rings | Boolean |
|
The number of blurring iterations. |
options.samples | Boolean |
|
The amount of samples taken per ring. |
options.showFocus | Boolean |
|
Whether the focus point should be highlighted. |
options.manualDoF | Boolean |
|
Enables manual depth of field blur. |
options.vignette | Boolean |
|
Enables a vignette effect. |
options.pentagon | Boolean |
|
Enable to use a pentagonal shape to scale gathered texels. |
options.shaderFocus | Boolean |
|
Disable if you compute your own focalDepth (in metres!). |
options.noise | Boolean |
|
Disable if you don't want noise patterns for dithering. |
options.maxBlur | Number |
|
The maximum blur strength. |
options.luminanceThreshold | Number |
|
A luminance threshold. |
options.luminanceGain | Number |
|
A luminance gain factor. |
options.bias | Number |
|
A blur bias. |
options.fringe | Number |
|
A blur offset. |
options.ditherStrength | Number |
|
The dither strength. |
Public Methods
public adoptCameraSettings(camera: PerspectiveCamera) source
Adopts the near and far plane and the focal length of the given camera.
Params:
Name | Type | Attribute | Description |
camera | PerspectiveCamera | The main camera. |
public setManualDepthOfFieldEnabled(enabled: Boolean) source
Defines whether manual Depth of Field should be enabled.
Params:
Name | Type | Attribute | Description |
enabled | Boolean | Whether manual DoF should be enabled. |
public setNoiseEnabled(enabled: Boolean) source
Defines whether the dithering should compute noise.
Params:
Name | Type | Attribute | Description |
enabled | Boolean | Whether noise-based dithering should be enabled. |
public setPentagonEnabled(enabled: Boolean) source
Defines whether the pentagonal blur effect should be enabled.
Params:
Name | Type | Attribute | Description |
enabled | Boolean | Whether the pentagonal blur effect should be enabled. |
public setShaderFocusEnabled(enabled: Boolean) source
Enables or disables the automatic shader focus.
Params:
Name | Type | Attribute | Description |
enabled | Boolean | Whether the shader focus should be enabled. |
public setShowFocusEnabled(enabled: Boolean) source
Defines whether the focus should be shown.
Params:
Name | Type | Attribute | Description |
enabled | Boolean | True if the focus should be shown, false otherwise. |