Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 16, 2005, 1:33:19 PM (20 years ago)
Author:
bensch
Message:

orxonox/branches/openAL: merged trunk back to openAL
merged with command:

svn merge ../trunk/ openAL/ -r 3920:HEAD

no conflicts at all

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
  • orxonox/branches/openAL/src/lib/graphics/importer/material.cc

    r3914 r4194  
    4545  this->setTransparency(1.0);
    4646
    47 
    4847  this->diffuseTexture = NULL;
    4948  this->ambientTexture = NULL;
    5049  this->specularTexture = NULL;
    51 
    52   this->diffuseTextureSet = false;
    53   this->ambientTextureSet = false;
    54   this->specularTextureSet = false;
    5550
    5651  this->setName(mtlName);
     
    8883 
    8984  // setting the transparency
    90   if (this->transparency == 1.0)
    91     {
    92       glDisable(GL_BLEND);
    93     }
    94   else
     85  if (this->transparency < 1.0)
    9586    {
    9687      glEnable(GL_BLEND);
     
    9889      glBlendFunc(GL_SRC_ALPHA, GL_ONE);
    9990    }
     91  else
     92    {
     93      glDisable(GL_BLEND);
     94      glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
     95    }
     96
    10097
    10198  // setting illumination Model
     
    105102    glShadeModel(GL_SMOOTH);
    106103
    107   if (this->diffuseTextureSet)
     104  if (this->diffuseTexture)
    108105    {
    109106      glEnable(GL_TEXTURE_2D);
    110107      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        }
    111115    }
    112116  else
     
    291295{
    292296  PRINTF(4)("setting Diffuse Map %s\n", dMap);
    293   //    diffuseTexture = new Texture();
    294   //    this->diffuseTextureSet = diffuseTexture->loadImage(dMap);
    295297
    296298  //! \todo check if RESOURCE MANAGER is availiable
    297299  //! \todo Textures from .mtl-file need special care.
    298   this->diffuseTextureSet = this->diffuseTexture = (Texture*)ResourceManager::getInstance()->load(dMap, IMAGE);
     300  this->diffuseTexture = (Texture*)ResourceManager::getInstance()->load(dMap, IMAGE);
    299301}
    300302
Note: See TracChangeset for help on using the changeset viewer.