From: david Date: Wed, 31 Jul 2002 17:57:59 +0000 (+0000) Subject: Patch from Erik Hofman: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a5f251a5deb47b1ffeafdddccaab3c8fdc736ef8;p=flightgear.git Patch from Erik Hofman: I changed the code such that textures terrain also takes ambient, diffuse, specular and emissive from the materials.xml file. [note from dpm: doesn't seem to work yet] --- diff --git a/src/Objects/newmat.cxx b/src/Objects/newmat.cxx index e22df26b6..1966b9ecf 100644 --- a/src/Objects/newmat.cxx +++ b/src/Objects/newmat.cxx @@ -425,9 +425,24 @@ FGNewMat::build_ssg_state (bool defer_tex_load) texture_loaded = false; } textured->enable( GL_COLOR_MATERIAL ); +#if 0 textured->setColourMaterial( GL_AMBIENT_AND_DIFFUSE ); textured->setMaterial( GL_EMISSION, 0, 0, 0, 1 ); textured->setMaterial( GL_SPECULAR, 0, 0, 0, 1 ); +#else + textured->setMaterial ( GL_AMBIENT, + ambient[0], ambient[1], + ambient[2], ambient[3] ) ; + textured->setMaterial ( GL_DIFFUSE, + diffuse[0], diffuse[1], + diffuse[2], diffuse[3] ) ; + textured->setMaterial ( GL_SPECULAR, + specular[0], specular[1], + specular[2], specular[3] ) ; + textured->setMaterial ( GL_EMISSION, + emission[0], emission[1], + emission[2], emission[3] ) ; +#endif // Set up the coloured state nontextured->enable( GL_LIGHTING );