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

Pass

An abstract pass.

Fullscreen passes use a shared fullscreen triangle: https://michaldrobot.com/2014/04/01/gcn-execution-patterns-in-full-screen-passes/

Constructor Summary

Public Constructor
public

constructor(name: String, scene: Scene, camera: Camera)

Constructs a new pass.

Member Summary

Public Members
public

Indicates whether this pass is enabled.

public get

fullscreenMaterial: Material

The fullscreen material.

public set
public set

mainCamera: Camera

Sets the main camera.

public set

mainScene: Scene

Sets the main scene.

public

The name of this pass.

public

Only relevant for subclassing.

public

Only relevant for subclassing.

public get

Sets the render to screen flag.

public set
Protected Members
protected

camera: Camera

The camera.

protected

renderer: WebGLRenderer

this member was deprecated.

The renderer.

protected

scene: Scene

The scene to render.

Method Summary

Public Methods
public

Performs a shallow search for disposable properties and deletes them.

public

getDepthTexture(): Texture

Returns the current depth texture.

public

getFullscreenMaterial(): Material

this method was deprecated. Use fullscreenMaterial instead.

Returns the current fullscreen material.

public

initialize(renderer: WebGLRenderer, alpha: Boolean, frameBufferType: Number)

Performs initialization tasks.

public
this method was deprecated. Use enabled instead.

Indicates whether this pass is enabled.

public abstract

render(renderer: WebGLRenderer, inputBuffer: WebGLRenderTarget, outputBuffer: WebGLRenderTarget, deltaTime: Number, stencilTest: Boolean)

Renders this pass.

public

setDepthTexture(depthTexture: Texture, depthPacking: DepthPackingStrategy)

Sets the depth texture.

public
this method was deprecated. Use enabled instead.

Enables or disables this pass.

public

setRenderer(renderer: WebGLRenderer)

this method was deprecated.

Sets the renderer

public

setSize(width: Number, height: Number)

Sets the size.

Protected Methods
protected

setFullscreenMaterial(value: Material)

this method was deprecated. Use fullscreenMaterial instead.

Sets the fullscreen material.

Public Constructors

public constructor(name: String, scene: Scene, camera: Camera) source

Constructs a new pass.

Params:

NameTypeAttributeDescription
name String
  • optional

The name of this pass. Does not have to be unique.

scene Scene
  • optional

The scene to render. The default scene contains a single mesh that fills the screen.

camera Camera
  • optional

A camera. Fullscreen effect passes don't require a camera.

Public Members

public enabled: Boolean source

Indicates whether this pass is enabled.

public get fullscreenMaterial: Material source

The fullscreen material.

public set fullscreenMaterial source

public set mainCamera: Camera source

Sets the main camera.

public set mainScene: Scene source

Sets the main scene.

public name: String source

The name of this pass.

public needsDepthTexture: Boolean source

Only relevant for subclassing.

Indicates whether the EffectComposer should prepare a depth texture for this pass. Set this to true if this pass relies on depth information from a preceding RenderPass.

public needsSwap: Boolean source

Only relevant for subclassing.

Indicates whether the EffectComposer should swap the frame buffers after this pass has finished rendering. Set this to false if this pass doesn't render to the output buffer or the screen. Otherwise, the contents of the input buffer will be lost.

public get renderToScreen: Boolean source

Sets the render to screen flag.

If this flag is changed, the fullscreen material will be updated as well.

public set renderToScreen source

Protected Members

protected camera: Camera source

The camera.

protected renderer: WebGLRenderer source

this member was deprecated.

The renderer.

protected scene: Scene source

The scene to render.

Public Methods

public dispose() source

Performs a shallow search for disposable properties and deletes them.

The EffectComposer calls this method when it is being destroyed. You can use it independently to free memory when you're certain that you don't need this pass anymore.

public getDepthTexture(): Texture source

Returns the current depth texture.

Return:

Texture

The current depth texture, or null if there is none.

public getFullscreenMaterial(): Material source

this method was deprecated. Use fullscreenMaterial instead.

Returns the current fullscreen material.

Return:

Material

The current fullscreen material, or null if there is none.

public initialize(renderer: WebGLRenderer, alpha: Boolean, frameBufferType: Number) source

Performs initialization tasks.

This method is called when this pass is added to an EffectComposer.

Params:

NameTypeAttributeDescription
renderer WebGLRenderer

The renderer.

alpha Boolean

Whether the renderer uses the alpha channel or not.

frameBufferType Number

The type of the main frame buffers.

public isEnabled(): Boolean source

this method was deprecated. Use enabled instead.

Indicates whether this pass is enabled.

Return:

Boolean

Whether this pass is enabled.

public abstract render(renderer: WebGLRenderer, inputBuffer: WebGLRenderTarget, outputBuffer: WebGLRenderTarget, deltaTime: Number, stencilTest: Boolean) source

Renders this pass.

This is an abstract method that must be overridden.

Params:

NameTypeAttributeDescription
renderer WebGLRenderer

The renderer.

inputBuffer WebGLRenderTarget

A frame buffer that contains the result of the previous pass.

outputBuffer WebGLRenderTarget

A frame buffer that serves as the output render target unless this pass renders to screen.

deltaTime Number
  • optional

The time between the last frame and the current one in seconds.

stencilTest Boolean
  • optional

Indicates whether a stencil mask is active.

Throw:

Error

An error is thrown if the method is not overridden.

public setDepthTexture(depthTexture: Texture, depthPacking: DepthPackingStrategy) source

Sets the depth texture.

This method will be called automatically by the EffectComposer. You may override this method if your pass relies on the depth information of a preceding RenderPass.

Params:

NameTypeAttributeDescription
depthTexture Texture

A depth texture.

depthPacking DepthPackingStrategy
  • optional
  • default: BasicDepthPacking

The depth packing.

public setEnabled(value: Boolean) source

this method was deprecated. Use enabled instead.

Enables or disables this pass.

Params:

NameTypeAttributeDescription
value Boolean

Whether the pass should be enabled.

public setRenderer(renderer: WebGLRenderer) source

this method was deprecated.

Sets the renderer

Params:

NameTypeAttributeDescription
renderer WebGLRenderer

The renderer.

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

Sets the size.

You may override this method if you want to be informed about the size of the backbuffer/canvas. This method is called before initialize and every time the size of the EffectComposer changes.

Params:

NameTypeAttributeDescription
width Number

The width.

height Number

The height.

Protected Methods

protected setFullscreenMaterial(value: Material) source

this method was deprecated. Use fullscreenMaterial instead.

Sets the fullscreen material.

Params:

NameTypeAttributeDescription
value Material

A fullscreen material.