Skip to content

setRenderTarget() ​

ts
function setRenderTarget(
  gl: WebGL2RenderingContext,
  target: RenderTarget | null,
  clear?: boolean,
): void;

Sets the current render target for the WebGL context.

Parameters ​

gl ​

WebGL2RenderingContext

The WebGL2 context.

target ​

RenderTarget | null

The render target to bind. If null, binds the canvas (default framebuffer).

clear? ​

boolean = true

Whether to clear the color and depth buffers after binding.

Returns ​

void

Released under the MIT License.