Index: branches/atmospheric_engine/src/lib/graphics/effects/fog_effect.cc
===================================================================
--- branches/atmospheric_engine/src/lib/graphics/effects/fog_effect.cc	(revision 8700)
+++ branches/atmospheric_engine/src/lib/graphics/effects/fog_effect.cc	(revision 8702)
@@ -122,7 +122,9 @@
 
     // If Fog Fade
-    if ( this->fogFadeInActivate || this->fogFadeOutActivate )
-        glFogf(GL_FOG_DENSITY, this->fogFadeDensity);
-
+    if ( this->fogFadeInActivate || this->fogFadeOutActivate ) {
+      glDisable(GL_FOG);
+      glFogf(GL_FOG_DENSITY, this->fogFadeDensity);
+      glEnable(GL_FOG);
+    }
 }
 
Index: branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.cc
===================================================================
--- branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.cc	(revision 8700)
+++ branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.cc	(revision 8702)
@@ -1,12 +1,12 @@
 /*
    orxonox - the future of 3D-vertical-scrollers
- 
+
    Copyright (C) 2004 orx
- 
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2, or (at your option)
    any later version.
- 
+
 ### File Specific:
    main-programmer: hdavid, amaechler
@@ -35,6 +35,4 @@
 
 CREATE_FACTORY(LighteningEffect, CL_LIGHTENING_EFFECT);
-
-// TODO: FIx Lightening with Fog enabled
 
 LighteningEffect::LighteningEffect(const TiXmlElement* root)
@@ -80,9 +78,12 @@
   this->lighteningActivate = false;
 
-  this->time = 0.0;
-  this->flashFrequency = 4.0f;
-  this->mainFrequency = 4.0f;
-  this->flashConstTime = 0.1f;
+  this->flashFrequencyBase = 2.0f;
+  this->flashFrequencySeed = 4.0f;
+
+  this->flashHoldTime = 0.1f;
   this->flashRisingTime = 0.03f;
+
+  this->seedX = 500.f;
+  this->seedZ = 1000.0f;
 
   this->width = 700.0f;
@@ -90,14 +91,12 @@
   this->seedWidth = 50.0f;
   this->seedHeight = 50.0f;
-  this->bNewCoordinate = false;
+
   this->lighteningMove = false;
 
-  this->seedX = 500.f;
-  this->seedZ = 1000.0f;
-  this->seedTime = 2.0f;
-
-  this->mainPosX = 3000;
+  this->mainPosX = 2000;
   this->mainPosY = 900;
   this->mainPosZ = 0;
+
+  this->time = 0.0;
 
   // initialize lightening textures
@@ -142,13 +141,8 @@
   this->flashLight->setSpecularColor(0,0,0);
 
-  // this->soundSource = NULL;
-  // this->thunderBuffer = NULL;
-
-  // this->soundSource.setSourceNode(this);
-
   //load sound
   if (this->thunderBuffer != NULL)
     ResourceManager::getInstance()->unload(this->thunderBuffer);
-  this->thunderBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/thunder.wav", WAV);
+  this->thunderBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/thunder.ogg", OGG);
 
 }
@@ -252,5 +246,5 @@
     this->billboard[1]->setVisibiliy(false);
     this->billboard[2]->setVisibiliy(true);
-    
+
   }
   else if( this->billboard[2]->isVisible() && this->time > this->flashRisingTime)
@@ -260,5 +254,5 @@
   }
 
-  if( this->billboard[3]->isVisible() && this->time > this->flashConstTime)
+  if( this->billboard[3]->isVisible() && this->time > this->flashHoldTime)
   {
     this->billboard[3]->setVisibiliy(false);
@@ -266,9 +260,11 @@
     this->flashLight->setDiffuseColor(0,0,0);
     this->flashLight->setSpecularColor(0,0,0);
-    this->bNewCoordinate = true;
-  }
-
-  if( this->bNewCoordinate)
-  {
+
+    this->newCoordinates();
+  }
+}
+
+void LighteningEffect::newCoordinates() {
+
     float posX, posZ;
 
@@ -294,5 +290,5 @@
     this->billboard[3]->setAbsCoor(posX, this->mainPosY, posZ);
 
-    this->flashFrequency = this->mainFrequency + this->seedTime * (float)rand()/(float)RAND_MAX;
+    this->flashFrequency = this->flashFrequencyBase + this->flashFrequencySeed * (float)rand()/(float)RAND_MAX;
 
     float w = this->width + this->seedWidth * (float)rand()/(float)RAND_MAX;
@@ -303,6 +299,3 @@
     this->billboard[2]->setSize(w, h);
     this->billboard[3]->setSize(w, h);
-
-    this->bNewCoordinate = false;
-  }
-}
+}
Index: branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.h
===================================================================
--- branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.h	(revision 8700)
+++ branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.h	(revision 8702)
@@ -34,8 +34,8 @@
 
 		virtual void tick(float dt);
-		
+
 		void coord(float x, float y, float z);
 		void setFlashSize(float width, float height, float seedWidth, float seedHeight);
-		
+
 		inline void setLighteningOption(const std::string& option) {
 			if (option == "activate") this->lighteningActivate = true;
@@ -43,24 +43,24 @@
 		}
 
-		inline void setFlashFrequency(float mainFrequency, float seedTime) {
-			this->mainFrequency = mainFrequency;
-			this->flashFrequency = mainFrequency;
-			this->seedTime = seedTime;
+		inline void setFlashFrequency(float baseFrequency, float seedTime) {
+			this->flashFrequencyBase = baseFrequency;
+			this->flashFrequency = baseFrequency;
+			this->flashFrequencySeed = seedTime;
 		}
-		
-		inline void setFlashConstTime(float flashConstTime) { this->flashConstTime = flashConstTime; }
+
+		inline void setFlashConstTime(float holdTime) { this->flashHoldTime = holdTime; }
 
 		inline void setFlashRisingTime(float flashRisingTime) {
-			if(flashRisingTime > this->flashConstTime)
-				this->flashRisingTime = this->flashConstTime/2;
+			if(flashRisingTime > this->flashHoldTime)
+				this->flashRisingTime = this->flashHoldTime * 0.5;
 			else
 				this->flashRisingTime = flashRisingTime;
 		}
-		
+
 		inline void setFlashSeed(float seedX, float seedZ) {
 			this->seedX = seedX;
 			this->seedZ = seedZ;
 		}
-		
+
 
 	private:
@@ -68,14 +68,11 @@
 		bool lighteningActivate;
 		bool lighteningMove;
-		
+
 		float flashFrequency;
-		float mainFrequency;
-		float flashConstTime;
+		float flashFrequencyBase;
+		float flashHoldTime;
 		float flashRisingTime;
-		
+
 		float time;
-		
-    bool  flashingActive;
-    bool bNewCoordinate;
 
 		float width;
@@ -83,17 +80,19 @@
 		float seedWidth;
 		float seedHeight;
-		
+
 		float seedX;
 		float seedZ;
-		float seedTime;
-		
+		float flashFrequencySeed;
+
 		float mainPosX;
 		float mainPosY;
 		float mainPosZ;
-		
+
+    void newCoordinates();
+
 		Vector cameraCoor;
-		
+
 		Light* flashLight;
-		
+
 		OrxSound::SoundSource    soundSource;
 		OrxSound::SoundBuffer*   thunderBuffer;
Index: branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.cc
===================================================================
--- branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.cc	(revision 8700)
+++ branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.cc	(revision 8702)
@@ -1,12 +1,12 @@
 /*
   orxonox - the future of 3D-vertical-scrollers
-  
+
   Copyright (C) 2004 orx
-  
+
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2, or (at your option)
   any later version.
-  
+
 ### File Specific:
   main-programmer: hdavid, amaechler
@@ -57,5 +57,5 @@
     if (this->rainBuffer != NULL)
         ResourceManager::getInstance()->unload(this->rainBuffer);
-    this->rainBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/rain.wav", WAV);
+    this->rainBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/rain.ogg", OGG);
 
     //load wind sound
@@ -63,5 +63,5 @@
         if (this->windBuffer != NULL)
             ResourceManager::getInstance()->unload(this->windBuffer);
-        this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/wind.wav", WAV);
+        this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/wind.ogg", OGG);
     }
 
Index: branches/atmospheric_engine/src/lib/graphics/effects/snow_effect.cc
===================================================================
--- branches/atmospheric_engine/src/lib/graphics/effects/snow_effect.cc	(revision 8700)
+++ branches/atmospheric_engine/src/lib/graphics/effects/snow_effect.cc	(revision 8702)
@@ -50,5 +50,5 @@
 		if (this->windBuffer != NULL)
 			ResourceManager::getInstance()->unload(this->windBuffer);
-	       		this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/wind.wav", WAV);
+	       		this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/wind.ogg", OGG);
 	}
 
@@ -56,5 +56,5 @@
 		this->activate();
     SnowEffect::snowParticles->precache((int) this->snowLife);
-  }  
+  }
 }
 
@@ -143,5 +143,5 @@
   if (this->snowWindForce != 0)
     this->soundSource.play(this->windBuffer, 0.1f * this->snowWindForce, true);
- 
+
 }
 
