Index: /branches/mountain_lake/src/lib/graphics/effects/cloud_effect.cc
===================================================================
--- /branches/mountain_lake/src/lib/graphics/effects/cloud_effect.cc	(revision 8836)
+++ /branches/mountain_lake/src/lib/graphics/effects/cloud_effect.cc	(revision 8837)
@@ -26,4 +26,5 @@
 #include "shader.h"
 #include "shell_command.h"
+#include "t_animation.h"
 
 #include "parser/tinyxml/tinyxml.h"
@@ -34,4 +35,8 @@
 Vector  CloudEffect::newSkyColor;
 
+bool CloudEffect::fadeSky;
+bool CloudEffect::fadeCloud;
+float CloudEffect::fadeTime;
+
 using namespace std;
 
@@ -68,5 +73,5 @@
 {
   PRINTF(0)("Initializing CloudEffect\n");
-
+  
   this->offsetZ = 0;
   this->animationSpeed = 2;
@@ -75,4 +80,6 @@
   this->planetRadius = 1500;
   this->divs = 50;
+  fadeSky = false;
+  fadeCloud = false;
 
   skyColor = Vector(0.0f, 0.0f, 0.8f);
@@ -80,5 +87,4 @@
   newSkyColor = skyColor;
   newCloudColor = cloudColor;
-  this->fadeTime = 3;
 
   this->noise3DTexSize = 128;
@@ -176,16 +182,63 @@
     this->offset->set(0.0f, 0.0f, offsetZ);
     
-    //if(cloudColor != newCloudColor)
-    //{
-      // TODO: fade from cloudColor to newCloudColor
-      cloudColor = newCloudColor;
+    if(cloudColor != newCloudColor)
+    {
+      if(fadeCloud)
+      { 
+        this->cloudColorFadeX = new tAnimation<CloudEffect>(this, &CloudEffect::setColorCloudX);
+        this->cloudColorFadeX->setInfinity(ANIM_INF_CONSTANT);
+        this->cloudColorFadeY = new tAnimation<CloudEffect>(this, &CloudEffect::setColorCloudY);
+        this->cloudColorFadeY->setInfinity(ANIM_INF_CONSTANT);
+        this->cloudColorFadeZ = new tAnimation<CloudEffect>(this, &CloudEffect::setColorCloudZ);
+        this->cloudColorFadeZ->setInfinity(ANIM_INF_CONSTANT);
+        
+        this->cloudColorFadeX->addKeyFrame(cloudColor.x, fadeTime, ANIM_LINEAR);
+        this->cloudColorFadeX->addKeyFrame(newCloudColor.x, 0, ANIM_LINEAR);
+  
+        this->cloudColorFadeY->addKeyFrame(cloudColor.y, fadeTime, ANIM_LINEAR);
+        this->cloudColorFadeY->addKeyFrame(newCloudColor.y, 0, ANIM_LINEAR);
+  
+        this->cloudColorFadeZ->addKeyFrame(cloudColor.z, fadeTime, ANIM_LINEAR);
+        this->cloudColorFadeZ->addKeyFrame(newCloudColor.z, 0, ANIM_LINEAR);
+        
+        fadeCloud = false;
+        
+        this->cloudColorFadeX->replay();
+        this->cloudColorFadeY->replay();
+        this->cloudColorFadeZ->replay();
+      }
+      
       this->cloudcolor->set(this->cloudColor.x, this->cloudColor.y, this->cloudColor.z);
-    //}
-    //if(cloudColor != newCloudColor)
-    //{
-      // TODO: fade from skyColor to newSkyColor
-      skyColor = newSkyColor;
+    }
+
+    if(skyColor != newSkyColor)
+    { 
+      if(fadeSky)
+      { 
+        this->skyColorFadeX = new tAnimation<CloudEffect>(this, &CloudEffect::setColorSkyX);
+        this->skyColorFadeX->setInfinity(ANIM_INF_CONSTANT);
+        this->skyColorFadeY = new tAnimation<CloudEffect>(this, &CloudEffect::setColorSkyY);
+        this->skyColorFadeY->setInfinity(ANIM_INF_CONSTANT);
+        this->skyColorFadeZ = new tAnimation<CloudEffect>(this, &CloudEffect::setColorSkyZ);
+        this->skyColorFadeZ->setInfinity(ANIM_INF_CONSTANT);
+        
+        this->skyColorFadeX->addKeyFrame(skyColor.x, fadeTime, ANIM_LINEAR);
+        this->skyColorFadeX->addKeyFrame(newSkyColor.x, 0, ANIM_LINEAR);
+  
+        this->skyColorFadeY->addKeyFrame(skyColor.y, fadeTime, ANIM_LINEAR);
+        this->skyColorFadeY->addKeyFrame(newSkyColor.y, 0, ANIM_LINEAR);
+  
+        this->skyColorFadeZ->addKeyFrame(skyColor.z, fadeTime, ANIM_LINEAR);
+        this->skyColorFadeZ->addKeyFrame(newSkyColor.z, 0, ANIM_LINEAR);
+        
+        fadeSky = false;
+        
+        this->skyColorFadeX->replay();
+        this->skyColorFadeY->replay();
+        this->skyColorFadeZ->replay();
+      }
+      
       this->skycolor->set(this->skyColor.x, this->skyColor.y, this->skyColor.z);
-    //}
+    }
     
     this->shader->deactivateShader();
@@ -194,13 +247,42 @@
 
 
-void CloudEffect::changeSkyColor(Vector color)
+void CloudEffect::setColorSkyX(float color)
+{
+  skyColor.x = color;
+}
+void CloudEffect::setColorSkyY(float color)
+{
+  skyColor.y = color;
+}
+void CloudEffect::setColorSkyZ(float color)
+{
+  skyColor.z = color;
+}
+void CloudEffect::setColorCloudX(float color)
+{
+  cloudColor.x = color;
+}
+void CloudEffect::setColorCloudY(float color)
+{
+  cloudColor.y = color;
+}
+void CloudEffect::setColorCloudZ(float color)
+{
+  cloudColor.z = color;
+}
+
+void CloudEffect::changeSkyColor(Vector color, float time)
 {
   newSkyColor = color;
-}
-
-
-void CloudEffect::changeCloudColor(Vector color)
+  fadeSky = true;
+  fadeTime = time;
+}
+
+
+void CloudEffect::changeCloudColor(Vector color, float time)
 {
   newCloudColor = color;
+  fadeCloud = true;
+  fadeTime = time;
 }
 
