Changeset 8484 in orxonox.OLD for branches/water
- Timestamp:
- Jun 15, 2006, 5:26:56 PM (19 years ago)
- Location:
- branches/water/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/water/src/lib/graphics/importer/material.cc
r8376 r8484 352 352 assert(textureNumber < this->textures.size()); 353 353 354 // HACK 355 glActiveTexture(textureNumber); 356 glEnable(GL_TEXTURE_2D); 357 glBindTexture(GL_TEXTURE_2D, this->textures[textureNumber].getTexture()); 354 glEnable(GL_TEXTURE_2D); 355 glBindTexture(GL_TEXTURE_2D, this->textures[textureNumber].getTexture()); 358 356 glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); 359 357 -
branches/water/src/world_entities/environments/mapped_water.cc
r8483 r8484 109 109 110 110 /// initialization of the shaders 111 this->initShaders(); 112 113 /// fog, doesnt work the way i want it to work 114 /*this->fog = new FogEffect(); 115 fog->setFogColor(0.1f, 0.2f, 0.4f); 116 fog->setFogRange(0.0f, 500.0f); 117 fog->setFogDensity(0.03f);*/ 118 } 119 120 /** 121 * @brief deltes shader and the uniform used by the camera 122 */ 123 MappedWater::~MappedWater() 124 { 125 delete shader; 126 delete cam_uni; 127 //delete fog; 128 } 129 130 /** 131 * @brief initialization of the shaders 132 */ 133 void MappedWater::initShaders() 134 { 111 135 // load shader files 112 136 shader = new Shader( ResourceManager::getInstance()->getDataDir() + "/shaders/mapped_water.vert", ResourceManager::getInstance()->getDataDir() +"/shaders/mapped_water.frag"); … … 131 155 132 156 this->shader->deactivateShader(); 133 134 /// fog, doesnt work the way i want it to work135 /*this->fog = new FogEffect();136 fog->setFogColor(0.1f, 0.2f, 0.4f);137 fog->setFogRange(0.0f, 500.0f);138 fog->setFogDensity(0.03f);*/139 }140 141 /**142 * @brief deltes shader and the uniform used by the camera143 */144 MappedWater::~MappedWater()145 {146 delete shader;147 delete cam_uni;148 //delete fog;149 157 } 150 158 … … 299 307 glCullFace(GL_BACK); 300 308 301 glBindTexture(GL_TEXTURE_2D, this->mat.getDiffuseTexture(0));302 303 309 // Create the texture and store it on the video card 304 glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, textureSize, textureSize);310 mat.renderToTexture(0, GL_TEXTURE_2D, 0, 0, 0, 0, 0, textureSize, textureSize); 305 311 306 312 glPopMatrix(); … … 356 362 glCullFace(GL_BACK); 357 363 358 glBindTexture(GL_TEXTURE_2D, this->mat.getDiffuseTexture(1));359 360 364 // Create the texture and store it on the video card 361 glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, textureSize, textureSize);365 mat.renderToTexture(1, GL_TEXTURE_2D, 0, 0, 0, 0, 0, textureSize, textureSize); 362 366 363 367 glPopMatrix(); -
branches/water/src/world_entities/environments/mapped_water.h
r8483 r8484 48 48 49 49 private: 50 void initShaders(); 51 52 private: 50 53 Vector waterPos; //!< position of the water 51 54 float xWidth, zWidth; //!< size of the water quad
Note: See TracChangeset
for help on using the changeset viewer.