Lit shader fixes

Fixes two issues: 
* vColor was being multiplied into the final output twice (once in the subroutine and once in the main() method).
* The code divided lightt intensity by ldist, an uncommon way of introducing inverse-distance illumination dropoff.  Since the light is in View coordinates, this made simple scene design very difficult.

If you're going to modify the shader to support directional lights, you
shouldn't do so by breaking the existing point light functionality.  Add a
'light type' value to the per-light uniforms, or add a new lit_directional
fragment shader.

if you want to do directional lighting, then the supplied light positions
should actually be pre-normalized vectors, rather than doing a per-pixel
normalize.

Also, You've modified the lighting calculations in LitColored.fs, but not
in LitTextured.fs.

Finally, have you rerun the example 3 demo to ensure that your new lighting
mechanism actually works on the existing examples that use lighting?


On Wed, Jun 18, 2014 at 2:42 PM, Alex Benton <notifications@github.com>
wrote:

> In shaders/LitColored.fs:
>
> >     for (int i = 0; i < int(LightCount); i++)
> >     {
> > -       vec3 ltp = (LightPosition[i].xyz - vViewPosition.xyz);
> > -       float  ldist = length(ltp);
>
> Yes, that's correct. Since lights are defined relative to the view instead
> of to the scene, this makes more sense for designing scenes.
> … <#146b0ee3293d3abe_>
> On Wed, Jun 18, 2014 at 6:51 PM, Brad Davis <notifications@github.com>
> wrote: In shaders/LitColored.fs: > for (int i = 0; i < int(LightCount);
> i++) > { > - vec3 ltp = (LightPosition[i].xyz - vViewPosition.xyz); > -
> float ldist = length(ltp); You've changed this from a point light to a
> directional light. Because the length of the light to point is no longer
> used, the light can no longer fall-off with distance. — Reply to this email
> directly or view it on GitHub <
> https://github.com/OculusRiftInAction/OculusRiftInActionResources/pull/1/files#r13929440>
> .
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/OculusRiftInAction/OculusRiftInActionResources/pull/1/files#r13942214>
> .
>