ssgLeaf *f = (ssgLeaf *)e;
if ( f -> hasState () ) f->getState()->apply() ;
- glPushAttrib( GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT );
+ glPushAttrib( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT );
// cout << "push error = " << glGetError() << endl;
glDisable( GL_DEPTH_TEST );
static int sgMoonOrbPostDraw( ssgEntity *e ) {
/* cout << endl << "Moon orb post draw" << endl << "----------------"
<< endl << endl; */
- // glEnable( GL_DEPTH_TEST );
- // glEnable( GL_FOG );
// Some drivers don't properly reset glBendFunc with a
// glPopAttrib() so we reset it to the 'default' here.
- glBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) ;
+ // glBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) ;
glPopAttrib();
// cout << "pop error = " << glGetError() << endl;
- /* test
- glDisable( GL_LIGHTING );
- glDisable( GL_CULL_FACE );
- glEnable( GL_COLOR_MATERIAL );
- glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
- glEnable( GL_CULL_FACE );
- glEnable( GL_LIGHTING ); */
-
return true;
}
static int sgMoonHaloPostDraw( ssgEntity *e ) {
/* cout << endl << "Moon halo post draw" << endl << "----------------"
<< endl << endl; */
- // glEnable( GL_DEPTH_TEST );
- // glEnable( GL_FOG );
- // glBlendFunc ( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) ;
glPopAttrib();
// cout << "pop error = " << glGetError() << endl;
// certain NVidia drivers don't seem to implement
// glPushAttrib(FG_FOG_BIT) properly. The result is that
// there is not fog when looking at the sun.
- glFogf ( GL_FOG_DENSITY, fog_exp2_density );
+ // glFogf ( GL_FOG_DENSITY, fog_exp2_density );
// if we are closer than this to a cloud layer, don't draw clouds
static const float slop = 5.0;
ssgLeaf *f = (ssgLeaf *)e;
if ( f -> hasState () ) f->getState()->apply() ;
- glPushAttrib( GL_DEPTH_BUFFER_BIT | GL_FOG_BIT );
+ glPushAttrib( GL_DEPTH_BUFFER_BIT | GL_FOG_BIT | GL_COLOR_BUFFER_BIT );
glDisable( GL_DEPTH_TEST );
glDisable( GL_FOG );
glPopAttrib();
- // glEnable( GL_DEPTH_TEST );
- // glEnable( GL_FOG );
-
return true;
}