Class RenderTarget<TTexture>

JavaScript events for custom objects

// Adding events to a custom object
class Car extends EventDispatcher {
start() {
this.dispatchEvent( { type: 'start', message: 'vroom vroom!' } );
}
};
// Using events with the custom object
const car = new Car();
car.addEventListener( 'start', ( event ) => {
alert( event.message );
} );
car.start();

Type Parameters

Hierarchy (view full)

Constructors

Properties

isRenderTarget: true
width: number
height: number
depth: number
scissor: Vector4
scissorTest: boolean
false
viewport: Vector4
textures: TTexture[]
depthBuffer: boolean
true
stencilBuffer: boolean
false
resolveDepthBuffer: boolean

Defines whether the depth buffer should be resolved when rendering into a multisampled render target.

true
resolveStencilBuffer: boolean

Defines whether the stencil buffer should be resolved when rendering into a multisampled render target.
This property has no effect when .resolveDepthBuffer is set to false.

true
depthTexture: null | DepthTexture
null
samples: number

Defines the count of MSAA samples. Can only be used with WebGL 2. Default is 0.

0

Accessors

  • get texture(): TTexture
  • Returns TTexture

  • set texture(value): void
  • Parameters

    Returns void

Methods

  • Parameters

    • width: number
    • height: number
    • Optionaldepth: number

    Returns void

  • Returns this

  • Parameters

    Returns this

  • Returns void

  • Adds a listener to an event type.

    Type Parameters

    • T extends "dispose"

    Parameters

    Returns void

  • Type Parameters

    • T extends string

    Parameters

    Returns void

  • Checks if listener is added to an event type.

    Type Parameters

    • T extends "dispose"

    Parameters

    Returns boolean

  • Type Parameters

    • T extends string

    Parameters

    Returns boolean

  • Removes a listener from an event type.

    Type Parameters

    • T extends "dispose"

    Parameters

    Returns void

  • Type Parameters

    • T extends string

    Parameters

    Returns void

  • Fire an event type.

    Type Parameters

    • T extends "dispose"

    Parameters

    • event: BaseEvent<T> & {
          dispose: {};
      }[T]

      The event that gets fired.

    Returns void