1
0
Fork 0

Add a /test/scene_lighting property to switch between new and old behavior

This commit is contained in:
ehofman 2003-08-04 09:34:55 +00:00
parent 3d07fa8bda
commit 7ede111d12

View file

@ -157,22 +157,41 @@ void fgLIGHT::Update( void ) {
} }
gamma_correct_rgb( cloud_color ); gamma_correct_rgb( cloud_color );
float *sun_color = thesky->get_sun_color(); if (fgGetBool("/test/scene_lighting")) {
float *sun_color = thesky->get_sun_color();
scene_ambient[0] = (sun_color[0]*0.1 + cloud_color[0]*0.9) * ambient; scene_ambient[0] = (sun_color[0]*0.1 + cloud_color[0]*0.9) * ambient;
scene_ambient[1] = (sun_color[1]*0.1 + cloud_color[1]*0.9) * ambient; scene_ambient[1] = (sun_color[1]*0.1 + cloud_color[1]*0.9) * ambient;
scene_ambient[2] = (sun_color[2]*0.1 + cloud_color[2]*0.9) * ambient; scene_ambient[2] = (sun_color[2]*0.1 + cloud_color[2]*0.9) * ambient;
scene_ambient[3] = 1.5; scene_ambient[3] = 1.5;
scene_diffuse[0] = (sun_color[0]*0.25 + fog_color[0]*0.75) * diffuse; scene_diffuse[0] = (sun_color[0]*0.25 + fog_color[0]*0.75) * diffuse;
scene_diffuse[1] = (sun_color[1]*0.25 + fog_color[1]*0.75) * diffuse; scene_diffuse[1] = (sun_color[1]*0.25 + fog_color[1]*0.75) * diffuse;
scene_diffuse[2] = (sun_color[2]*0.25 + fog_color[2]*0.75) * diffuse; scene_diffuse[2] = (sun_color[2]*0.25 + fog_color[2]*0.75) * diffuse;
scene_diffuse[3] = 1.5; scene_diffuse[3] = 1.5;
scene_specular[0] = sun_color[0] * specular; scene_specular[0] = sun_color[0] * specular;
scene_specular[1] = sun_color[1] * specular; scene_specular[1] = sun_color[1] * specular;
scene_specular[2] = sun_color[2] * specular; scene_specular[2] = sun_color[2] * specular;
scene_specular[3] = 1.0; scene_specular[3] = 1.0;
} else {
scene_ambient[0] = white[0] * ambient;
scene_ambient[1] = white[1] * ambient;
scene_ambient[2] = white[2] * ambient;
scene_ambient[3] = 1.0;
scene_diffuse[0] = white[0] * diffuse;
scene_diffuse[1] = white[1] * diffuse;
scene_diffuse[2] = white[2] * diffuse;
scene_diffuse[3] = 1.0;
scene_specular[0] = white[0] * ambient;
scene_specular[1] = white[1] * ambient;
scene_specular[2] = white[2] * ambient;
scene_specular[3] = 1.0;
}
} }