A basic vertex/fragment shader combination showing colours
From webglcookbook
Here's the vertex shader:
attribute vec3 aVertexPosition; attribute vec4 aVertexColor;
uniform mat4 uMVMatrix; uniform mat4 uPMatrix;
varying vec4 vColor;
void main(void) {
gl_Position = uPMatrix * uMVMatrix * vec4(aVertexPosition, 1.0);
vColor = aVertexColor;
}
...and the fragment shader:
varying vec4 vColor;
void main(void) {
gl_FragColor = vColor;
}