Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6860 in orxonox.OLD for trunk/src/world_entities


Ignore:
Timestamp:
Jan 30, 2006, 5:24:31 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: hmm… do not know

Location:
trunk/src/world_entities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/environments/water.cc

    r6815 r6860  
    183183    glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
    184184
    185     if (State::getSkyBox())
    186     {
    187       glBindTexture(GL_TEXTURE_2D, State::getSkyBox()->getTexture(SKY_RIGHT));
    188       glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
    189 
    190       glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
    191       glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
    192       glEnable(GL_TEXTURE_GEN_S);
    193       glEnable(GL_TEXTURE_GEN_T);
    194     }
    195     glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
     185//     if (State::getSkyBox())
     186//     {
     187//       glBindTexture(GL_TEXTURE_2D, State::getSkyBox()->getTexture(SKY_RIGHT));
     188//       glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
     189//
     190//       glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
     191//       glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
     192//       glEnable(GL_TEXTURE_GEN_S);
     193//       glEnable(GL_TEXTURE_GEN_T);
     194//     }
     195//     glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
     196
     197    SkyBox::enableCubeMap();
    196198    this->grid->draw();
    197199    // this->waterShader->activateShader();
     
    199201    //Shader::deactivateShader();
    200202
    201     //SkyBox::disableCubeMap();
    202     glDisable(GL_TEXTURE_GEN_S);
    203     glDisable(GL_TEXTURE_GEN_T);
     203    SkyBox::disableCubeMap();
     204//     glDisable(GL_TEXTURE_GEN_S);
     205//     glDisable(GL_TEXTURE_GEN_T);
    204206
    205207    glPopMatrix();
  • trunk/src/world_entities/skybox.cc

    r6815 r6860  
    168168}
    169169
     170
     171#include "resource_manager.h"
     172
    170173void SkyBox::loadCubeMapTextures(const char* top, const char* bottom, const char* left,
    171174                                  const char* right, const char* front, const char* back)
    172175{
    173   this->cubeTexture[0] = new Texture (top, GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT);
    174   this->cubeTexture[1] = new Texture (bottom, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT);
    175   this->cubeTexture[2] = new Texture (left, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT);
    176   this->cubeTexture[3] = new Texture (right, GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT);
    177   this->cubeTexture[4] = new Texture (front, GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT);
    178   this->cubeTexture[5] = new Texture (back, GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT);
     176  this->cubeTexture[0] = (Texture*)ResourceManager::getInstance()->load(top, RP_LEVEL, IMAGE, GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT);
     177  this->cubeTexture[1] = (Texture*)ResourceManager::getInstance()->load(bottom, RP_LEVEL, IMAGE, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT);
     178  this->cubeTexture[2] = (Texture*)ResourceManager::getInstance()->load(left, RP_LEVEL, IMAGE, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT);
     179  this->cubeTexture[3] = (Texture*)ResourceManager::getInstance()->load(right, RP_LEVEL, IMAGE, GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT);
     180  this->cubeTexture[4] = (Texture*)ResourceManager::getInstance()->load(front, RP_LEVEL, IMAGE, GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT);
     181  this->cubeTexture[5] = (Texture*)ResourceManager::getInstance()->load(back, RP_LEVEL, IMAGE, GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT);
    179182}
    180183
    181184void SkyBox::enableCubeMap()
    182185{
    183   glEnable(GL_TEXTURE_2D);
     186  glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);
     187  glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);
     188  glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);
     189
    184190  glEnable(GL_TEXTURE_CUBE_MAP_EXT);
    185   glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_EXT);
    186   glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_EXT);
    187   glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_EXT);
     191
    188192  glEnable(GL_TEXTURE_GEN_S);
    189193  glEnable(GL_TEXTURE_GEN_T);
     
    194198void SkyBox::disableCubeMap()
    195199{
    196   glDisable(GL_TEXTURE_CUBE_MAP_EXT);
     200  glDisable(GL_TEXTURE_CUBE_MAP);
    197201  glDisable(GL_TEXTURE_2D);
    198202  glDisable(GL_TEXTURE_GEN_S);
Note: See TracChangeset for help on using the changeset viewer.