code: function processTexture(map) {
        if (cachedData.textures.has(map)) {
          return cachedData.textures.get(map);
        }
  
        if (!outputJSON.textures) {
          outputJSON.textures = [];
        }
  
        var gltfTexture = {
          sampler: processSampler(map),
          source: processImage(map.image, map.format, map.flipY)
        };
  
        outputJSON.textures.push(gltfTexture);
  
        var index = outputJSON.textures.length - 1;
        cachedData.textures.set(map, index);
  
        return index;
      }
docs: Process texture
  @param  {Texture} map Map to process
  @return {Integer}     Index of the processed texture in the "textures" array