mrdoob/three.js — pull request #3432 by wivlaro (2013-05-04 15:24:23+00:00)
Title: Added utilities to help setup static geometry efficiently.

I've been baking the static geometry in my scene together into larger BufferGeometry objects which are much more efficient.

This branch contains some utility methods I've added that has made it a lot easier

* THREE.SceneUtils.mergeMeshesRecursive - add a node tree in world-space into a Geometry
* THREE.SceneUtils.deduplicateMaterials - optimize for duplicate materials in a mesh
* THREE.GeometryUtils.makeBufferGeometries - split a Geometry into an array of BufferGeometry objects. In doing so, I moved WebGLRenderer's sortFacesByMaterial function into Geometry.makeGroups (so I could use it in makeBufferGeometries). I think it's a bit tidier there as it only affects Geometry and reduces WebGLRenderer by 70 lines.

So here's a pull request in case you want them in the main release.
:)