[SO answer I got the idea from](http://stackoverflow.com/questions/18665600/three-js-how-to-improve-performance-of-multiple-materials-on-multiple-merged-cu)