the current WebGL rendering context
a string containing the GLSL source code to set
a string containing the GLSL source code to set
Optional
precision: stringfloat precision ('lowp', 'mediump' or 'highp').
https://developer.mozilla.org/en-US/docs/Games/Techniques/3D_on_the_web/GLSL_Shaders
// create a basic shader
let myShader = new me.GLShader(
// WebGL rendering context
gl,
// vertex shader
[
"void main() {",
" gl_Position = doMathToMakeClipspaceCoordinates;",
"}"
].join("\n"),
// fragment shader
[
"void main() {",
" gl_FragColor = doMathToMakeAColor;",
"}"
].join("\n")
)
// use the shader
myShader.bind();
the location attributes of the shader
the fragment shader source code
the active gl rendering context
a reference to the shader program (once compiled)
the uniforms of the shader
the vertex shader source code
activate the given vertex attribute for this shader
the current WebGL rendering context
an array of vertex attributes
the size of a single vertex in bytes
a base GL Shader object