What is the difference between fg_SunDiffuseColor and gl_LightSource[0].diffuse?
Is one supposed to be used in Rembrandt the other in default pipeline? It also looks like ALS is using some custom code to generate its diffuse light.
If that is all the case wouldn't it be easier to do all 3 in C++ and just set the gl_LightSource[0].diffuse accordingly, and same for ambient/specular?
Moonlight also seems to be fully defined via custom Effect uniforms, couldn't that be converted to gl_LightSource[1]? ..To avoid doing tons of custom code each fragment and to make life less confusing for shader coders.