make the material a bit easy to extend for WebGLRender

try to get material dependent code out of WebGLRenderer.