code: function sortFacesByMaterial ( geometry, material ) {
  
  		var f, fl, face, materialIndex, vertices,
  			groupHash, hash_map = {};
  
  		var numMorphTargets = geometry.morphTargets.length;
  		var numMorphNormals = geometry.morphNormals.length;
  
  		var usesFaceMaterial = material instanceof THREE.MeshFaceMaterial;
  
  		geometry.geometryGroups = {};
  
  		for ( f = 0, fl = geometry.faces.length; f < fl; f ++ ) {
  
  			face = geometry.faces[ f ];
  			materialIndex = usesFaceMaterial ? face.materialIndex : 0;
  
  			if ( hash_map[ materialIndex ] === undefined ) {
  
  				hash_map[ materialIndex ] = { 'hash': materialIndex, 'counter': 0 };
  
  			}
  
  			groupHash = hash_map[ materialIndex ].hash + '_' + hash_map[ materialIndex ].counter;
  
  			if ( geometry.geometryGroups[ groupHash ] === undefined ) {
  
  				geometry.geometryGroups[ groupHash ] = { 'faces3': [], 'materialIndex': materialIndex, 'vertices': 0, 'numMorphTargets': numMorphTargets, 'numMorphNormals': numMorphNormals };
  
  			}
  
  			vertices = 3;
  
  			if ( geometry.geometryGroups[ groupHash ].vertices + vertices > 65535 ) {
  
  				hash_map[ materialIndex ].counter += 1;
  				groupHash = hash_map[ materialIndex ].hash + '_' + hash_map[ materialIndex ].counter;
  
  				if ( geometry.geometryGroups[ groupHash ] === undefined ) {
  
  					geometry.geometryGroups[ groupHash ] = { 'faces3': [], 'materialIndex': materialIndex, 'vertices': 0, 'numMorphTargets': numMorphTargets, 'numMorphNormals': numMorphNormals };
  
  				}
  
  			}
  
  			geometry.geometryGroups[ groupHash ].faces3.push( f );
  			geometry.geometryGroups[ groupHash ].vertices += vertices;
  
  		}
  
  		geometry.geometryGroupsList = [];
  
  		for ( var g in geometry.geometryGroups ) {
  
  			geometry.geometryGroups[ g ].id = _geometryGroupCounter ++;
  
  			geometry.geometryGroupsList.push( geometry.geometryGroups[ g ] );
  
  		}
  
  	}
docs: Geometry splitting