From 2be37c04fe1fb95841aadc33f7468208e64c32cd Mon Sep 17 00:00:00 2001 From: ehofman Date: Sat, 13 Sep 2003 09:27:50 +0000 Subject: [PATCH] Enable two sided lighting calculations when specular highlight is enabled --- src/Main/main.cxx | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 4332c28cd..947f495a0 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -333,12 +333,6 @@ void trRenderFrame( void ) { glLightModelfv( GL_LIGHT_MODEL_AMBIENT, black ); glLightModeli( GL_LIGHT_MODEL_LOCAL_VIEWER, GL_FALSE ); - if (fgGetBool("/sim/rendering/specular-highlight")) { - glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR); - } else { - glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SINGLE_COLOR); - } - ssgGetLight( 0 ) -> setColour( GL_AMBIENT, l->scene_ambient ); // texture parameters @@ -615,13 +609,6 @@ void fgRenderFrame() { // a completely dark scene. So, we set GL_LIGHT_MODEL_AMBIENT // explicitely to black. glLightModelfv( GL_LIGHT_MODEL_AMBIENT, black ); - if (fgGetBool("/sim/rendering/specular-highlight")) { - glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, - GL_SEPARATE_SPECULAR_COLOR); - } else { - glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, - GL_SINGLE_COLOR); - } ssgGetLight( 0 ) -> setColour( GL_AMBIENT, l->scene_ambient ); ssgGetLight( 0 ) -> setColour( GL_DIFFUSE, l->scene_diffuse ); @@ -1302,6 +1289,13 @@ static void fgMainLoop( void ) { // END Tile Manager udpates + if (fgGetBool("/sim/rendering/specular-highlight")) { + glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR); glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); + } else { + glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SINGLE_COLOR); + glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE); + } + // redraw display fgRenderFrame();