Skip to main content

MultisampleFramebuffer

A Framebuffer backed by a multisampled renderbuffer.

Drawing goes into the MSAA renderbuffer (Framebuffer.glFramebuffer); reading Framebuffer.texture (or blitting/copying) resolves the samples into the backing color texture first, so consumers never need to sequence the resolve themselves.

Hierarchy

Index

Constructors

constructor

Properties

publicreadonlyinheritedbufferFormat

bufferFormat: number

Format compatible with the canvas drawing buffer, needed for Framebuffer.blitToScreen

publicreadonlyinheritedfiltering

filtering: ImageFiltering

publicreadonlysamples

samples: number

publicreadonlyinheritedtransparency

transparency: boolean

publicreadonlyinheritedwrapping

Accessors

publicglFramebuffer

  • get glFramebuffer(): WebGLFramebuffer
  • The framebuffer to bind when drawing into this framebuffer.

    On a MultisampleFramebuffer this is the multisampled renderbuffer framebuffer.


    Returns WebGLFramebuffer

publicinheritedheight

  • get height(): number
  • Returns number

publicinheritedtexelSize

  • get texelSize(): [texelWidth: number, texelHeight: number]
  • [1 / width, 1 / height], useful for passing to shaders that sample neighboring texels (blurs etc.)


    Returns [texelWidth: number, texelHeight: number]

publictexture

  • get texture(): WebGLTexture
  • The color texture backing this framebuffer, for sampling as a source.

    On a MultisampleFramebuffer reading this resolves the MSAA renderbuffer first.


    Returns WebGLTexture

publicinheritedwidth

  • get width(): number
  • Returns number

Methods

publicblitToScreen

  • blitToScreen(): void
  • Blits the (resolved) contents 1:1 to the canvas drawing buffer


    Returns void

publicinheritedclear

  • clear(color?: Color): void
  • Clears the framebuffer to the provided color (transparent black by default)

    Leaves this framebuffer bound


    Parameters

    Returns void

publicinheritedcopyToTexture

  • copyToTexture(texture: WebGLTexture): void
  • Copies the current (resolved) contents into the provided texture, which is reallocated at this framebuffer's dimensions


    Parameters

    • texture: WebGLTexture

    Returns void

publicdispose

  • dispose(): void
  • Deletes the GL resources owned by this framebuffer, it cannot be used afterwards


    Returns void

publicresize

  • resize(width: number, height: number): void
  • Resize the framebuffer, contents are discarded


    Parameters

    • width: number
    • height: number

    Returns void