]> git.mxchange.org Git - simgear.git/commitdiff
Do some math omtimizations as pointed out by Norman
authorehofman <ehofman>
Fri, 27 Jun 2003 21:36:05 +0000 (21:36 +0000)
committerehofman <ehofman>
Fri, 27 Jun 2003 21:36:05 +0000 (21:36 +0000)
simgear/scene/sky/oursun.cxx

index fcb728d7844bc0748003dd744c9614af0520704c..03d2a251e1f89779321d17ccebea9106e2d853d6 100644 (file)
@@ -349,9 +349,10 @@ bool SGSun::repaint( double sun_angle ) {
         sun_factor = sun_factor/2 + 0.5;
 
         sgVec4 color;
-        color[0] = pow(sun_factor, 0.25);
-        color[1] = pow(sun_factor, 0.50);
-        color[2] = pow(sun_factor, 4.0);
+        color[1] = sqrt(sun_factor);
+        color[0] = sqrt(color[1]);
+        color[2] = sun_factor * sun_factor;
+        color[2] *= color[2];
         color[3] = 1.0;
 
         gamma_correct_rgb( color );