mrdoob/three.js — pull request #5816 by TatumCreative (2014-12-26 18:10:13+00:00)
Title: THREE.MeshGroup - Proposed shared material for meshes

This is a proposal for a MeshGroup class that holds multiple meshes, and one material. The meshes all get rendered in one draw call, greatly speeding up the rendering. The individual meshes' transform matrices get packed into a DataTexture, and then get looked up in a similar way that bones work. It requires floating point textures. Each mesh can have different geometry. It still needs a bit of cleanup and error checking before it's ready for production use.

Working example: http://gregtatum.com/tmp/three.js/examples/webgl_mesh_group.html#5000
Working example: http://gregtatum.com/tmp/three.js/examples/webgl_mesh_group2.html
Change the hash's number and refresh to try out different values.

#### Currently it works something like this:

meshGroup = new THREE.MeshGroup( THREE.Mesh, material );
meshGroup.add( mesh );

meshGroup.build();
meshGroup.updateMatrixWorld( true );
scene.add( meshGroup.object );

#### Current To-dos for a merge:

* Auto-update matrices
* Implement THREE.Line
* Create cooler example
* Better error handling of no floating point textures
* Possibly change `scene.add( meshGroup.object )` to `scene.add( meshGroup )`
* Unit tests?

#### Possible other names:

* SharedMaterialMeshes
* BatchGroup
* MeshBatchGroup
* Any others?