me.video.shader

The WebGL Shader singleton
There is no constructor function for me.video.shader

Methods

static createShader(gl, vertex, fragment) → {Object}

Create a shader program (with bindings) using the given GLSL sources

Parameters:
Name Type Description
gl WebGLContext

WebGL Context

vertex String

Vertex shader source

fragment String

Fragment shader source

Returns:
Object -

A reference to the WebGL Shader Program

static createTexture(gl, unit, image, filter, repeatopt, wopt, hopt, bopt, bopt, premultipliedAlphaopt) → {WebGLTexture}

Create a texture from an image

Parameters:
Name Type Attributes Default Description
gl WebGLContext

WebGL Context

unit Number

Destination texture unit

image Image | Canvas | ImageData | Array.<UInt8Array> | Array.<Float32Array>

Source image

filter Number

gl.LINEAR or gl.NEAREST

repeat String <optional>
"no-repeat"

Image repeat behavior (see me.ImageLayer#repeat)

w Number <optional>

Source image width (Only use with UInt8Array[] or Float32Array[] source image)

h Number <optional>

Source image height (Only use with UInt8Array[] or Float32Array[] source image)

b Number <optional>

Source image border (Only use with UInt8Array[] or Float32Array[] source image)

b Number <optional>

Source image border (Only use with UInt8Array[] or Float32Array[] source image)

premultipliedAlpha Boolean <optional>
true

Multiplies the alpha channel into the other color channels

Returns:
WebGLTexture -

A texture object