text: "use strict";
  
  var texSize = 256;
  
  var image = new Uint8Array(texSize*texSize);
  
  for(var i=0; i<texSize; i++) {
      var c;
      var x = Math.PI*(8*i/texSize-4.0);
      for(var j=0; j<texSize; j++) {
          var y = Math.PI*(8*j/texSize-4.0);
          var r = Math.sqrt(x*x+y*y);
          if(r ) c = 255*(1+Math.sin( r )/r)/2;
          else c = 255;
           image[i*texSize+j] = c;
      }
  }
  
  var texCoord = [
      vec2(0, 0),
      vec2(0, 1),
      vec2(1, 1),
      vec2(1, 0)
  ];
  
  var canvas;
  var gl;
  
  var program;
  
  var positionsArray = [];
  var texCoordsArray = [];
  
  
  window.onload = function init() {
      canvas = document.getElementById("gl-canvas");
  
      gl = canvas.getContext('webgl2');
      if(!gl) gl = canvas.getContext('webgl');
      else if(!gl) alert( "WebGL isn't available");
  
      gl.viewport(0, 0, canvas.width, canvas.height);
      gl.clearColor(1.0, 1.0, 1.0, 1.0);
      //
      //  Load shaders and initialize attribute buffers
      //
      program = initShaders( gl, "vertex-shader", "fragment-shader" );
      gl.useProgram( program );
  
      positionsArray.push(vec2(-1, -1));
      positionsArray.push(vec2(-1, 1));
      positionsArray.push(vec2(1, 1));
      positionsArray.push(vec2(1, -1));
  
      texCoordsArray.push(vec2(0, 0));
      texCoordsArray.push(vec2(0, 1));
      texCoordsArray.push(vec2(1, 1));
      texCoordsArray.push(vec2(1, 0));
  
      var tBuffer = gl.createBuffer();
      gl.bindBuffer(gl.ARRAY_BUFFER, tBuffer);
      gl.bufferData(gl.ARRAY_BUFFER, flatten(texCoordsArray), gl.STATIC_DRAW);
  
      var texCoordLoc = gl.getAttribLocation( program, "aTexCoord");
      gl.vertexAttribPointer(texCoordLoc, 2, gl.FLOAT, false, 0, 0);
      gl.enableVertexAttribArray(texCoordLoc);
  
  
      var vBuffer = gl.createBuffer();
      gl.bindBuffer(gl.ARRAY_BUFFER, vBuffer);
      gl.bufferData(gl.ARRAY_BUFFER, flatten(positionsArray), gl.STATIC_DRAW);
  
      var positionLoc = gl.getAttribLocation( program, "aPosition");
      gl.vertexAttribPointer(positionLoc, 2, gl.FLOAT, false, 0, 0);
      gl.enableVertexAttribArray(positionLoc);
  
      var texture = gl.createTexture();
      gl.bindTexture( gl.TEXTURE_2D, texture);
      gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);
  
      gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE,
          texSize, texSize, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, image);
      gl.generateMipmap(gl.TEXTURE_2D);
      gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER,
                        gl.NEAREST_MIPMAP_LINEAR);
      gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
  
      render();
  }
  
  
  function render() {
  
      gl.clear(gl.COLOR_BUFFER_BIT);
      gl.drawArrays(gl.TRIANGLE_FAN, 0, 4);
  }
  