Index: /trunk/src/lib/graphics/importer/grid.cc
===================================================================
--- /trunk/src/lib/graphics/importer/grid.cc	(revision 6466)
+++ /trunk/src/lib/graphics/importer/grid.cc	(revision 6467)
@@ -33,6 +33,6 @@
   this->_sizeX = sizeX;
   this->_sizeY = sizeY;
-  this->_gridSpacingX = sizeX / rows;
-  this->_gridSpacingY = sizeY / columns;
+  this->_gridSpacingX = sizeX / (float)rows;
+  this->_gridSpacingY = sizeY / (float)columns;
 }
 
@@ -53,9 +53,27 @@
     for (unsigned int j = 1; j < this->_columns-1; j++)
     {
-     Vector test(
-          (this->vertex(i*_columns+j).y + this->vertex((i-1)*_columns+j).y - this->vertex((i+1)*_columns+j).y ) /maxHeight,
-          1.0,
-          (this->vertex(i*_columns+j).y - this->vertex(i*_columns+j-1).y + this->vertex(i*_columns+j+1).y)/maxHeight
-                );
+/*
+      Vector test( this->_gridSpacingX/(this->vertex(i*_columns+j).y - this->vertex(i*_columns+j-1).y) +
+          this->_gridSpacingX/(this->vertex(i*_columns+j+1).y - this->vertex(i*_columns+j).y)
+          ,
+      _gridSpacingX,
+      this->_gridSpacingY/(this->vertex(i*_columns+j).y - this->vertex((i-1)*_columns+j).y) +
+          this->_gridSpacingX/(this->vertex((i+1)*_columns+j).y - this->vertex(i*_columns+j).y)
+                 );*/
+
+
+
+      Vector test  (
+          (-this->vertex(i*_columns+j-1).y - this->vertex(i*_columns+j+1).y)/maxHeight,
+            1.0,
+            (-this->vertex((i-1)*_columns+j).y - this->vertex((i+1)*_columns+j).y)/maxHeight
+          );
+
+
+//      Vector test(
+//           (this->vertex(i*_columns+j).y + this->vertex((i-1)*_columns+j).y - this->vertex((i+1)*_columns+j).y ) /maxHeight,
+//           1.0,
+//           (this->vertex(i*_columns+j).y - this->vertex(i*_columns+j-1).y + this->vertex(i*_columns+j+1).y)/maxHeight
+//                 );
       this->normal( i*_columns+j) = test.getNormalized();
     }
Index: /trunk/src/lib/graphics/importer/material.cc
===================================================================
--- /trunk/src/lib/graphics/importer/material.cc	(revision 6466)
+++ /trunk/src/lib/graphics/importer/material.cc	(revision 6467)
@@ -274,5 +274,5 @@
  * @param dMap the Name of the Image to Use
 */
