Class OutlineEffect

An outline effect.

Hierarchy (view full)

Constructors

  • Constructs a new outline effect.

    Parameters

    • Optional scene: Scene

      The main scene.

    • Optional camera: Camera

      The main camera.

    • Optional options: {
          blendFunction?: BlendFunction;
          blur?: boolean;
          edgeStrength?: number;
          height?: number;
          hiddenEdgeColor?: number;
          kernelSize?: KernelSize;
          multisampling?: number;
          patternScale?: number;
          patternTexture?: Texture;
          pulseSpeed?: number;
          resolutionScale?: number;
          resolutionX?: number;
          resolutionY?: number;
          visibleEdgeColor?: number;
          width?: number;
          xRay?: boolean;
      }

      The options.

      • Optional blendFunction?: BlendFunction

        The blend function. Use BlendFunction.ALPHA for dark outlines.

      • Optional blur?: boolean

        Whether the outline should be blurred.

      • Optional edgeStrength?: number

        The edge strength.

      • Optional height?: number

        Deprecated. Use resolutionY instead.

      • Optional hiddenEdgeColor?: number

        The color of hidden edges.

      • Optional kernelSize?: KernelSize

        The blur kernel size.

      • Optional multisampling?: number

        The number of samples used for multisample antialiasing. Requires WebGL 2.

      • Optional patternScale?: number

        The pattern scale.

      • Optional patternTexture?: Texture

        A pattern texture.

      • Optional pulseSpeed?: number

        The pulse speed. A value of zero disables the pulse effect.

      • Optional resolutionScale?: number

        The resolution scale.

      • Optional resolutionX?: number

        The horizontal resolution.

      • Optional resolutionY?: number

        The vertical resolution.

      • Optional visibleEdgeColor?: number

        The color of visible edges.

      • Optional width?: number

        Deprecated. Use resolutionX instead.

      • Optional xRay?: boolean

        Whether occluded parts of selected objects should be visible.

    Returns OutlineEffect

Properties

blendMode: BlendMode

The blend mode of this effect.

blurPass: KawaseBlurPass

A blur pass.

defines: Map<string, string>

Preprocessor macro definitions.

Call Effect.setChanged after changing macro definitions.

extensions: Set<WebGLExtension>

WebGL extensions that are required by this effect.

Call Effect.setChanged after adding or removing extensions.

name: string

The name of this effect.

pulseSpeed: number

The pulse speed. Set to 0 to disable.

renderer: WebGLRenderer

The renderer.

Deprecated

selection: Selection

A selection of objects that will be outlined.

The default layer of this selection is 10.

uniforms: Map<string, Uniform<any>>

Shader uniforms.

Call Effect.setChanged after adding or removing uniforms.

Accessors

  • get blur(): boolean
  • Indicates whether the outlines should be blurred.

    Returns boolean

    Deprecated

    Use blurPass.enabled instead.

  • set blur(arg): void
  • Parameters

    • arg: boolean

    Returns void

  • get dithering(): boolean
  • Indicates whether dithering is enabled.

    Returns boolean

    Deprecated

  • set dithering(arg): void
  • Parameters

    • arg: boolean

    Returns void

  • get edgeStrength(): number
  • The edge strength.

    Returns number

  • set edgeStrength(arg): void
  • Parameters

    • arg: number

    Returns void

  • get height(): number
  • The current height of the internal render targets.

    Returns number

    Deprecated

    Use resolution.height instead.

  • set height(arg): void
  • Parameters

    • arg: number

    Returns void

  • get hiddenEdgeColor(): Color
  • The hidden edge color.

    Returns Color

  • set hiddenEdgeColor(arg): void
  • Parameters

    • arg: Color

    Returns void

  • get inputColorSpace(): ColorSpace
  • Experimental

    The input color space.

    Returns ColorSpace

  • set inputColorSpace(arg): void
  • Protected Experimental

    Parameters

    • arg: ColorSpace

    Returns void

  • get kernelSize(): KernelSize
  • The blur kernel size.

    Returns KernelSize

    Deprecated

    Use blurPass.kernelSize instead.

  • set kernelSize(arg): void
  • Parameters

    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 multisampling(): number
  • Experimental

    The amount of MSAA samples.

    Requires WebGL 2. Set to zero to disable multisampling.

    Requires three >= r138.

    Returns number

  • set multisampling(arg): void
  • Parameters

    • arg: number

    Returns void

  • get outputColorSpace(): ColorSpace
  • Experimental

    The output color space.

    Should only be changed if this effect converts the input colors to a different color space.

    Returns ColorSpace

  • set outputColorSpace(arg): void
  • Protected Experimental

    Parameters

    • arg: ColorSpace

    Returns void

  • get patternScale(): number
  • The pattern scale.

    Returns number

  • set patternScale(arg): void
  • Parameters

    • arg: number

    Returns void

  • get patternTexture(): Texture
  • The pattern texture. Set to null to disable.

    Returns Texture

  • set patternTexture(arg): void
  • Parameters

    • arg: Texture

    Returns void

  • get resolution(): Resolution
  • The resolution of this effect.

    Returns Resolution

  • get selectionLayer(): number
  • The selection layer.

    Returns number

    Deprecated

    Use selection.layer instead.

  • set selectionLayer(arg): void
  • Parameters

    • arg: number

    Returns void

  • get visibleEdgeColor(): Color
  • The visible edge color.

    Returns Color

  • set visibleEdgeColor(arg): void
  • Parameters

    • arg: Color

    Returns void

  • get width(): number
  • The current width of the internal render targets.

    Returns number

    Deprecated

    Use resolution.width instead.

  • set width(arg): void
  • Parameters

    • arg: number

    Returns void

  • get xRay(): boolean
  • Indicates whether X-ray mode is enabled.

    Returns boolean

  • set xRay(arg): void
  • Parameters

    • arg: boolean

    Returns void

