A pass that clears the input buffer or the screen.

Hierarchy (view full)

Constructors

  • Constructs a new clear pass.

    Parameters

    • Optionalcolor: boolean

      Determines whether the color buffer should be cleared.

    • Optionaldepth: boolean

      Determines whether the depth buffer should be cleared.

    • Optionalstencil: boolean

      Determines whether the stencil buffer should be cleared.

    Returns ClearPass

Properties

camera: Camera

The camera.

color: boolean

Indicates whether the color buffer should be cleared.

Use setClearFlags() instead.

depth: boolean

Indicates whether the depth buffer should be cleared.

Use setClearFlags() instead.

enabled: boolean

Indicates whether this pass is enabled.

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.

overrideClearAlpha: number

An override clear alpha. Default is -1.

overrideClearColor: Color

An override clear color. Default is null.

renderer: WebGLRenderer

The renderer.

scene: Scene

The scene to render.

stencil: boolean

Indicates whether the stencil buffer should be cleared.

Use setClearFlags() instead.

Accessors

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

    Use fullscreenMaterial instead.

  • Returns the override clear alpha. Default is -1.

    Returns number

    The clear alpha.

    Use overrideClearAlpha instead.

  • Returns the override clear color. Default is null.

    Returns Color

    The clear color.

    Use overrideClearColor 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 this pass is enabled.

    Returns boolean

    Whether this pass is enabled.

    Use enabled instead.

  • Clears the input buffer or the screen.

    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.

    • OptionaldeltaTime: number

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

    • OptionalstencilTest: boolean

      Indicates whether a stencil mask is active.

    Returns void

  • Sets the clear flags.

    Parameters

    • color: boolean

      Whether the color buffer should be cleared.

    • depth: boolean

      Whether the depth buffer should be cleared.

    • stencil: boolean

      Whether the stencil buffer should be cleared.

    Returns void

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

    • OptionaldepthPacking: DepthPackingStrategies

      The depth packing.

    Returns void

  • Enables or disables this pass.

    Parameters

    • value: boolean

      Whether the pass should be enabled.

    Returns void

    Use enabled instead.

  • Protected

    Sets the fullscreen material.

    Parameters

    • value: Material

      A fullscreen material.

    Returns void

    Use fullscreenMaterial instead.

  • Sets the override clear alpha.

    Parameters

    • value: number

      The clear alpha.

    Returns void

    Use overrideClearAlpha instead.

  • Sets the override clear color.

    Parameters

    • value: Color

      The clear color.

    Returns void

    Use overrideClearColor instead.

  • Sets the renderer

    Parameters

    • renderer: WebGLRenderer

      The renderer.

    Returns void

  • 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