Class RenderPass

A pass that renders a given scene into the input buffer or to screen.

This pass uses a ClearPass to clear the target buffer.

Hierarchy (view full)

Constructors

  • Constructs a new render pass.

    Parameters

    • Optional scene: Scene

      The scene to render.

    • Optional camera: Camera

      The camera to use to render the scene.

    • Optional overrideMaterial: Material

      An override material.

    Returns RenderPass

Properties

camera: Camera

The camera.

clearPass: ClearPass

A clear pass.

enabled: boolean

Indicates whether this pass is enabled.

ignoreBackground: boolean

Indicates whether the scene background should be ignored.

name: string

The name of this pass.

needsDepthTexture: boolean

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.

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.

renderer: WebGLRenderer

The renderer.

Deprecated

scene: Scene

The scene to render.

selection: Selection

A selection of objects to render.

skipShadowMapUpdate: boolean

Indicates whether the shadow map auto update should be skipped.

Accessors

  • get clear(): boolean
  • Indicates whether the target buffer should be cleared before rendering.

    Returns boolean

    Deprecated

    Use clearPass.enabled instead.

  • set clear(arg): void
  • Parameters

    • arg: boolean

    Returns void

  • get fullscreenMaterial(): Material
  • The fullscreen material.

    Returns Material

  • set fullscreenMaterial(arg): void
  • Parameters

    • arg: Material

    Returns void

  • set mainCamera(arg): void
  • Sets the main camera.

    Parameters

    • arg: Camera

    Returns void

  • set mainScene(arg): void
  • Sets the main scene.

    Parameters

    • arg: Scene

    Returns void

  • get overrideMaterial(): Material
  • The current override material.

    Returns Material

  • set overrideMaterial(arg): void
  • Parameters

    • arg: Material

    Returns void

  • get renderToScreen(): boolean
  • Indicates whether this pass should render to screen.

    Returns boolean

  • set renderToScreen(arg): void
  • Sets the render to screen flag.

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

    Parameters

    • arg: boolean

    Returns void

Methods

  • 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.

    Returns void

  • Returns the clear pass.

    Returns ClearPass

    The clear pass.

    Deprecated

    Use clearPass.enabled instead.

  • Returns the current depth texture.

    Returns Texture

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

  • Returns the current fullscreen material.

    Returns Material

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

    Deprecated

    Use fullscreenMaterial instead.

  • Returns the current override material.

    Returns Material

    The material.

    Deprecated

    Use overrideMaterial instead.

  • Returns the selection. Default is null (no restriction).

    Returns Selection

    The selection.

    Deprecated

    Use selection instead.

  • Performs initialization tasks.

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

    Parameters

    • renderer: WebGLRenderer

      The renderer.

    • alpha: boolean

      Whether the renderer uses the alpha channel or not.

    • frameBufferType: number

      The type of the main frame buffers.

    Returns void

  • Indicates whether the scene background is disabled.

    Returns boolean

    Whether the scene background is disabled.

    Deprecated

    Use ignoreBackground instead.

  • Indicates whether this pass is enabled.

    Returns boolean

    Whether this pass is enabled.

    Deprecated

    Use enabled instead.

  • Indicates whether the shadow map auto update is disabled.

    Returns boolean

    Whether the shadow map update is disabled.

    Deprecated

    Use skipShadowMapUpdate instead.

  • Renders the scene.

    Parameters

    • renderer: WebGLRenderer

      The renderer.

    • inputBuffer: WebGLRenderTarget<Texture>

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

    • outputBuffer: WebGLRenderTarget<Texture>

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

    • Optional deltaTime: number

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

    • Optional stencilTest: boolean

      Indicates whether a stencil mask is active.

    Returns void

  • Enables or disables the scene background.

    Parameters

    • value: boolean

      Whether the scene background should be disabled.

    Returns void

    Deprecated

    Use ignoreBackground instead.

  • 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.

    Parameters

    • depthTexture: Texture

      A depth texture.

    • Optional depthPacking: DepthPackingStrategies

      The depth packing.

    Returns void

  • Enables or disables this pass.

    Parameters

    • value: boolean

      Whether the pass should be enabled.

    Returns void

    Deprecated

    Use enabled instead.

  • Protected

    Sets the fullscreen material.

    Parameters

    • value: Material

      A fullscreen material.

    Returns void

    Deprecated

    Use fullscreenMaterial instead.

  • Sets the override material.

    Parameters

    • value: Material

      The material.

    Returns void

    Deprecated

    Use overrideMaterial instead.

  • Sets the renderer

    Parameters

    • renderer: WebGLRenderer

      The renderer.

    Returns void

    Deprecated

  • Sets the selection. Set to null to disable.

    Parameters

    • value: Selection

      The selection.

    Returns void

    Deprecated

    Use selection instead.

  • Enables or disables the shadow map auto update.

    Parameters

    • value: boolean

      Whether the shadow map auto update should be disabled.

    Returns void

    Deprecated

    Use skipShadowMapUpdate instead.

  • 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.

    Parameters

    • width: number

      The width.

    • height: number

      The height.

    Returns void