Index: branches/water/src/world_entities/environments/mapped_water.cc
===================================================================
--- branches/water/src/world_entities/environments/mapped_water.cc	(revision 8090)
+++ branches/water/src/world_entities/environments/mapped_water.cc	(revision 8095)
@@ -40,11 +40,11 @@
   // set up refleciton texture
   //mat.setDiffuseMap(this->texture, 0);
-  mat.setDiffuseMap("pictures/dudvmap.bmp", GL_TEXTURE_2D, 0);
+  mat.setDiffuseMap("pictures/refl.jpg", GL_TEXTURE_2D, 0);
   // load refraction texture
-  mat.setDiffuseMap("pictures/error_texture.png", GL_TEXTURE_2D, 1);
+  mat.setDiffuseMap("pictures/refr.jpg", GL_TEXTURE_2D, 1);
   // load normal map
-  //mat.setDiffuseMap("pictures/normalmap.bmp", GL_TEXTURE_2D, 2);
+  mat.setDiffuseMap("pictures/normalmap.bmp", GL_TEXTURE_2D, 2);
   // load dudv map
-  //mat.setDiffuseMap("pictures/dudvmap.bmp", GL_TEXTURE_2D, 3);
+  mat.setDiffuseMap("pictures/dudvmap.bmp", GL_TEXTURE_2D, 3);
   // set up depth texture
   //mat.setDiffuseMap("pictures/sky-replace.jpg", GL_TEXTURE_2D, 4);
@@ -94,5 +94,5 @@
   /// initialization of the shaders
   // load shader files
-/*  shader = new Shader( ResourceManager::getInstance()->getDataDir() + "/shaders/mapped_water.vert", ResourceManager::getInstance()->getDataDir() +"/shaders/mapped_water.frag");
+  shader = new Shader( ResourceManager::getInstance()->getDataDir() + "/shaders/mapped_water.vert", ResourceManager::getInstance()->getDataDir() +"/shaders/mapped_water.frag");
 
   this->shader->activateShader();
@@ -106,5 +106,5 @@
   Shader::Uniform(shader, "dudvMap").set(3);
   // Set the variable "depthMap" to correspond to the fifth texture unit
-  Shader::Uniform(shader, "depthMap").set(4);
+  //Shader::Uniform(shader, "depthMap").set(4);
   // Give the variable "waterColor" a blue color
   Shader::Uniform(shader, "waterColor").set(0.1f, 0.2f, 0.4f, 1.0f);
@@ -114,5 +114,5 @@
   cam_uni = new Shader::Uniform(shader, "cameraPos");
 
-  this->shader->deactivateShader();*/
+  this->shader->deactivateShader();
 }
 
@@ -140,14 +140,16 @@
   mat.select();
 
-  ///this->shader->activateShader();
+  this->shader->activateShader();
 
   // reset the camera uniform to the current cam position
   Vector pos = State::getCameraNode()->getAbsCoor();
-  ///cam_uni->set(pos.x, pos.y, pos.z, 1.0f);
+  cam_uni->set(pos.x, pos.y, pos.z, 1.0f);
 
   glBegin(GL_QUADS);
   // The back left vertice for the water
-  glMultiTexCoord2f(GL_TEXTURE0, 0.0f, 0);//g_WaterUV);            // Reflection texture
-  glMultiTexCoord2f(GL_TEXTURE1, 0.0f, 0);//refrUV - move);        // Refraction texture
+ // glMultiTexCoord2f(GL_TEXTURE0, 0.0f, 0);//g_WaterUV);            // Reflection texture
+ // glMultiTexCoord2f(GL_TEXTURE1, 0.0f, 0);//refrUV - move);        // Refraction texture
+  glMultiTexCoord2f(GL_TEXTURE0, 0.0f, g_WaterUV);            // Reflection texture
+  glMultiTexCoord2f(GL_TEXTURE1, 0.0f, refrUV - move);        // Refraction texture
   glMultiTexCoord2f(GL_TEXTURE2, 0.0f, normalUV + move2);     // Normal map texture
   glMultiTexCoord2f(GL_TEXTURE3, 0, 0);                       // DUDV map texture
