- amb[0] = 0.50 + ((ambient * 6.66) - 1.6);
- amb[1] = 0.00 + ((ambient * 6.66) - 1.6);
- amb[2] = 0.00 + ((ambient * 6.66) - 1.6);
- amb[3] = 0.00;
-#ifdef DEBUG
- printf("Color of the sun: %f, %f, %f\n"
- "Ambient value : %f\n"
- "Sun Angle : %f\n" , amb[0], amb[1], amb[2], ambient, t->sun_angle);
-#endif
- diff[0] = 0.0;
- diff[1] = 0.0;
- diff[2] = 0.0;
- diff[3] = 1.0;
-
- /* set lighting parameters */
- xglLightfv(GL_LIGHT0, GL_AMBIENT, color );
- xglLightfv(GL_LIGHT0, GL_DIFFUSE, color );
- xglMaterialfv(GL_FRONT, GL_AMBIENT, amb);
- xglMaterialfv(GL_FRONT, GL_DIFFUSE, diff);
- xglMaterialfv(GL_FRONT, GL_SHININESS, diff);
- xglMaterialfv(GL_FRONT, GL_EMISSION, diff);
- xglMaterialfv(GL_FRONT, GL_SPECULAR, diff);
-
- /* xglDisable( GL_LIGHTING ); */
+ amb[0] = 0.00 + ((ambient * 6.0) - 1.0); /* minimum val = 0.8 */
+ amb[1] = 0.00 + ((ambient * 11.0) - 3.0); /* minimum val = 0.3 */
+ amb[2] = 0.00 + ((ambient * 12.0) - 3.6); /* minimum val = 0.0 */
+ amb[3] = 1.00;
+
+ if (amb[0] > 1.0) amb[0] = 1.0;
+ if (amb[1] > 1.0) amb[1] = 1.0;
+ if (amb[2] > 1.0) amb[2] = 1.0;
+
+ fgPrintf( FG_ASTRO, FG_DEBUG,
+ "Color of the sun: %f, %f, %f\n"
+ "Ambient value : %f\n"
+ "Sun Angle : %f\n" ,
+ amb[0], amb[1], amb[2], ambient, l->sun_angle);