As mentioned in how it works WebGL requires 2 shaders every time youdraw something. A vertex shader and a fragment shader. Each shader is a function. A vertexshader and fragment shader are linked together into a shader program (or just program). A typicalWebGL app will have many shader programs.

To use a varying we need to declare matching varyings in both a vertex and fragment shader.We set the out varying in the vertex shader with some value per vertex. When WebGL draws pixelsit will optionally interpolate between those values and pass them to the corresponding in varying inthe fragment shader




Vertex Shaders Version 3