@@ -156,6 +158,8 @@
 
   // The front left vertice for the water
-  glMultiTexCoord2f(GL_TEXTURE0, 0.0f, 1);//0.0f);                  // Reflection texture
-  glMultiTexCoord2f(GL_TEXTURE1, 0.0f, 1);//0.0f - move);           // Refraction texture
+ // glMultiTexCoord2f(GL_TEXTURE0, 0.0f, 1);//0.0f);                  // Reflection texture
+ // glMultiTexCoord2f(GL_TEXTURE1, 0.0f, 1);//0.0f - move);           // Refraction texture
+  glMultiTexCoord2f(GL_TEXTURE0, 0.0f, 0.0f);                  // Reflection texture
+  glMultiTexCoord2f(GL_TEXTURE1, 0.0f, 0.0f - move);           // Refraction texture
   glMultiTexCoord2f(GL_TEXTURE2, 0.0f, 0.0f + move2);          // Normal map texture
   glMultiTexCoord2f(GL_TEXTURE3, 0, 0);                        // DUDV map texture
@@ -164,6 +168,8 @@
 
   // The front right vertice for the water
-  glMultiTexCoord2f(GL_TEXTURE0, 1,1); //g_WaterUV, 0.0f);             // Reflection texture
-  glMultiTexCoord2f(GL_TEXTURE1, 1,1);//refrUV, 0.0f - move);         // Refraction texture
+//  glMultiTexCoord2f(GL_TEXTURE0, 1,1); //g_WaterUV, 0.0f);             // Reflection texture
+ // glMultiTexCoord2f(GL_TEXTURE1, 1,1);//refrUV, 0.0f - move);         // Refraction texture
+  glMultiTexCoord2f(GL_TEXTURE0, g_WaterUV, 0.0f);             // Reflection texture
+  glMultiTexCoord2f(GL_TEXTURE1, refrUV, 0.0f - move);         // Refraction texture
   glMultiTexCoord2f(GL_TEXTURE2, normalUV, 0.0f + move2);      // Normal map texture
   glMultiTexCoord2f(GL_TEXTURE3, 0, 0);                        // DUDV map texture
@@ -172,6 +178,8 @@
 
   // The back right vertice for the water
-  glMultiTexCoord2f(GL_TEXTURE0, 1,0);//g_WaterUV, g_WaterUV);        // Reflection texture
-  glMultiTexCoord2f(GL_TEXTURE1, 1,0);//refrUV, refrUV - move);       // Refraction texture
+ // glMultiTexCoord2f(GL_TEXTURE0, 1,0);//g_WaterUV, g_WaterUV);        // Reflection texture
+ // glMultiTexCoord2f(GL_TEXTURE1, 1,0);//refrUV, refrUV - move);       // Refraction texture
+  glMultiTexCoord2f(GL_TEXTURE0, g_WaterUV, g_WaterUV);        // Reflection texture
+  glMultiTexCoord2f(GL_TEXTURE1, refrUV, refrUV - move);       // Refraction texture
   glMultiTexCoord2f(GL_TEXTURE2, normalUV, normalUV + move2);  // Normal map texture
   glMultiTexCoord2f(GL_TEXTURE3, 0, 0);                        // DUDV map texture
@@ -180,5 +188,5 @@
   glEnd();
 
-  ///this->shader->deactivateShader();
+  this->shader->deactivateShader();
 
   mat.unselect();
@@ -293,5 +301,5 @@
 
   mat.select();
-  //mat.renderToTexture(1, GL_TEXTURE_2D, 0, 0, 0, 0, 0, textureSize, textureSize);
+  mat.renderToTexture(1, GL_TEXTURE_2D, 0, 0, 0, 0, 0, textureSize, textureSize);
   //glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, 0, 0, textureSize, textureSize, 0);
   //mat.renderToTexture(0, GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, 0, textureSize, textureSize, 0);