Index: /branches/mountain_lake/src/lib/graphics/effects/cloud_effect.h
===================================================================
--- /branches/mountain_lake/src/lib/graphics/effects/cloud_effect.h	(revision 8836)
+++ /branches/mountain_lake/src/lib/graphics/effects/cloud_effect.h	(revision 8837)
@@ -31,4 +31,7 @@
 #define at2(rx,ry) ( rx * q[0] + ry * q[1] )
 #define at3(rx,ry,rz) ( rx * q[0] + ry * q[1] + rz * q[2] )
+
+// FORWARD DECLARATION
+template <class T> class tAnimation;
 
 
@@ -82,6 +85,13 @@
   virtual void tick(float dt);
 
-  static void changeSkyColor(Vector color);
-  static void changeCloudColor(Vector color);
+  static void changeSkyColor(Vector color, float time);
+  static void changeCloudColor(Vector color, float time);
+  
+  void setColorSkyX(float color);
+  void setColorSkyY(float color);
+  void setColorSkyZ(float color);
+  void setColorCloudX(float color);
+  void setColorCloudY(float color);
+  void setColorCloudZ(float color);
   
   static Vector    cloudColor;
@@ -101,5 +111,4 @@
   bool             cloudActivate;
   float            animationSpeed;
-  float            fadeTime;
   
   static Vector           newSkyColor;
@@ -108,4 +117,14 @@
   // Material                 cloudMaterial;
   Skydome*         skydome;
+  
+  tAnimation<CloudEffect>*  skyColorFadeX;
+  tAnimation<CloudEffect>*  skyColorFadeY;
+  tAnimation<CloudEffect>*  skyColorFadeZ;
+  tAnimation<CloudEffect>*  cloudColorFadeX;
+  tAnimation<CloudEffect>*  cloudColorFadeY;
+  tAnimation<CloudEffect>*  cloudColorFadeZ;
+  static bool fadeSky;
+  static bool fadeCloud;
+  static float fadeTime;
 
   // SHADER STUFF
Index: /branches/mountain_lake/src/lib/graphics/effects/rain_effect.cc
===================================================================
--- /branches/mountain_lake/src/lib/graphics/effects/rain_effect.cc	(revision 8836)
+++ /branches/mountain_lake/src/lib/graphics/effects/rain_effect.cc	(revision 8837)
@@ -103,5 +103,5 @@
   this->rainFadeOutDuration = 0;
   
-  this->cloudColor = Vector(0.8f, 0.8f, 0.8f);
+  this->cloudColor = Vector(0.6f, 0.6f, 0.6f);
   this->skyColor = Vector(0.0f, 0.0f, 0.0f);
 
@@ -180,13 +180,10 @@
   if (this->rainWindForce != 0)
     this->soundSource.play(this->windBuffer, 0.1f * this->rainWindForce, true);
-
-  if (this->rainFadeInDuration == 0)
-    lightMan->setAmbientColor(.1,.1,.1);
   
   // Change the cloudcolor,skycolor
   this->oldCloudColor = CloudEffect::cloudColor;
   this->oldSkyColor = CloudEffect::skyColor;
-  CloudEffect::changeCloudColor(this->cloudColor);
-  CloudEffect::changeSkyColor(this->skyColor);
+  CloudEffect::changeCloudColor(this->cloudColor, this->rainFadeInDuration);
+  CloudEffect::changeSkyColor(this->skyColor, this->rainFadeInDuration);
 }
 
@@ -207,6 +204,6 @@
   lightMan->setAmbientColor(this->rainAmbient, this->rainAmbient, this->rainAmbient);
   
-  CloudEffect::changeCloudColor(this->oldCloudColor);
-  CloudEffect::changeSkyColor(this->oldSkyColor);
+  CloudEffect::changeCloudColor(this->oldCloudColor, this->rainFadeOutDuration);
+  CloudEffect::changeSkyColor(this->oldSkyColor, this->rainFadeOutDuration);
 }
 
@@ -291,5 +288,5 @@
 
   if (!this->rainFadeInDuration > 0)
-    this->rainFadeInDuration = 20;
+    this->rainFadeInDuration = 10;
 
   this->localTimer = 0;
@@ -308,5 +305,5 @@
 
   if (!this->rainFadeOutDuration > 0)
-    this->rainFadeOutDuration = 20;
+    this->rainFadeOutDuration = 10;
 
   this->localTimer = 0;
