Class FramebufferSystem

System plugin to the renderer to manage framebuffers.

PIXI

Implements

Constructors

Properties

current: Framebuffer
hasMRT: boolean
managedFramebuffers: Framebuffer[]

A list of managed framebuffers.

renderer: Renderer
viewport: Rectangle
writeDepthTexture: boolean

Accessors

  • get size(): { height: number; width: number; x: number; y: number }
  • Get the size of the current width and height. Returns object with width and height values.

    Returns { height: number; width: number; x: number; y: number }

Methods

  • Bind a framebuffer.

    Parameters

    • Optionalframebuffer: Framebuffer
    • Optionalframe: Rectangle

      frame, default is framebuffer size

    • OptionalmipLevel: number

      optional mip level to set on the framebuffer - defaults to 0

    Returns void

  • Only works with WebGL2

    blits framebuffer to another of the same or bigger size after that target framebuffer is bound

    Fails with WebGL warning if blits multisample framebuffer to different size

    Parameters

    • Optionalframebuffer: Framebuffer

      by default it blits "into itself", from renderBuffer to texture.

    • OptionalsourcePixels: Rectangle

      source rectangle in pixels

    • OptionaldestPixels: Rectangle

      dest rectangle in pixels, assumed to be the same as sourcePixels

    Returns void

  • Clear the color of the context

    Parameters

    • r: number

      Red value from 0 to 1

    • g: number

      Green value from 0 to 1

    • b: number

      Blue value from 0 to 1

    • a: number

      Alpha value from 0 to 1

    • Optionalmask: BUFFER_BITS

      Bitwise OR of masks that indicate the buffers to be cleared, by default COLOR and DEPTH buffers.

    Returns void

  • Generic destroy methods to be overridden by the subclass

    Returns void

  • Disposes all framebuffers, but not textures bound to them.

    Parameters

    • OptionalcontextLost: boolean

      If context was lost, we suppress all delete function calls

    Returns void

  • Disposes framebuffer.

    Parameters

    • framebuffer: Framebuffer

      framebuffer that has to be disposed of

    • OptionalcontextLost: boolean

      If context was lost, we suppress all delete function calls

    Returns void

  • Resets framebuffer stored state, binds screen framebuffer. Should be called before renderTexture reset().

    Returns void

  • Set the WebGLRenderingContext's viewport.

    Parameters

    • x: number

      X position of viewport

    • y: number

      Y position of viewport

    • width: number

      Width of viewport

    • height: number

      Height of viewport

    Returns void