MasDennis/Rajawali — pull request #345 by Davhed (2013-01-30 06:04:29+00:00)
Title: Modified base materials to utilize uLightColor

Reason

To resolve requests: https://github.com/MasDennis/Rajawali/issues/225 https://github.com/MasDennis/Rajawali/issues/324

Rajawali has had the ability to set the light color, but the materials were not utilizing the light color.

Method

The accepted equations for calculating light and texture color are as follows:

ambient = Ka x globalAmbient
diffuse = Kd x lightColor x max(N · L, 0)
specular = Ks x lightColor x facing x (max(N · H, 0))

While the `PhongMaterial` followed this fairly closely, `DiffuseMaterial` was quite different. I went ahead and reworked `DiffuseMaterial` just to start giving some unifiormity to the material classes.

ToDo

-Extend this format to all material classes