mrdoob/three.js — pull request #5762 by avinoamr (2014-12-14 19:29:30+00:00)
Title: Abstract away the shader selection configuration

Beyond the obvious design benefit of allowing the materials to define how they should be rendered in a duck-typed way, there should be a performance benefit as well: instanceof tests are about [3x more expansive](http://jsfiddle.net/nkLdw986/) than testing a direct reference on the object, and with this change we've removed 8 such tests (in the worst case).

This change is part of the proposed change to incrementally clean-up the WebGLRenderer from hard-coded material-dependent configurations (#2957).