Skip to content

RenderTarget

ts
type RenderTarget = {
  framebuffer: WebGLFramebuffer;
  texture: WebGLTexture;
  width: number;
  height: number;
  setSize: (width: number, height: number) => void;
};

A render target (FrameBuffer Object) for offscreen rendering.

Use it with any kind of render pass with pass.setTarget(renderTarget) or as a parameter of the render function, to render offscreen and use the resulting texture in subsequent passes or for readback.

Properties

PropertyTypeDescription
framebufferWebGLFramebufferThe underlying WebGL framebuffer.
textureWebGLTextureThe texture attached to the framebuffer.
widthnumberCurrent width of the target.
heightnumberCurrent height of the target.
setSize(width: number, height: number) => voidResizes the render target.

Released under the MIT License.