1
0
Fork 0

Fix moon drawing at night.

This commit is contained in:
curt 2001-03-28 17:52:40 +00:00
parent d6039a111f
commit c4b2e54551
2 changed files with 9 additions and 1 deletions

View file

@ -164,7 +164,7 @@ FGInterface::bind ()
{
// Time management
fgTie("/fdm/time/delta_t", this,
&(FGInterface::get_delta_t));
&FGInterface::get_delta_t);
// The following two can't be uncommented until we have support for
// the "long" data type in the property manager

View file

@ -569,6 +569,7 @@ void fgRenderFrame( void ) {
// scene. Thus instead of playing with GL_AMBIENT, we just
// set that to black and instead modify GL_LIGHT_MODEL_AMBIENT.
GLfloat black[4] = { 0.0, 0.0, 0.0, 1.0 };
GLfloat white[4] = { 1.0, 1.0, 1.0, 1.0 };
ssgGetLight( 0 ) -> setColour( GL_AMBIENT, black );
glLightModelfv( GL_LIGHT_MODEL_AMBIENT, l->scene_ambient );
@ -678,7 +679,14 @@ void fgRenderFrame( void ) {
if ( fgGetBool("/sim/rendering/skyblend") ) {
// draw the sky backdrop
// we need a white diffuse light for the phase of the moon
ssgGetLight( 0 ) -> setColour( GL_DIFFUSE, white );
thesky->preDraw();
// return to the desired diffuse color
ssgGetLight( 0 ) -> setColour( GL_DIFFUSE, l->scene_diffuse );
}
// draw the ssg scene