Home Reference Source
import {BokehMaterial} from 'postprocessing'
public class | source

BokehMaterial

Extends:

three~ShaderMaterial → BokehMaterial

Implements:

A bokeh disc blur material.

This material should be applied twice in a row, with fill mode enabled for the second pass. Enabling the foreground option causes the shader to combine the near and far CoC values around foreground objects.

Constructor Summary

Public Constructor
public

constructor(fill: Boolean, foreground: Boolean)

Constructs a new bokeh material.

Member Summary

Public Members
public set

cocBuffer: Texture

The circle of confusion buffer.

public set

inputBuffer: Texture

The input buffer.

public get

The blur scale.

public set

Method Summary

Public Methods
public

getScale(value: *): Number

this method was deprecated. Use scale instead.

Returns the blur scale.

public

setCoCBuffer(value: Texture)

this method was deprecated. Use cocBuffer instead.

Sets the circle of confusion buffer.

public

setInputBuffer(value: Texture)

this method was deprecated. Use inputBuffer instead.

Sets the input buffer.

public

setScale(value: Number)

this method was deprecated. Use scale instead.

Sets the blur scale.

public

setSize(width: Number, height: Number)

Sets the size of this object.

public
this method was deprecated. Use setSize() instead.

Sets the texel size.

Public Constructors

public constructor(fill: Boolean, foreground: Boolean) source

Constructs a new bokeh material.

Params:

NameTypeAttributeDescription
fill Boolean
  • optional
  • default: false

Enables or disables the bokeh highlight fill mode.

foreground Boolean
  • optional
  • default: false

Determines whether this material will be applied to foreground colors.

Public Members

public set cocBuffer: Texture source

The circle of confusion buffer.

public set inputBuffer: Texture source

The input buffer.

public get scale: Number source

The blur scale.

public set scale source

Public Methods

public getScale(value: *): Number source

this method was deprecated. Use scale instead.

Returns the blur scale.

Params:

NameTypeAttributeDescription
value *

Return:

Number

The scale.

public setCoCBuffer(value: Texture) source

this method was deprecated. Use cocBuffer instead.

Sets the circle of confusion buffer.

Params:

NameTypeAttributeDescription
value Texture

The buffer.

public setInputBuffer(value: Texture) source

this method was deprecated. Use inputBuffer instead.

Sets the input buffer.

Params:

NameTypeAttributeDescription
value Texture

The buffer.

public setScale(value: Number) source

this method was deprecated. Use scale instead.

Sets the blur scale.

Params:

NameTypeAttributeDescription
value Number

The scale.

public setSize(width: Number, height: Number) source

Sets the size of this object.

Params:

NameTypeAttributeDescription
width Number

The width.

height Number

The height.

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

this method was deprecated. Use setSize() instead.

Sets the texel size.

Params:

NameTypeAttributeDescription
x Number

The texel width.

y Number

The texel height.