Class: FrameBuffer

FrameBuffer

FrameBuffer provides a render target associated with a given texture/textures.


new FrameBuffer(colorTextures, depthBuffer, cubeFace)

Parameters:
Name Type Description
colorTextures

Either a single texture, or an Array of textures (only if capabilities#EXT_DRAW_BUFFERS is supported).

depthBuffer

An optional depth buffer. This can be a WriteOnlyDepthBuffer or, if readback is required, a Texture2D (only available if capabilities#EXT_DEPTH_TEXTURE is supported).

cubeFace

If colorTextures is a TextureCube, cubeFace should contain the relevant CubeFace.

Author:
  • derschmale <http://www.derschmale.com>

Methods


init(silent)

Initializes the framebuffer object. This needs to be called whenever the Texture2D's are resized using initEmpty.

Parameters:
Name Type Description
silent

Whether or not warnings should be printed.


readPixels()

Retrieves pixel data from this FBO. Not recommended, as it can be slow.