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.

Sorry, realized I misunderstood your comment from last night.

This shader is a point light.  It's a point light because it will be
different if sampled from different places around the scene, because we
subtract the current 3D position of the point being illuminated from it to
compue the lighting.

A directional light would just use "light coordinate" in the lighting
equation, without regards for the coordinates being illuminated.  That
would simulate a light infinitely far away.

What I've fixed here is that you were dividing by the distance from the
light, which doesn't accurately reflect any real-world illumination.  Light
(or any other electro-magnetic radiation) diminishes with the inverse
square of the distance, not the inverse of the distance itself (1).  And in
this type of simple rasterized graphics, it's very unusual to have any sort
of "drop off" on a light source until you're doing much more advanced scene
effects, with textures and so on.  I think having the 'standard' lit shader
do an unconventional drop-off effect would confuse readers more than it
educated them.

I've updated this CL with the same fix applied to LitTextured.

I can't find the constant SHADERS_LITCOLORED_FS used anywhere besides the
chapter 5 code except in the Bunny code and the Artificial Horizon.  I
don't think the chapter 3 demo uses this shader.  But I've re-run demo 3_3
and it's still shaded.  It might be brighter now?

(1)
http://en.wikipedia.org/wiki/Inverse-square_law#Light_and_other_electromagnetic_radiation


On Wed, Jun 18, 2014 at 10:55 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);
>
> 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?
> … <#146b0fa962d579c2_>
> 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>
> .
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/OculusRiftInAction/OculusRiftInActionResources/pull/1/files#r13942818>
> .
>