]> git.mxchange.org Git - flightgear.git/commitdiff
Minor fiddling with material properties *trying* to chase down a visual bug
authorcurt <curt>
Thu, 1 Jun 2000 21:14:06 +0000 (21:14 +0000)
committercurt <curt>
Thu, 1 Jun 2000 21:14:06 +0000 (21:14 +0000)
where the scene get's brighter or dimmer depending on whether or not the sun
or moon is in the field of view.

src/Main/main.cxx
src/Objects/materialmgr.cxx

index 59e8085bb2c311dd92c7ae8c8ea5c9a27e79e908..6967b7b8ac567b0482f31ba1560a9a6bd12323ad 100644 (file)
@@ -200,11 +200,13 @@ void fgBuildRenderStates( void ) {
     default_state = new ssgSimpleState;
     default_state->disable( GL_TEXTURE_2D );
     default_state->enable( GL_CULL_FACE );
-    default_state->disable( GL_COLOR_MATERIAL );
+    default_state->enable( GL_COLOR_MATERIAL );
+    default_state->setColourMaterial( GL_AMBIENT_AND_DIFFUSE );
+    default_state->setMaterial( GL_EMISSION, 0, 0, 0, 1 );
+    default_state->setMaterial( GL_SPECULAR, 0, 0, 0, 1 );
     default_state->disable( GL_BLEND );
     default_state->disable( GL_ALPHA_TEST );
     default_state->disable( GL_LIGHTING );
-    default_state->setMaterial( GL_AMBIENT_AND_DIFFUSE, 1.0, 1.0, 1.0, 1.0 );
 
     hud_and_panel = new ssgSimpleState;
     hud_and_panel->disable( GL_CULL_FACE );
@@ -620,12 +622,14 @@ void fgRenderFrame( void ) {
        global_tile_mgr.prep_ssg_nodes();
 
        // force the default state so ssg can get back on track if
-       // we've changed things elsewhere
-       FGMaterialSlot m_slot;
-       FGMaterialSlot *m_ptr = &m_slot;
-       if ( material_mgr.find( "Default", m_ptr ) ) {
-           m_ptr->get_state()->force();
-       }
+       // we've changed things elsewhere (this is now handled
+       // differently)
+       // 
+       // FGMaterialSlot m_slot;
+       // FGMaterialSlot *m_ptr = &m_slot;
+       // if ( material_mgr.find( "Default", m_ptr ) ) {
+       //    m_ptr->get_state()->force();
+       // }
 
        // draw the ssg scene
        ssgCullAndDraw( scene );
index 560bdd08bd07d7678c40fbf5a6f367a5775c8b41..44180cfe4998d0bb420fed4a486bb027846d0897 100644 (file)
@@ -204,7 +204,8 @@ fgMATERIAL_MGR::load_lib ( void )
            textured->setTexture( (char *)tex_file.c_str() );
            textured->enable( GL_COLOR_MATERIAL );
            textured->setColourMaterial( GL_AMBIENT_AND_DIFFUSE );
-           textured->setMaterial( GL_SPECULAR, 0.0, 0.0, 0.0, 1.0 );
+           textured->setMaterial( GL_EMISSION, 0, 0, 0, 1 );
+           textured->setMaterial( GL_SPECULAR, 0, 0, 0, 1 );
 
            // Set up the coloured state
            nontextured->enable( GL_LIGHTING );