Changeset 4194 in orxonox.OLD for orxonox/branches/openAL/src/lib/graphics/importer/material.cc
- Timestamp:
- May 16, 2005, 1:33:19 PM (20 years ago)
- Location:
- orxonox/branches/openAL
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/openAL
- Property svn:externals
-
old new 1 data http://svn.orxonox.ethz.ch/data 1
-
- Property svn:externals
-
orxonox/branches/openAL/src/lib/graphics/importer/material.cc
r3914 r4194 45 45 this->setTransparency(1.0); 46 46 47 48 47 this->diffuseTexture = NULL; 49 48 this->ambientTexture = NULL; 50 49 this->specularTexture = NULL; 51 52 this->diffuseTextureSet = false;53 this->ambientTextureSet = false;54 this->specularTextureSet = false;55 50 56 51 this->setName(mtlName); … … 88 83 89 84 // setting the transparency 90 if (this->transparency == 1.0) 91 { 92 glDisable(GL_BLEND); 93 } 94 else 85 if (this->transparency < 1.0) 95 86 { 96 87 glEnable(GL_BLEND); … … 98 89 glBlendFunc(GL_SRC_ALPHA, GL_ONE); 99 90 } 91 else 92 { 93 glDisable(GL_BLEND); 94 glColor4f(1.0f, 1.0f, 1.0f, 1.0f); 95 } 96 100 97 101 98 // setting illumination Model … … 105 102 glShadeModel(GL_SMOOTH); 106 103 107 if (this->diffuseTexture Set)104 if (this->diffuseTexture) 108 105 { 109 106 glEnable(GL_TEXTURE_2D); 110 107 glBindTexture(GL_TEXTURE_2D, this->diffuseTexture->getTexture()); 108 109 /* This allows alpha blending of 2D textures with the scene */ 110 if (this->diffuseTexture->hasAlpha()) 111 { 112 glEnable(GL_BLEND); 113 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 114 } 111 115 } 112 116 else … … 291 295 { 292 296 PRINTF(4)("setting Diffuse Map %s\n", dMap); 293 // diffuseTexture = new Texture();294 // this->diffuseTextureSet = diffuseTexture->loadImage(dMap);295 297 296 298 //! \todo check if RESOURCE MANAGER is availiable 297 299 //! \todo Textures from .mtl-file need special care. 298 this->diffuseTexture Set = this->diffuseTexture= (Texture*)ResourceManager::getInstance()->load(dMap, IMAGE);300 this->diffuseTexture = (Texture*)ResourceManager::getInstance()->load(dMap, IMAGE); 299 301 } 300 302
Note: See TracChangeset
for help on using the changeset viewer.