Changeset 8268 in orxonox.OLD for branches/water/src/world_entities/environments
- Timestamp:
- Jun 8, 2006, 4:34:29 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/water/src/world_entities/environments/mapped_water.cc
r8263 r8268 125 125 Shader::Uniform(shader, "dudvMap").set(3); 126 126 // Set the variable "depthMap" to correspond to the fifth texture unit 127 //Shader::Uniform(shader, "depthMap").set(4);127 Shader::Uniform(shader, "depthMap").set(2); 128 128 // Give the variable "waterColor" a blue color 129 129 Shader::Uniform(shader, "waterColor").set(0.1f, 0.2f, 0.4f, 1.0f); … … 173 173 glMultiTexCoord2f(GL_TEXTURE2, 0.0f, normalUV + move2); // Normal map texture 174 174 glMultiTexCoord2f(GL_TEXTURE3, 0, 0); // DUDV map texture 175 glMultiTexCoord2f(GL_TEXTURE4, 0, 0); // Depth texture175 //glMultiTexCoord2f(GL_TEXTURE4, 0, 0); // Depth texture 176 176 glVertex3f(0.0f, waterHeight, 0.0f); 177 177 … … 183 183 glMultiTexCoord2f(GL_TEXTURE2, 0.0f, 0.0f + move2); // Normal map texture 184 184 glMultiTexCoord2f(GL_TEXTURE3, 0, 0); // DUDV map texture 185 glMultiTexCoord2f(GL_TEXTURE4, 0, 0); // Depth texture185 //glMultiTexCoord2f(GL_TEXTURE4, 0, 0); // Depth texture 186 186 glVertex3f(0.0f, waterHeight, 1000.0f); 187 187 … … 193 193 glMultiTexCoord2f(GL_TEXTURE2, normalUV, 0.0f + move2); // Normal map texture 194 194 glMultiTexCoord2f(GL_TEXTURE3, 0, 0); // DUDV map texture 195 glMultiTexCoord2f(GL_TEXTURE4, 0, 0); // Depth texture195 //glMultiTexCoord2f(GL_TEXTURE4, 0, 0); // Depth texture 196 196 glVertex3f(1000.0f, waterHeight, 1000.0f); 197 197 … … 203 203 glMultiTexCoord2f(GL_TEXTURE2, normalUV, normalUV + move2); // Normal map texture 204 204 glMultiTexCoord2f(GL_TEXTURE3, 0, 0); // DUDV map texture 205 glMultiTexCoord2f(GL_TEXTURE4, 0, 0); // Depth texture205 //glMultiTexCoord2f(GL_TEXTURE4, 0, 0); // Depth texture 206 206 glVertex3f(1000.0f, waterHeight, 0.0f); 207 207 glEnd(); … … 269 269 void MappedWater::deactivateReflection() 270 270 { 271 //glDisable(GL_CLIP_PLANE0);271 glDisable(GL_CLIP_PLANE0); 272 272 glCullFace(GL_BACK); 273 273 … … 288 288 289 289 void MappedWater::activateRefraction() 290 { 290 {/* 291 291 // save viewport matrix and change the viewport size 292 292 glPushAttrib(GL_VIEWPORT_BIT); … … 299 299 // In order to line up the reflection nicely with the world we have to translate 300 300 // the world to the position of our reflected surface, multiplied by two. 301 //glEnable(GL_CLIP_PLANE0);301 glEnable(GL_CLIP_PLANE0); 302 302 Vector pos = State::getCameraNode()->getAbsCoor(); 303 303 //pos.debug(); … … 314 314 // Set our plane equation and turn clipping on 315 315 double plane[4] = {0.0, 1.0, 0.0, -waterHeight}; 316 //glClipPlane(GL_CLIP_PLANE0, plane);316 glClipPlane(GL_CLIP_PLANE0, plane); 317 317 } 318 318 else … … 321 321 // but just render it clipped so only the top is drawn. 322 322 double plane[4] = {0.0, 1.0, 0.0, waterHeight}; 323 //glClipPlane(GL_CLIP_PLANE0, plane);324 } 325 326 /* 323 glClipPlane(GL_CLIP_PLANE0, plane); 324 } 325 */ 326 327 327 // To create the refraction and depth textures we do the same thing 328 328 // we did for the reflection texture, except we don't need to turn … … 343 343 344 344 // If the camera is above water, render the data below the water 345 glEnable(GL_CLIP_PLANE 1);345 glEnable(GL_CLIP_PLANE0); 346 346 Vector pos = State::getCameraNode()->getAbsCoor(); 347 347 if(pos.y > waterHeight) … … 358 358 glClipPlane(GL_CLIP_PLANE0, plane); 359 359 } 360 PRINTF(0)("test");*/361 360 } 362 361 363 362 void MappedWater::deactivateRefraction() 364 363 { 365 //glDisable(GL_CLIP_PLANE0);364 glDisable(GL_CLIP_PLANE0); 366 365 glCullFace(GL_BACK); 367 366
Note: See TracChangeset
for help on using the changeset viewer.