Changeset 6860 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- Jan 30, 2006, 5:24:31 AM (19 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/environments/water.cc
r6815 r6860 183 183 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 184 184 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(); 196 198 this->grid->draw(); 197 199 // this->waterShader->activateShader(); … … 199 201 //Shader::deactivateShader(); 200 202 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); 204 206 205 207 glPopMatrix(); -
trunk/src/world_entities/skybox.cc
r6815 r6860 168 168 } 169 169 170 171 #include "resource_manager.h" 172 170 173 void SkyBox::loadCubeMapTextures(const char* top, const char* bottom, const char* left, 171 174 const char* right, const char* front, const char* back) 172 175 { 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); 179 182 } 180 183 181 184 void SkyBox::enableCubeMap() 182 185 { 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 184 190 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 188 192 glEnable(GL_TEXTURE_GEN_S); 189 193 glEnable(GL_TEXTURE_GEN_T); … … 194 198 void SkyBox::disableCubeMap() 195 199 { 196 glDisable(GL_TEXTURE_CUBE_MAP _EXT);200 glDisable(GL_TEXTURE_CUBE_MAP); 197 201 glDisable(GL_TEXTURE_2D); 198 202 glDisable(GL_TEXTURE_GEN_S);
Note: See TracChangeset
for help on using the changeset viewer.