var compressedFormat = 0;
  var compressedByteCount;

  if (gl.getExtension("WEBGL_compressed_texture_s3tc")) {
    var e = gl.getExtension("WEBGL_compressed_texture_s3tc");
    compressedFormat = e.COMPRESSED_RGB_S3TC_DXT1_EXT;
    compressedByteCount = 8;
  } else if (gl.getExtension("WEBGL_compressed_texture_etc")) {
    var e = gl.getExtension("WEBGL_compressed_texture_etc");
    compressedFormat = e.COMPRESSED_RGB8_ETC2;
    compressedByteCount = 8;
  } else {
    debug("No compressed texture format fo