Class: Compositor

me.WebGLRenderer. Compositor

new Compositor(renderer)

A WebGL texture Compositor object. This class handles all of the WebGL state
Pushes texture regions into WebGL buffers, automatically flushes to GPU
Parameters:
Name Type Description
renderer me.WebGLRenderer the current WebGL renderer session
Source:
compositor.js, line 32

Extends

Members

<static, readonly> length :Number

The number of quads held in the batch
Type:
  • Number
Source:
compositor.js, line 51

Methods

<static> addQuad(texture, key, x, y, w, h)

Add a textured quad
Parameters:
Name Type Description
texture me.video.renderer.Texture Source texture
key String Source texture region name
x Number Destination x-coordinate
y Number Destination y-coordinate
w Number Destination width
h Number Destination height
Source:
compositor.js, line 306

<static> clear()

Clear the frame buffer, flushes the composite operations and calls gl.clear()
Source:
compositor.js, line 527

<static> drawLine(points, open)

Draw a line
Parameters:
Name Type Argument Default Description
points Array.<me.Vector2d> Line vertices
open Boolean <optional>
false Whether the line is open (true) or closed (false)
Source:
compositor.js, line 443

<static> flush()

Flush batched texture operations to the GPU
Source:
compositor.js, line 412

<static> setProjection(w, h)

Sets the projection matrix with the given size
Parameters:
Name Type Description
w Number WebGL Canvas width
h Number WebGL Canvas height
Source:
compositor.js, line 199

<static> useShader(shader)

Select the shader to use for compositing
Parameters:
Name Type Description
shader WebGLProgram The shader program to use
Source:
compositor.js, line 291