From 9812739a718fc66780b927bff32f90975693a654 Mon Sep 17 00:00:00 2001 From: ehofman Date: Fri, 12 Sep 2003 21:43:01 +0000 Subject: [PATCH] Add the posibillity to disable specular highlight because it looks like some implementations switch over to sofware rendering when this is enabled --- src/Main/main.cxx | 8 ++++++-- src/Main/options.cxx | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Main/main.cxx b/src/Main/main.cxx index ca7f54998..34941f4c1 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -332,7 +332,9 @@ void trRenderFrame( void ) { // explicitely to black. glLightModelfv( GL_LIGHT_MODEL_AMBIENT, black ); glLightModeli( GL_LIGHT_MODEL_LOCAL_VIEWER, GL_FALSE ); - glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR); + + if (fgGetBool("/sim/rendering/specular-highlight")) + glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR); ssgGetLight( 0 ) -> setColour( GL_AMBIENT, l->scene_ambient ); @@ -610,7 +612,9 @@ void fgRenderFrame() { // a completely dark scene. So, we set GL_LIGHT_MODEL_AMBIENT // explicitely to black. glLightModelfv( GL_LIGHT_MODEL_AMBIENT, black ); - glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR); + if (fgGetBool("/sim/rendering/specular-highlight")) + glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, + GL_SEPARATE_SPECULAR_COLOR); ssgGetLight( 0 ) -> setColour( GL_AMBIENT, l->scene_ambient ); ssgGetLight( 0 ) -> setColour( GL_DIFFUSE, l->scene_diffuse ); diff --git a/src/Main/options.cxx b/src/Main/options.cxx index 90ad11ad9..6e47f0433 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -207,6 +207,7 @@ fgSetDefaults () fgSetBool("/sim/rendering/horizon-effect", false); fgSetBool("/sim/rendering/enhanced-lighting", false); fgSetBool("/sim/rendering/distance-attenuation", false); + fgSetBool("/sim/rendering/specular-highlight", true); fgSetInt("/sim/startup/xsize", 800); fgSetInt("/sim/startup/ysize", 600); fgSetInt("/sim/rendering/bits-per-pixel", 16); @@ -1287,6 +1288,8 @@ struct OptionDesc { {"enable-enhanced-lighting", false, OPTION_BOOL, "/sim/rendering/enhanced-lighting", true, "", 0 }, {"disable-distance-attenuation", false, OPTION_BOOL, "/sim/rendering/distance-attenuation", false, "", 0 }, {"enable-distance-attenuation", false, OPTION_BOOL, "/sim/rendering/distance-attenuation", true, "", 0 }, + {"disable-specular-highlight", false, OPTION_BOOL, "/sim/rendering/specular-highlight", false, "", 0 }, + {"enable-specular-highlight", false, OPTION_BOOL, "/sim/rendering/specular-highlight", true, "", 0 }, {"disable-clouds", false, OPTION_BOOL, "/environment/clouds/status", false, "", 0 }, {"enable-clouds", false, OPTION_BOOL, "/environment/clouds/status", true, "", 0 }, #ifdef FG_USE_CLOUDS_3D