-void Material::setDiffuseMap(const char* dMap)
+void Material::setDiffuseMap(const char* dMap, GLenum target)
 {
   PRINTF(5)("setting Diffuse Map %s\n", dMap);
@@ -283,5 +283,5 @@
   //! @todo Textures from .mtl-file need special care.
   if (dMap!= NULL)
-    this->diffuseTexture = (Texture*)ResourceManager::getInstance()->load(dMap, IMAGE, RP_GAME);
+    this->diffuseTexture = (Texture*)ResourceManager::getInstance()->load(dMap, IMAGE, RP_GAME, (void*)&target);
   else
     this->diffuseTexture = NULL;
@@ -293,5 +293,5 @@
    @todo implement this
 */
-void Material::setAmbientMap(const char* aMap)
+void Material::setAmbientMap(const char* aMap, GLenum target)
 {
   SDL_Surface* ambientMap;
@@ -304,5 +304,5 @@
    @todo implement this
 */
-void Material::setSpecularMap(const char* sMap)
+void Material::setSpecularMap(const char* sMap, GLenum target)
 {
   SDL_Surface* specularMap;
Index: /trunk/src/lib/graphics/importer/material.h
===================================================================
--- /trunk/src/lib/graphics/importer/material.h	(revision 6466)
+++ /trunk/src/lib/graphics/importer/material.h	(revision 6467)
@@ -44,7 +44,7 @@
 
  // MAPPING //
-  void setDiffuseMap(const char* dMap);
-  void setAmbientMap(const char* aMap);
-  void setSpecularMap(const char* sMap);
+  void setDiffuseMap(const char* dMap, GLenum target = GL_TEXTURE_2D);
+  void setAmbientMap(const char* aMap, GLenum target = GL_TEXTURE_2D);
+  void setSpecularMap(const char* sMap, GLenum target = GL_TEXTURE_2D);
   void setBump(const char* bump);
 
Index: /trunk/src/util/loading/resource_manager.cc
===================================================================
--- /trunk/src/util/loading/resource_manager.cc	(revision 6466)
+++ /trunk/src/util/loading/resource_manager.cc	(revision 6467)
@@ -407,4 +407,8 @@
 #ifndef NO_TEXTURES
         case IMAGE:
+          if (param1 != NULL)
+            tmpResource->texTarget = *(GLenum*)param1;
+          else
+            tmpResource->texTarget = GL_TEXTURE_2D;
           if(isFile(fullName))
             {
@@ -422,5 +426,5 @@
                     {
                       PRINTF(4)("Image %s resides to %s\n", fileName, imgName);
-                      tmpResource->pointer = new Texture(imgName);
+                      tmpResource->pointer = new Texture(imgName, tmpResource->texTarget);
                       delete[] imgName;
                       break;
@@ -666,4 +670,14 @@
                   match = true;
 #endif /* NO_SHADERS */
+#ifndef NO_TEXTURES
+              case IMAGE:
+                if (!param1)
+                {
+                  if ((*resource)->texTarget == GL_TEXTURE_2D)
+                    match = true;
+                }
+                else if ((*resource)->texTarget ==  *(GLenum*)param1)
+                  match = true;
+#endif /* NO_TEXTURES */
             default:
               match = true;
Index: /trunk/src/util/loading/resource_manager.h
===================================================================
--- /trunk/src/util/loading/resource_manager.h	(revision 6466)
+++ /trunk/src/util/loading/resource_manager.h	(revision 6467)
@@ -81,4 +81,7 @@
   unsigned int      ttfSize;           //!< the size of the ttf-font (TTF)
 #endif /* NO_TEXT */
+#ifndef NO_TEXTURES
+  GLenum            texTarget;
+#endif /* NO_TEXTURES */
 };
 
Index: /trunk/src/world_entities/environments/water.cc
===================================================================
--- /trunk/src/world_entities/environments/water.cc	(revision 6466)
+++ /trunk/src/world_entities/environments/water.cc	(revision 6467)
@@ -23,4 +23,8 @@
 #include "material.h"
 
+#include "resource_manager.h"
+#include "shader.h"
+
+
 using namespace std;
 
@@ -43,4 +47,6 @@
   this->rebuildGrid();
   this->waterMaterial = new Material();
+  this->waterShader = (Shader*)ResourceManager::getInstance()->load("shaders/water.vert", SHADER, RP_GAME, (void*)"shaders/water.frag");
+
 }
 
@@ -97,6 +103,8 @@
 void Water::draw() const
 {
-  this->waterMaterial->select();
+  this->waterShader->activateShader();
+//  this->waterMaterial->select();
   WorldEntity::draw();
+  Shader::deactivateShader();
 }
 
@@ -109,5 +117,5 @@
     {
       this->grid->height(i,j) = this->height*sin(((float)i/(float)this->grid->rows() *phase)+
-          this->height*cos((float)j/(float)this->grid->columns()) * phase);
+          this->height*cos((float)j/(float)this->grid->columns()) * phase * 2.0);
     }
   }
Index: /trunk/src/world_entities/environments/water.h
===================================================================
--- /trunk/src/world_entities/environments/water.h	(revision 6466)
+++ /trunk/src/world_entities/environments/water.h	(revision 6467)
@@ -16,4 +16,5 @@
 class Material;
 class Grid;
+class Shader;
 
 //! A Class to handle a WaterEffects
@@ -37,4 +38,5 @@
     Grid*           grid;            //!< The water-surface-model to render with
     Material*       waterMaterial;
+    Shader*         waterShader;
     float           height;          //!< The hight of the Water
 
