mrdoob/three.js — pull request #5805 by bhouston (2014-12-22 19:32:24+00:00)
Title: ensure that lightMap is modulated by surface color and added ti result.

Right now lightMap is modulating the gl_FragColor after the lighting calculation modifies gl_FragColor to include specular and diffuse lighting contributions. This is not correct.

lightMap should be considered un-directional incoming light that should get modulated by the surface color (diffuseColor) and then it should be added to the result.

This is what this PR does by introducing the new diffuseColor variable into the Phong vertex shader.

Motivated by this discussion here: https://github.com/mrdoob/three.js/pull/5741#issuecomment-67876234