A newer version of Max is available. Click here to access the latest version of the documentation

jit.gl.asyncread Reference

Read back from an OpenGL framebuffer

jit.gl.asyncread

Description

Uses Pixel Buffer Objects (PBOs) to perform asynchronous reads of the OpenGL context at high framerates. The performance gain comes from using two pixel buffer objects in tandem to amortize the cost of the read operation over time without blocking other rendering commands from executing as is typically the case when naive methods are used.

Examples

Discussion

This object requires one argument: the name of a drawing context. A named drawing context is a named instance of a jit.window, jit.pwindow, or jit.matrix object that has an instance of the jit.gl.render object associated with it. Additionally it can reference the name of a jit.gl.node sub-context. This value may also be set via the OB3D drawto attribute. If no argument is present, the object is implicitly added to the first valid drawing context or sub-context found in the current patch or by searching up the patcher hierarchy.

Arguments

None.

Attributes

matrixoutput [int]

Output a copy of the frame buffer (OpenGL render context). The output matrix dimensions adapt to the size of the window.

mode [symbol]

Sets the reading mode (default = interleaved).

Possible values:

'interleaved' ( Reads an entire frame into each internal buffer, switching buffers every other frame. In interleaved mode, the readback is delayed for one frame. )
'split' ( Reads a single frame in two passes and the output is concurrent. )

out_name [symbol]

g/s(get)

Returns the name of the internal frame buffer (OpenGL render context).

texture [symbol]

Sets the name of the texture to readback. If not set, the readback is performed on the the drawto context.

Common Box Attributes

OB3D Attributes

Messages

OB3D Messages

See Also

Name Description
Working with OpenGL Working with OpenGL
jit.gl.node
jit.gl.pix
jit.gl.slab
jit.gl.videoplane
jit.world