Class: Pass

Re-exported types from postprocessing

Hierarchy

Implements

  • Initializable
  • Resizable
  • Disposable

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Pass(name?, scene?, camera?)

Parameters

NameType
name?string
scene?Scene
camera?Camera

Inherited from

Initializable.constructor

Defined in

packages/three/types/postprocessing.d.ts:597

Properties

camera

Protected camera: Camera

The camera.

Defined in

packages/three/types/postprocessing.d.ts:612


enabled

enabled: boolean

Indicates whether this pass should be executed.

Defined in

packages/three/types/postprocessing.d.ts:637


name

name: string

The name of this pass.

Defined in

packages/three/types/postprocessing.d.ts:602


needsDepthTexture

needsDepthTexture: boolean

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.

Defined in

packages/three/types/postprocessing.d.ts:632


needsSwap

needsSwap: boolean

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.

Defined in

packages/three/types/postprocessing.d.ts:623


renderToScreen

renderToScreen: boolean

Indicates whether this pass should render to screen.

Defined in

packages/three/types/postprocessing.d.ts:642


scene

Protected scene: Scene

The scene to render.

Defined in

packages/three/types/postprocessing.d.ts:607

Methods

dispose

dispose(): void

Performs a shallow search for disposable properties and deletes them. The pass will be inoperative after this method was called!

Disposable objects:

  • WebGLRenderTarget
  • Material
  • Texture

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

Returns

void

Inherited from

Disposable.dispose

Defined in

packages/three/types/postprocessing.d.ts:745


getDepthTexture

getDepthTexture(): Texture

Returns the current depth texture.

Returns

Texture

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

Defined in

packages/three/types/postprocessing.d.ts:663


getFullscreenMaterial

getFullscreenMaterial(): Material

Returns the current fullscreen material.

Returns

Material

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

Defined in

packages/three/types/postprocessing.d.ts:648


initialize

initialize(renderer, alpha, frameBufferType): void

Performs initialization tasks.

By overriding this method you gain access to the renderer. You'll also be able to configure your custom render targets to use the appropriate format (RGB or RGBA).

The provided renderer can be used to warm up special off-screen render targets by performing a preliminary render operation.

The EffectComposer calls this method when this pass is added to its queue, but not before its size has been set.

example if(!alpha && frameBufferType === UnsignedByteType) { this.myRenderTarget.texture.format = RGBFormat; }

Parameters

NameTypeDescription
rendererWebGLRendererThe renderer.
alphabooleanWhether the renderer uses the alpha channel or not.
frameBufferTypenumberThe type of the main frame buffers.

Returns

void

Inherited from

Initializable.initialize

Defined in

packages/three/types/postprocessing.d.ts:726


render

render(renderer, inputBuffer, outputBuffer, deltaTime?, stencilTest?): void

Renders the effect.

This is an abstract method that must be overridden.

Parameters

NameTypeDescription
rendererWebGLRendererThe renderer.
inputBufferWebGLRenderTargetA frame buffer that contains the result of the previous pass.
outputBufferWebGLRenderTargetA frame buffer that serves as the output render target unless this pass renders to screen.
deltaTime?number-
stencilTest?boolean-

Returns

void

Defined in

packages/three/types/postprocessing.d.ts:685


setDepthTexture

setDepthTexture(depthTexture, depthPacking?): void

Sets the depth texture.

You may override this method if your pass relies on the depth information of a preceding RenderPass.

Parameters

NameTypeDescription
depthTextureTextureA depth texture.
depthPacking?number-

Returns

void

Defined in

packages/three/types/postprocessing.d.ts:673


setFullscreenMaterial

Protected setFullscreenMaterial(material): void

Sets the fullscreen material.

The material will be assigned to a mesh that fills the screen. The mesh will be created once a material is assigned via this method.

Parameters

NameTypeDescription
materialMaterialA fullscreen material.

Returns

void

Defined in

packages/three/types/postprocessing.d.ts:657


setSize

setSize(width, height): void

Updates this pass with the renderer's size.

You may override this method in case you want to be informed about the size of the main frame buffer.

The EffectComposer calls this method before this pass is initialized and every time its own size is updated.

example this.myRenderTarget.setSize(width, height);

Parameters

NameTypeDescription
widthnumberThe renderer's width.
heightnumberThe renderer's height.

Returns

void

Inherited from

Resizable.setSize

Defined in

packages/three/types/postprocessing.d.ts:706