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

ShaderPass

Extends:

Pass → ShaderPass

Indirect Implements:

A shader pass.

Renders any shader material as a fullscreen effect. If you want to create multiple chained effects, please use EffectPass instead.

Constructor Summary

Public Constructor
public

constructor(material: ShaderMaterial, input: String)

Constructs a new shader pass.

Member Summary

Public Members
public
public

The name of the input buffer uniform.

Method Summary

Public Methods
public

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

Performs initialization tasks.

public

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

Renders the effect.

public

setInput(input: String)

this method was deprecated. Use input instead.

Sets the name of the input buffer uniform.

Inherited Summary

From class Pass
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 get

Sets the render to screen flag.

public set
public

Indicates whether this pass is enabled.

public

The name of this pass.

public

Only relevant for subclassing.

public

Only relevant for subclassing.

protected

camera: Camera

The camera.

protected

renderer: WebGLRenderer

this member was deprecated.

The renderer.

protected

scene: Scene

The scene to render.

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

setFullscreenMaterial(value: Material)

this method was deprecated. Use fullscreenMaterial instead.

Sets the fullscreen material.

Public Constructors

public constructor(material: ShaderMaterial, input: String) source

Constructs a new shader pass.

Override:

Pass#constructor

Params:

NameTypeAttributeDescription
material ShaderMaterial

A shader material.

input String
  • optional
  • default: "inputBuffer"

The name of the input buffer uniform.

Public Members

public fullscreenMaterial: * source

The fullscreen material.

Override:

Pass#fullscreenMaterial

public input: String source

The name of the input buffer uniform.

Most fullscreen materials modify texels from an input texture. This pass automatically assigns the main input buffer to the uniform identified by the input name.

Public Methods

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

Performs initialization tasks.

Override:

Pass#initialize

Params:

NameTypeAttributeDescription
renderer WebGLRenderer

A renderer.

alpha Boolean

Whether the renderer uses the alpha channel.

frameBufferType Number

The type of the main frame buffers.

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

Renders the effect.

Override:

Pass#render

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.

public setInput(input: String) source

this method was deprecated. Use input instead.

Sets the name of the input buffer uniform.

Params:

NameTypeAttributeDescription
input String

The name of the input buffer uniform.