From fa42efcf915ffd3ac2603c40e75e0842be5d4b83 Mon Sep 17 00:00:00 2001 From: ehofman Date: Fri, 27 Jun 2003 21:36:05 +0000 Subject: [PATCH] Do some math omtimizations as pointed out by Norman --- simgear/scene/sky/oursun.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 ); -- 2.39.5