me.WebGLRenderer.Compositor(renderer)

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

Extends

Members

static, readonly length :Number

The number of quads held in the batch

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

static clear()

Clear the frame buffer, flushes the composite operations and calls gl.clear()

static drawLine(points, lenopt, openopt)

Draw a line

Parameters:
Name Type Attributes Default Description
points Array.<me.Vector2d>

Line vertices

len Number <optional>
points.length

amount of points defined in the points array

open Boolean <optional>
false

Whether the line is open (true) or closed (false)

static drawTriangle(points, lenopt, stripopt)

Draw triangle(s)

Parameters:
Name Type Attributes Default Description
points Array.<me.Vector2d>

vertices

len Number <optional>
points.length

amount of points defined in the points array

strip Boolean <optional>
false

Whether the array defines a serie of connected triangles, sharing vertices

static flush()

Flush batched texture operations to the GPU

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

static useShader(shader)

Select the shader to use for compositing

Parameters:
Name Type Description
shader Object

a reference to a WebGL Shader Program

See: