Merged from master. Get rid of redundant GL fog states. Moved local light parameters to shader uniform arrays.