]> git.mxchange.org Git - flightgear.git/commitdiff
Patch from Erik Hofman:
authordavid <david>
Wed, 31 Jul 2002 17:57:59 +0000 (17:57 +0000)
committerdavid <david>
Wed, 31 Jul 2002 17:57:59 +0000 (17:57 +0000)
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]

src/Objects/newmat.cxx

index e22df26b693dd4e8b92257d23cfc2bd972a16faf..1966b9ecf7e0e4a429953a71450a145b3dfff194 100644 (file)
@@ -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 );