highfidelity/hifi — pull request #3192 by ey6es (2014-07-22 21:23:28+00:00)
Title: Fixes for local lights.

First, we need to apply local lighting in all of the model fragment shaders. Also, if the local lights are to apply to all avatars, then it's much simpler just to keep that data in one place (AvatarManager), rather than have the script try to sense when avatars are added. Also, use the fixed function light state, since that's what we're using for the principal directional light. And transform it correctly (so that the lights are in model space), rather than simply setting the view space direction in a uniform. And wrap up each local light as one object, and set them all at once, rather than through several script commands.