vertex
x
y
color
1
2
3

Clip Space

Screen Width
Screen Height
devicePixelRatio
1.00

Vertex Shader

#version 300 es
precision mediump float;
 
in vec2 vertexPosition;
in vec3 vertexColor;
 
out vec3 fragmentColor;
 
void main() {
 
  fragmentColor = vertexColor;
 
  gl_Position = vec4(vertexPosition, 0.0, 1.0);
 
}

Fragment Shader

#version 300 es
precision mediump float;
 
in vec3 fragmentColor;
out vec4 outputColor;
 
void main() {
 
  outputColor = vec4(fragmentColor, 0.0);
 
}
Learning with on
UNDER THE HOOD - WEB LABS