Index: trunk/src/world_entities/environments/mapped_water.cc
===================================================================
--- trunk/src/world_entities/environments/mapped_water.cc	(revision 8783)
+++ trunk/src/world_entities/environments/mapped_water.cc	(revision 8792)
@@ -19,4 +19,5 @@
 #include "util/loading/resource_manager.h"
 #include "state.h"
+#include "math.h"
 
 
@@ -44,4 +45,6 @@
   /// initialization of the shaders
   this->initShaders();
+  
+  tempcounter = 0;
 }
 
@@ -53,4 +56,7 @@
   delete shader;
   delete cam_uni;
+  delete color_uni;
+  delete light_uni;
+  delete shine_uni;
 }
 
@@ -68,4 +74,6 @@
   this->setWaterAngle(0);
   this->setNormalMapScale(0.25f);
+  this->setWaterColor(0.1f, 0.2f, 0.4f);
+  this->setShininess(128);
 
   // initialization of the texture coords, speeds etc...
@@ -75,4 +83,6 @@
   this->move = 0;
   this->move2 = this->move * this->kNormalMapScale;
+
+
 }
 
@@ -132,7 +142,12 @@
   Shader::Uniform(shader, "depthMap").set(2);
   // Give the variable "waterColor" a blue color
-  Shader::Uniform(shader, "waterColor").set(0.1f, 0.2f, 0.4f, 1.0f);
+  color_uni = new Shader::Uniform(shader, "waterColor");
+  color_uni->set(waterColor.x, waterColor.y, waterColor.z, 1.0f);
   // Give the variable "lightPos" our hard coded light position
-  Shader::Uniform(shader, "lightPos").set(lightPos.x, lightPos.y, lightPos.z, 1.0f);
+  light_uni = new Shader::Uniform(shader, "lightPos");
+  light_uni->set(lightPos.x, lightPos.y, lightPos.z, 1.0f);
+  // Set the variable "shine"
+  shine_uni = new Shader::Uniform(shader, "kShine");
+  shine_uni->set(this->shininess);
   // uniform for the camera position
   cam_uni = new Shader::Uniform(shader, "cameraPos");
@@ -140,4 +155,53 @@
   this->shader->deactivateShader();
 }
+
+/**
+ * @brief resets the waterColor in the Shader
+ * @param r new value for red
+ * @param g new value for green
+ * @param b new value for blue
+ */
+void MappedWater::resetWaterColor(float r, float g, float b)
+{
+  this->shader->activateShader();
+  this->waterColor = Vector(r, g, b);
+
+  // Give the variable "waterColor" a color
+  color_uni->set(waterColor.x, waterColor.y, waterColor.z, 1.0f);
+
+  this->shader->deactivateShader();
+};
+
+/**
+ * @brief resets the shininess in the Shader
+ * @param shine new value for the shininess
+ */
+void MappedWater::resetShininess(float shine)
+{
+  this->shader->activateShader();
+  this->shininess = shine;
+
+  // Set the variable "shine"
+  shine_uni->set(this->shininess);
+
+  this->shader->deactivateShader();
+};
+
+/**
+ * @brief resets the lightPos in the Shader
+ * @param x new x value
+ * @param y new y value
+ * @param z new z value
+ */
+void MappedWater::resetLightPos(float x, float y, float z)
+{
+  this->shader->activateShader();
+  this->lightPos = Vector(x, y, z);
+
+  // Give the variable "lightPos" our hard coded light position
+  light_uni->set(lightPos.x, lightPos.y, lightPos.z, 1.0f);
+
+  this->shader->deactivateShader();
+};
 
 /**
@@ -156,4 +220,6 @@
   LoadParam(root, "normalmapscale", this, MappedWater, setNormalMapScale);
   LoadParam(root, "waterangle", this, MappedWater, setWaterAngle);
+  LoadParam(root, "watercolor", this, MappedWater, setWaterColor);
+  LoadParam(root, "shininess", this, MappedWater, setShininess);
 }
 
@@ -224,4 +290,14 @@
   this->move += this->waterFlow * dt;
   this->move2 = this->move * this->kNormalMapScale;
+  
+
+//   if(this->tempcounter == 200) {
+//     this->resetWaterColor(1, 0, 0);
+//     resetShininess(1);
+//     resetLightPos(0, 50, 0);
+//     PRINTF(0)("test waterchangecolor ");
+//     }
+//   tempcounter++;
+    
 }
 
Index: trunk/src/world_entities/environments/mapped_water.h
===================================================================
--- trunk/src/world_entities/environments/mapped_water.h	(revision 8783)
+++ trunk/src/world_entities/environments/mapped_water.h	(revision 8792)
@@ -12,4 +12,6 @@
   <waterangle>0</waterangle>
   <normalmapscale>0.25</normalmapscale><!-- you won't see a big differnce if you change that -->
+  <shininess>128</shininess><!-- the bigger the value, the smaller the specular reflection point -->
+  <watercolor>0.1, 0.2, 0.4</watercolor>
 </MappedWater>
 */
@@ -49,4 +51,17 @@
   void setWaterFlow(float flow) { this->waterFlow = flow; };
   void setNormalMapScale(float scale) { this->kNormalMapScale = scale; };
+  void setShininess(float shine) { this->shininess = shine; };
+  void setWaterColor(float r, float g, float b) { this->waterColor = Vector(r,g,b); };
+
+  // functions to change water parameters during runtime
+  // to reset waterUV and waterFlow just use the normal set functions
+  void resetWaterColor(float r, float g, float b);
+  void resetShininess(float shine);
+  void resetLightPos(float x, float y, float z);
+
+  // fade functions
+  void fadeWaterColor(float r, float g, float b, float time);
+  void fadeShininess(float shine, float time);
+  void fadeLightPos(float x, float y, float z, float time);
 
 private:
@@ -60,5 +75,5 @@
   Vector              lightPos;               //!< position of the light that is used to render the reflection
   float               waterAngle;             //!< defines how much the water will be turned around the point waterPos
-
+  Vector              waterColor;             //!< color of the water
   float               move;                   //!< textures coords, speeds, positions for the shaded textures....
   float               move2;
@@ -67,4 +82,5 @@
   float               normalUV;
   float               kNormalMapScale;
+  float               shininess;              //!< the bigger the value, the smaller the specular reflection point
 
   int                 textureSize;            //!< height and width of the texture
@@ -72,4 +88,10 @@
   Shader*             shader;
   Shader::Uniform*    cam_uni;                //!< uniform that is used for the camera position
+  Shader::Uniform*    light_uni;              //!< uniform that is used for the light position
+  Shader::Uniform*    color_uni;              //!< uniform that is used for the watercolor
+  Shader::Uniform*    shine_uni;              //!< uniform that is used for the specular shininessd of the water
+  
+  
+  int tempcounter;
 };
 
