- match mtledit blocks with material name not object name
[laserbrain_demo] / src / material.cc
index 6b10534..6288ef4 100644 (file)
@@ -22,10 +22,17 @@ void Material::setup() const
        glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, ks);
        glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, shininess);
 
+       /*
        int ntex = std::min((int)textures.size(), 8);   // TODO: use max texture units
        for(int i=0; i<ntex; i++) {
                bind_texture(textures[i], i);
        }
+       */
+       for(int i=0; i<NUM_MTL_TEXTURES; i++) {
+               if(stdtex[i]) {
+                       bind_texture(stdtex[i], i);
+               }
+       }
 
        if(stdtex[MTL_TEX_LIGHTMAP]) {
                bind_program(stdtex[MTL_TEX_DIFFUSE] ? sdr_ltmap : sdr_ltmap_notex);