`#version 300 es //#version directive must occur on the first line of the shader //Why it is necessary to set precission for the fragment shader? //Vertex shader works without this, but fragment shader //doesn't work without this code row (as I see). // Why the different behaviour exist? // fragment shaders don't have a default precision so we need // to pick one. highp is a good default. It means "high precision" precision highp float; // we need to declare an output for the fragment shader // WebGL2 no more gl_FragColor out vec4 outColor; // all shaders have a main function void main() { //WebGL1: gl_FragColor = vec4(1, 0, 0.5, 1); outColor = vec4(0.5, 0.5, 0.5, 1) ; }`