From: ehofman Date: Fri, 27 Jun 2003 21:36:05 +0000 (+0000) Subject: Do some math omtimizations as pointed out by Norman X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=fa42efcf915ffd3ac2603c40e75e0842be5d4b83;p=simgear.git Do some math omtimizations as pointed out by Norman --- diff --git a/simgear/scene/sky/oursun.cxx b/simgear/scene/sky/oursun.cxx index fcb728d7..03d2a251 100644 --- a/simgear/scene/sky/oursun.cxx +++ b/simgear/scene/sky/oursun.cxx @@ -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 );