Framebuffer
Hierarchy
- Framebuffer
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
Parameters
options: FramebufferOptions
Returns Framebuffer
Properties
publicreadonlybufferFormat
Format compatible with the canvas drawing buffer, needed for Framebuffer.blitToScreen
publicreadonlyfiltering
publicreadonlytransparency
publicreadonlywrapping
Accessors
publicglFramebuffer
The framebuffer to bind when drawing into this framebuffer.
On a MultisampleFramebuffer this is the multisampled renderbuffer framebuffer.
Returns WebGLFramebuffer
publicheight
Returns number
publictexelSize
[1 / width, 1 / height], useful for passing to shaders that sample neighboring texels (blurs etc.)Returns [texelWidth: number, texelHeight: number]
publictexture
The color texture backing this framebuffer, for sampling as a source.
On a MultisampleFramebuffer reading this resolves the MSAA renderbuffer first.
Returns WebGLTexture
publicwidth
Returns number
Methods
publicblitToScreen
Blits the (resolved) contents 1:1 to the canvas drawing buffer
Returns void
publicclear
Clears the framebuffer to the provided color (transparent black by default)
Leaves this framebuffer bound
Parameters
optionalcolor: Color
Returns void
publiccopyToTexture
Copies the current (resolved) contents into the provided texture, which is reallocated at this framebuffer's dimensions
Parameters
texture: WebGLTexture
Returns void
publicdispose
Deletes the GL resources owned by this framebuffer, it cannot be used afterwards
Returns void
publicresize
Resize the framebuffer, contents are discarded
Parameters
width: number
height: number
Returns void
A texture-backed WebGL framebuffer that is both a render destination and a texture source.
Draw into it by passing it as the
destinationof a ShaderPass.draw (or any consumer of Framebuffer.glFramebuffer), sample from it by passing it as asource(or reading Framebuffer.texture). There is no implicit bind/unbind protocol to sequence.Contents are premultiplied alpha, matching the rest of the Excalibur WebGL pipeline.