Class Framebuffer

A data structure that organizes the memory resources that are needed to render an image.

Hierarchy

  • Framebuffer

Constructors

Properties

colorAttachments: FramebufferAttachment[]

A list of color attachments on this framebuffer.

context: Context

The rendering context of this framebuffer.

depthAttachmentPrivate?: FramebufferAttachment

The depth attachment on this framebuffer.

depthStencilAttachmentPrivate?: FramebufferAttachment

The depth stencil attachment on this framebuffer.

internal: WebGLFramebuffer

The WebGL API interface of this framebuffer.

stencilAttachmentPrivate?: FramebufferAttachment

The stencil attachment on this framebuffer.

The target binding point of this framebuffer.

Accessors

Methods

  • Attaches a texture to this framebuffer.

    Parameters

    • attachment: Mipmap<Mip>

      The texture to attach.

    • attachmentPoint: number

      The attachment point of the texture.

    Returns void

  • Attaches a single layer of a texture to this framebuffer.

    Parameters

    • attachment: Mip

      The texture to attach.

    • attachmentPoint: number

      The attachment point of the texture.

    • Optional layer: number

      The layer of the texture to attach.

    Returns void

  • Attaches a renderbuffer to this framebuffer.

    Parameters

    • attachment: Renderbuffer

      The renderbuffer to attach.

    • attachmentPoint: number

      The attachment point of the renderbuffer.

    Returns void

  • Executes the given function with this framebuffer bound, then re-binds the previously-bound framebuffer.

    Type Parameters

    • T

    Parameters

    • f: ((framebuffer) => T)

      The function to execute.

        • (framebuffer): T
        • Parameters

          Returns T

    Returns T

    The return value of the executed function.

  • Binds a framebuffer to a binding point.

    Parameters

    • context: Context

      The rendering context of the framebuffer.

    • target: FramebufferTarget

      The target binding point.

    • framebuffer: null | WebGLFramebuffer

      The framebuffer.

    Returns void

  • Gets the internal representation of the currently-bound framebuffer.

    Parameters

    • context: Context

      The context that the framebuffer is bound to.

    • target: FramebufferTarget

      The target that the framebuffer is bound to.

    Returns null | WebGLFramebuffer

    The currently-bound framebuffer.

  • Sets the drawing buffer array.

    Parameters

    • context: Context

      The rendering context.

    • none: boolean

      Whether to not render to any attachment.

    • back: boolean

      Whether to render to the back buffer.

    • colorAttachments: number[]

      A list of color attachments to render to.

    Returns void

  • Sets the read buffer to none.

    Parameters

    • context: Context

      The rendering context.

    Returns void

  • Sets the read buffer to the back buffer.

    Parameters

    • context: Context

      The rendering context.

    • back: boolean

      Whether to read from the back buffer.

    Returns void

  • Sets the read buffer to a color buffer.

    Parameters

    • context: Context

      The rendering context.

    • colorBuffer: number

      The color attachment to read from.

    Returns void

Generated using TypeDoc