processTexture( map ) {

    		const cache = this.cache;
    		const json = this.json;

    		if ( cache.textures.has( map ) ) return cache.textures.get( map );

    		if ( ! json.textures ) json.textures = [];

    		const textureDef = {
    			sampler: this.processSampler( map ),
    			source: this.processImage( map.image, map.format, map.flipY )
    		};

    		if ( map.name ) textureDef.name = map.name;

    		this._invokeAll( function ( ext ) {

    			ext.writeTexture && ext.writeTexture( map, textureDef );

    		} );

    		const index = json.textures.push( textureDef ) - 1;
    		cache.textures.set( map, index );
    		return index;

    	}
Process texture
@param  {Texture} map Map to process
@return {Integer} Index of the processed texture in the "textures" array