Why is gl_FragDepthEXT undefined in my WebGL fragment shader?
I'm trying to follow documentation at: https://developer.mozilla.org/en-US/docs/Web/API/EXT_frag_depth. I want to have a fragment shader calculate depth in a step toward creating something more interesting. Here is the broken code: https://code.sololearn.com/W8a159A1485a Shader compilation errors show in the JavaScript console as: shaders.js:9 Shader compiler log: ERROR: 0:4: 'GL_EXT_frag_depth' : extension is disabled If the gl_FragDepthEXT is commented out along with the #version, a red triangle is drawn. Is setting depth so weird now that a browser flag needs to be turned on that is defaulted to disabled? Is the error related to my call to gl.getExtension('EXT_frag_depth')? Please identify the code changes so this code actually calculates the depth for each pixel in the triangle. I've looked at many articles on setting depth in a WebGL shader and OpenGL shader so please don't just point me at an article that I've already seen.