Methods

  • Clears the list of selected objects.

    Returns OutlineEffect

    This pass.

    Deprecated

    Use selection.clear() instead.

  • Deselects an object.

    Parameters

    • object: Object3D<Object3DEventMap>

      The object that should no longer be outlined.

    Returns OutlineEffect

    This pass.

    Deprecated

    Use selection.delete() instead.

  • Performs a shallow search for properties that define a dispose method and deletes them.

    The EffectComposer calls this method when it is being destroyed.

    Returns void

  • Returns the blend mode.

    The result of this effect will be blended with the result of the previous effect using this blend mode.

    Returns BlendMode

    The blend mode.

    Deprecated

    Use blendMode instead.

  • Returns the preprocessor macro definitions.

    Returns Map<string, string>

    The extensions.

    Deprecated

    Use defines instead.

  • Returns the WebGL extensions that are required by this effect.

    Returns Set<WebGLExtension>

    The extensions.

    Deprecated

    Use extensions instead.

  • Returns the fragment shader.

    Returns string

    The fragment shader.

  • Returns the name of this effect.

    Returns string

    The name.

    Deprecated

    Use name instead.

  • Returns the pulse speed.

    Returns number

    The speed.

    Deprecated

    Use pulseSpeed instead.

  • Returns the resolution.

    Returns Resolution

    The resolution.

  • Returns the current resolution scale.

    Returns number

    The resolution scale.

    Deprecated

    Use resolution instead.

  • Returns the selection.

    Returns Selection

    The selection.

    Deprecated

    Use selection instead.

  • Returns the uniforms of this effect.

    Returns Map<string, Uniform<any>>

    The extensions.

    Deprecated

    Use uniforms instead.

  • Returns the vertex shader.

    Returns string

    The vertex shader.

  • Performs initialization tasks.

    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 X-ray mode is enabled.

    Returns boolean

    Whether X-ray mode is enabled.

    Deprecated

    Use xRay instead.

  • Selects an object.

    Parameters

    • object: Object3D<Object3DEventMap>

      The object that should be outlined.

    Returns OutlineEffect

    This pass.

    Deprecated

    Use selection.add() instead.

  • Protected

    Sets the effect attributes.

    Effects that have the same attributes will be executed in the order in which they were registered. Some attributes imply a higher priority.

    Parameters

    Returns void

  • Protected

    Informs the associated EffectPass that this effect requires a shader recompilation.

    Should be called after changing macros or extensions and after adding/removing uniforms.

    Returns void

  • Sets the depth texture.

    You may override this method if your effect requires direct access to the depth texture that is bound to the associated EffectPass.

    Parameters

    • depthTexture: Texture

      A depth texture.

    • Optional depthPacking: DepthPackingStrategies

      The depth packing.

    Returns void

  • Protected

    Sets the fragment shader.

    Parameters

    • fragmentShader: string

      The fragment shader.

    Returns void

  • Sets the pattern texture.

    Parameters

    • value: Texture

      The new texture.

    Returns void

    Deprecated

    Use patternTexture instead.

  • Sets the pulse speed. Set to zero to disable.

    Parameters

    • value: number

      The speed.

    Returns void

    Deprecated

    Use pulseSpeed instead.

  • Sets the renderer.

    Parameters

    • renderer: WebGLRenderer

      The renderer.

    Returns void

    Deprecated

  • Sets the resolution scale.

    Parameters

    • scale: number

      The new resolution scale.

    Returns void

    Deprecated

    Use resolution instead.

  • Clears the current selection and selects a list of objects.

    Parameters

    • objects: Object3D<Object3DEventMap>[]

      The objects that should be outlined. This array will be copied.

    Returns OutlineEffect

    This pass.

    Deprecated

    Use selection.set() instead.

  • Updates the size of internal render targets.

    Parameters

    • width: number

      The width.

    • height: number

      The height.

    Returns void

  • Protected

    Sets the vertex shader.

    Parameters

    • vertexShader: string

      The vertex shader.

    Returns void

  • Enables or disables X-ray outlines.

    Parameters

    • value: boolean

      Whether X-ray should be enabled.

    Returns void

    Deprecated

    Use xRay instead.

  • Updates this effect.

    Parameters

    • renderer: WebGLRenderer

      The renderer.

    • inputBuffer: WebGLRenderTarget<Texture>

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

    • Optional deltaTime: number

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

    Returns void