You know, that thing that draws teapots in your internet browser...
0.6, 0.5
0.8, -0.45
-0.3, -0.5
black
black
black
black
black
black
black
black
black
black
black
white
white
white
white
white
white
white
white
gray
!!ARBvp1.0
TEMP vertexClip;
DP4 vertexClip.x, state.matrix.mvp.row[0], vertex.position;
DP4 vertexClip.y, state.matrix.mvp.row[1], vertex.position;
DP4 vertexClip.z, state.matrix.mvp.row[2], vertex.position;
DP4 vertexClip.w, state.matrix.mvp.row[3], vertex.position;
MOV result.position, vertexClip;
MOV result.color, vertex.color;
MOV result.texcoord[0], vertex.texcoord;
END
(OpenGL Shading Language)
attribute vec4 a_Coords;
void main() {
gl_Position = a_Coords;
}
This looks like C.
I don't know C, but
I can deal with it!
const gl = canvasEl.getContext('webgl');
const vs = gl.createShader(gl.VERTEX_SHADER);
gl.shaderSource(vs, ...);
gl.compileShader(vs);
attribute vec4 a_Coords;
void main() {
gl_Position = a_Coords;
}