Index: trunk/src/Makefile.am
===================================================================
--- trunk/src/Makefile.am	(revision 7796)
+++ trunk/src/Makefile.am	(revision 7810)
@@ -41,4 +41,9 @@
 		lib/particles/plane_emitter.cc \
 		lib/graphics/effects/fog_effect.cc \
+		lib/graphics/effects/volfog_effect.cc \
+		lib/graphics/effects/rain_effect.cc \
+		lib/graphics/effects/snow_effect.cc \
+		lib/graphics/effects/cloud_effect.cc \
+		lib/graphics/effects/lightening_effect.cc \
 		lib/graphics/effects/lense_flare.cc \
 		\
Index: trunk/src/defs/class_id.h
===================================================================
--- trunk/src/defs/class_id.h	(revision 7796)
+++ trunk/src/defs/class_id.h	(revision 7810)
@@ -127,5 +127,5 @@
   CL_NETWORK_MANAGER            =    0x00000050,
   CL_SHARED_NETWORK_DATA        =    0x00000051,
-
+  CL_ATMOSPHERIC_ENGINE         =    0x00000061,
 
   /// StoryEntities (range from 0x00000100 to 0x000001ff)
@@ -224,5 +224,5 @@
 
   CL_IMAGE_ENTITY               =    0x00000513,
-  CL_BILLBOARD                  =    0x00000514,
+  CL_IMAGE_PLANE                =    0x00000514,
   CL_MODEL_ENTITY               =    0x00000515,
   CL_TEXT_ELEMENT               =    0x00000516, /// TODO MOVE
@@ -286,10 +286,19 @@
   CL_LIGHT                      =    0x00000821,
 
+  CL_BILLBOARD                  =    0x00000a01,
+
   CL_GRAPHICS_EFFECT            =    0x00a01000,
-
+  CL_SUN_EFFECT                 =    0x00a02000,
+  CL_WEATHER_EFFECT             =    0x00a04000,
   CL_FOG_EFFECT                 =    0x00000a10,
+  CL_VOLFOG_EFFECT              =    0x00000a11,
   CL_LENSE_FLARE                =    0x00000a12,
+  CL_RAIN_EFFECT                =    0x00000a13,
+  CL_SNOW_EFFECT                =    0x00000a14,
+  CL_CLOUD_EFFECT               =    0x00000a15,
+  CL_LIGHTENING_EFFECT          =    0x00000a16,
   CL_EXPLOSION                  =    0x00000a20,
   CL_LIGHTNING_BOLT             =    0x00000a21,
+	
 
 
Index: trunk/src/lib/graphics/Makefile.am
===================================================================
--- trunk/src/lib/graphics/Makefile.am	(revision 7796)
+++ trunk/src/lib/graphics/Makefile.am	(revision 7810)
@@ -4,41 +4,54 @@
 noinst_LIBRARIES = libORXgraphics.a
 
-libORXgraphics_a_SOURCES = \
-		graphics_engine.cc \
-		light.cc \
-		shader.cc \
-		\
-		render2D/render_2d.cc \
-		render2D/element_2d.cc \
-		render2D/billboard.cc \
-		\
-		text_engine/text_engine.cc \
-		text_engine/text.cc \
-		text_engine/multi_line_text.cc \
-		text_engine/font.cc \
-		\
-		effects/graphics_effect.cc \
-		effects/fog_effect.cc \
-		effects/lense_flare.cc
+libORXgraphics_a_SOURCES = graphics_engine.cc \
+			   light.cc \
+			   shader.cc \
+			   \
+			   render2D/render_2d.cc \
+			   render2D/element_2d.cc \
+			   render2D/image_plane.cc \
+			   \
+			   text_engine/text_engine.cc \
+			   text_engine/text.cc \
+			   text_engine/multi_line_text.cc \
+			   text_engine/font.cc \
+			   \
+			   effects/graphics_effect.cc \
+			   effects/atmospheric_engine.cc \
+			   effects/weather_effect.cc \
+			   effects/sun_effect.cc \
+			   effects/fog_effect.cc \
+			   effects/volfog_effect.cc \
+			   effects/rain_effect.cc \
+			   effects/snow_effect.cc \
+			   effects/cloud_effect.cc \
+			   effects/lightening_effect.cc \
+			   effects/lense_flare.cc
 
-
-noinst_HEADERS = \
-		graphics_engine.h \
-		light.h \
-		shader.h \
-		\
-		render2D/render_2d.h \
-		render2D/element_2d.h \
-		render2D/billboard.h \
-		\
-		text_engine/text_engine.h \
-		text_engine/text.h \
-		text_engine/multi_line_text.cc \
-		text_engine/font.h \
-		text_engine/default_font.xpm \
-		\
-		effects/graphics_effect.h \
-		effects/fog_effect.h \
-		effects/lense_flare.h
+noinst_HEADERS = graphics_engine.h \
+		 light.h \
+		 shader.h \
+		 \
+		 render2D/render_2d.h \
+		 render2D/element_2d.h \
+		 render2D/image_plane.h \
+		 \
+		 text_engine/text_engine.h \
+		 text_engine/text.h \
+		 text_engine/multi_line_text.h \
+		 text_engine/font.h \
+		 text_engine/default_font.xpm \
+		 \
+		 effects/graphics_effect.h \
+		 effects/atmospheric_engine.h \
+		 effects/weather_effect.h \
+		 effects/sun_effect.h \
+		 effects/fog_effect.h \
+		 effects/volfog_effect.h \
+		 effects/rain_effect.h \
+		 effects/snow_effect.h \
+		 effects/cloud_effect.h \
+		 effects/lightening_effect.h \
+		 effects/lense_flare.h
 
 
Index: trunk/src/lib/graphics/effects/atmospheric_engine.cc
===================================================================
--- trunk/src/lib/graphics/effects/atmospheric_engine.cc	(revision 7810)
+++ trunk/src/lib/graphics/effects/atmospheric_engine.cc	(revision 7810)
@@ -0,0 +1,130 @@
+/*
+   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: Andreas Maechler, David Hasenfratz
+   co-programmer: ...
+*/
+
+#include "atmospheric_engine.h"
+
+#include "util/loading/resource_manager.h"
+
+#include "effects/fog_effect.h"
+
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
+#include "class_list.h"
+
+
+using namespace std;
+
+/**
+ * @param root The XML-element to load the AtmosphericEngine from
+ */
+AtmosphericEngine::AtmosphericEngine()
+{
+  this->setClassID(CL_ATMOSPHERIC_ENGINE, "AtmosphericEngine");
+}
+
+/**
+ *  The Pointer to this AtmosphericEngine
+*/
+AtmosphericEngine* AtmosphericEngine::singletonRef = NULL;
+
+
+/**
+ *  destroys a AtmosphericEngine
+ */
+AtmosphericEngine::~AtmosphericEngine()
+{
+  AtmosphericEngine::singletonRef = NULL;
+
+  const std::list<BaseObject*>* weatherEffects = ClassList::getList( CL_WEATHER_EFFECT);
+
+  if (weatherEffects != NULL)
+  {
+      while(!weatherEffects->empty())
+        delete weatherEffects->front();
+  }
+}
+
+/**
+ * @param root The XML-element to load the AtmosphericEngine from
+ */
+void AtmosphericEngine::loadParams(const TiXmlElement* root)
+{
+  LoadParamXML(root, "WeatherEffect", this, AtmosphericEngine, loadWeatherEffect);
+  LoadParamXML(root, "SunEffect", this, AtmosphericEngine, loadSunEffect);
+}
+
+/**
+ * @param root The XML-element to load WeatherEffects from
+ */
+void AtmosphericEngine::loadWeatherEffect(const TiXmlElement* root)
+{
+  LOAD_PARAM_START_CYCLE(root, element);
+  {
+    PRINTF(4)("element is: %s\n", element->Value());
+    // Factory::fabricate(element);
+
+    BaseObject* bo = Factory::fabricate(element);
+    if( bo == NULL)
+      PRINTF(0)(" Could not create Element %s\n", element->Value());
+  }
+  LOAD_PARAM_END_CYCLE(element);
+}
+
+/**
+ * @param root The XML-element to load SunEffects from
+ */
+void AtmosphericEngine::loadSunEffect(const TiXmlElement* root)
+{
+  LOAD_PARAM_START_CYCLE(root, element);
+  {
+    PRINTF(4)("element is: %s\n", element->Value());
+  }
+  LOAD_PARAM_END_CYCLE(element);
+}
+
+
+/**
+ * draws the effect, if needed
+ */
+void AtmosphericEngine::draw() const
+{
+  const std::list<BaseObject*>* weatherEffects = ClassList::getList( CL_WEATHER_EFFECT);
+
+  // draw the weather effects
+  if (weatherEffects != NULL)
+  {
+    std::list<BaseObject*>::const_iterator it;
+    for (it = weatherEffects->begin(); it != weatherEffects->end(); it++)
+      dynamic_cast<WeatherEffect*>(*it)->draw();
+  }
+}
+
+
+
+/**
+ * ticks the effect if there is any time dependancy
+ */
+void AtmosphericEngine::tick(float dt)
+{
+  const std::list<BaseObject*>* weatherEffects = ClassList::getList( CL_WEATHER_EFFECT);
+
+  // tick the weather effects
+  if (weatherEffects != NULL)
+  {
+    std::list<BaseObject*>::const_iterator it;
+    for (it = weatherEffects->begin(); it != weatherEffects->end(); it++)
+      dynamic_cast<WeatherEffect*>(*it)->tick(dt);
+  }
+}
Index: trunk/src/lib/graphics/effects/atmospheric_engine.h
===================================================================
--- trunk/src/lib/graphics/effects/atmospheric_engine.h	(revision 7810)
+++ trunk/src/lib/graphics/effects/atmospheric_engine.h	(revision 7810)
@@ -0,0 +1,42 @@
+/*!
+ * @file atmospheric_engine.h
+ *  
+ */
+
+#ifndef _ATMOSPHERIC_ENGINE_H
+#define _ATMOSPHERIC_ENGINE_H
+
+#include "base_object.h"
+
+
+class TiXmlElement;
+
+class AtmosphericEngine : public BaseObject
+{
+  public:
+    ~AtmosphericEngine();
+
+    /** @returns a Pointer to the only object of this Class */
+    inline static AtmosphericEngine* getInstance() { if (!AtmosphericEngine::singletonRef) AtmosphericEngine::singletonRef = new AtmosphericEngine();  return AtmosphericEngine::singletonRef; };
+
+    void loadParams(const TiXmlElement* root);
+
+    void init();
+
+    void draw() const;
+    void tick(float dt);
+
+    // inline bool isActivated() const { return this->bActivated; }
+
+    void loadWeatherEffect(const TiXmlElement* root);
+    void loadSunEffect(const TiXmlElement* root);
+
+  private:
+
+    AtmosphericEngine();
+
+    static AtmosphericEngine*     singletonRef;       //!< Pointer to the only instance of this Class
+};
+
+
+#endif /* _ATMOSPHERIC_ENGINE */
Index: trunk/src/lib/graphics/effects/cloud_effect.cc
===================================================================
--- trunk/src/lib/graphics/effects/cloud_effect.cc	(revision 7810)
+++ trunk/src/lib/graphics/effects/cloud_effect.cc	(revision 7810)
@@ -0,0 +1,268 @@
+/*
+	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
+*/
+
+#include "cloud_effect.h"
+
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
+
+#include "glincl.h"
+//#include "graphics_engine.h"
+#include <math.h>
+
+#include "parser/tinyxml/tinyxml.h"
+
+using namespace std;
+
+CREATE_FACTORY(CloudEffect, CL_CLOUD_EFFECT);
+
+CloudEffect::CloudEffect(const TiXmlElement* root)
+{
+	this->setClassID(CL_CLOUD_EFFECT, "CloudEffect");
+
+	this->init();
+
+	if (root != NULL)
+		this->loadParams(root);
+
+	this->activate();
+}
+
+CloudEffect::~CloudEffect()
+{
+	this->deactivate();
+}
+
+void CloudEffect::loadParams(const TiXmlElement* root)
+{
+	WeatherEffect::loadParams(root);
+
+	LoadParam(root, "animSpeed", this, CloudEffect, setCloudAnimation);
+
+}
+
+
+bool CloudEffect::init()
+{
+	// default values
+	this->cloudAnimTimeStep = 0;
+
+	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+
+	// Generate noise map a
+	CloudEffect::genNoiseMap(cloudMap32_a);
+	
+	if (this->cloudAnimTimeStep > 0) {
+		// Generate noise map b
+		CloudEffect::genNoiseMap(cloudMap32_b);
+	}
+}
+
+bool CloudEffect::activate()
+{
+	PRINTF(0)( "Activating CloudEffect\n");
+	if (this->cloudAnimTimeStep == 0) {
+		for (int i = 0; i < 32*32; i++)
+			cloudMap32_c[i] = cloudMap32_a[i];
+
+		CloudEffect::overlapOctaves();
+		CloudEffect::expFilter();
+		CloudEffect::genCloudTexture();
+	}
+}
+
+bool CloudEffect::deactivate()
+{
+	PRINTF(0)("Deactivating CloudEffect\n");
+}
+
+void CloudEffect::genCloudTexture() {
+	for(int i=0; i<256; i++)
+		for(int j=0; j<256; j++) 
+		{
+			float color = cloudMap256[i*256+j]; 
+			cloudTexture[i][j][0] = (char) color;
+			cloudTexture[i][j][1] = (char) color;
+			cloudTexture[i][j][2] = (char) color;
+		}
+
+	glGenTextures(2, &texID[0]);
+	glBindTexture(GL_TEXTURE_2D, texID[0]);
+	gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGB, 256, 256, GL_RGB, GL_UNSIGNED_BYTE, cloudTexture);
+}
+
+void CloudEffect::calcAnimMap(float timer) {
+
+	for (int x=0; x<32*32; x++)
+		cloudMap32_c[x] = (cloudMap32_a[x] * ((this->cloudAnimTimeStep - timer) / this->cloudAnimTimeStep)) + (cloudMap32_b[x] * (timer / this->cloudAnimTimeStep));
+
+}
+
+void CloudEffect::draw() const
+{
+	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+	glPushMatrix();
+	glEnable(GL_TEXTURE_2D);
+
+	glBindTexture(GL_TEXTURE_2D, texID[0]);
+
+	// FIXME : Bind this to the sky - how do I do this?
+	glBegin(GL_QUADS);
+		glTexCoord2f(0.0f, 0.0f); glVertex3f(20, 20,  60);	// Bottom Left Of The Texture and Quad
+		glTexCoord2f(1.0f, 0.0f); glVertex3f(60, 20,  60);	// Bottom Right Of The Texture and Quad
+		glTexCoord2f(1.0f, 1.0f); glVertex3f(60, 60,  60);	// Top Right Of The Texture and Quad
+		glTexCoord2f(0.0f, 1.0f); glVertex3f(20, 60,  60);	// Top Left Of The Texture and Quad
+	glEnd(); 
+
+	glPopMatrix();
+}
+
+void CloudEffect::tick (float dt)
+{
+	if (this->cloudAnimTimeStep > 0) {
+		if (timer >= this->cloudAnimTimeStep) {
+			timer -= this->cloudAnimTimeStep;
+			for (int i = 0; i < 32*32; i++)
+				cloudMap32_a[i] = cloudMap32_b[i];
+			CloudEffect::genNoiseMap(cloudMap32_b);
+		}
+
+		//map32anim = (map32a * (10 - timer)) + (map32b * timer);
+		CloudEffect::calcAnimMap(timer);
+
+		CloudEffect::overlapOctaves();
+		CloudEffect::expFilter();
+		CloudEffect::genCloudTexture();
+
+		timer += dt;
+	}
+}
+
+/* 
+	Random noise generator
+*/
+float CloudEffect::noise(int x, int y, int random)
+{
+		int n = x + y * 57 + random * 131;
+		n = (n<<13) ^ n;
+		return (1.0f - ( (n * (n * n * 15731 + 789221) +
+						1376312589)&0x7fffffff)* 0.000000000931322574615478515625f);
+}
+
+/*
+	Set noise for the 32*32 noise map:
+*/
+void CloudEffect::genNoiseMap(float  *map)
+{
+	float temp[34][34];
+
+	int random = rand() % 5000;
+
+	for (int y = 1; y < 33; y++)
+		for (int x = 1; x < 33; x++)
+			temp[x][y] = 128.0f + CloudEffect::noise(x,  y,  random) * 128.0f;
+
+	// Seamless cloud
+	for (int x=1; x<33; x++)
+	{
+		temp[0][x] = temp[32][x];
+		temp[33][x] = temp[1][x];
+		temp[x][0] = temp[x][32];
+		temp[x][33] = temp[x][1];
+	}
+	temp[0][0] = temp[32][32];
+	temp[33][33] = temp[1][1];
+	temp[0][33] = temp[32][1];
+	temp[33][0] = temp[1][32];
+
+	// We mirror the side and corner elements so our final cloud will be seamless without any ugly borders showing.
+	for (int y=1; y<33; y++)
+		for (int x=1; x<33; x++)
+		{
+			float center = temp[x][y]/4.0f;
+			float sides = (temp[x+1][y] + temp[x-1][y] + temp[x][y+1] + temp[x][y-1])/8.0f;
+			float corners = (temp[x+1][y+1] + temp[x+1][y-1] + temp[x-1][y+1] + temp[x-1][y-1])/16.0f;
+
+			map[((x-1)*32) + (y-1)] = center + sides + corners;
+		}
+}
+
+/*
+	Interpolation - average the value of each pixel value with that of its neighbors' values.
+*/
+float CloudEffect::interpolate(float x, float y, float  *map)
+{
+	int Xint = (int)x;
+	int Yint = (int)y;
+
+	float Xfrac = x - Xint;
+	float Yfrac = y - Yint;
+
+	int X0 = Xint % 32;
+	int Y0 = Yint % 32;
+	int X1 = (Xint + 1) % 32;
+	int Y1 = (Yint + 1) % 32;
+
+	float bot = map[X0*32 + Y0] + Xfrac * (map[X1*32 + Y0] - map[X0*32 + Y0]);
+	float top = map[X0*32 + Y1] + Xfrac * (map[X1*32 +  Y1] - map[X0*32 + Y1]);
+
+	return (bot + Yfrac * (top - bot));
+}
+
+
+/*
+	Octaves are overlapped together to give cloud more turbulence. We will use four octaves for our cloud.
+*/
+void CloudEffect::overlapOctaves()
+{
+	for (int x=0; x<256*256; x++)
+	{
+		cloudMap256[x] = 0;
+	}
+
+	for (int octave=0; octave<4; octave++)
+		for (int x=0; x<256; x++)
+			for (int y=0; y<256; y++)
+			{
+				float scale = 1 / pow(2.0f, (float) 3-octave);
+				float noise = CloudEffect::interpolate(x*scale, y*scale , cloudMap32_c);
+
+				//The octaves are added together with the proper weight factors.
+				//You could replace pow(2, i) with 1<<i for faster computation
+				cloudMap256[(y*256) + x] += noise / pow(2.0f, (float) octave);
+			}
+}
+
+
+/*
+	Filter the noise with exponential function
+*/
+void CloudEffect::expFilter()
+{
+	float cover = 20.0f;
+	float sharpness = 0.95f;
+
+	for (int x=0; x<256*256; x++)
+	{
+		float c = cloudMap256[x] - (255.0f-cover);
+		if (c<0)     c = 0;
+		cloudMap256[x] = 255.0f - ((float)(pow(sharpness, c))*255.0f);
+	}
+}
+
+
Index: trunk/src/lib/graphics/effects/cloud_effect.h
===================================================================
--- trunk/src/lib/graphics/effects/cloud_effect.h	(revision 7810)
+++ trunk/src/lib/graphics/effects/cloud_effect.h	(revision 7810)
@@ -0,0 +1,62 @@
+/**
+* @file cloud_effect.h
+*/
+
+#ifndef _CLOUD_EFFECT
+#define _CLOUD_EFFECT
+
+#include "vector.h"
+#include "vector2D.h"
+
+#include "weather_effect.h"
+
+#include "sound_buffer.h"
+#include "sound_source.h"
+
+class CloudEffect : public WeatherEffect
+{
+	public:
+		CloudEffect(const TiXmlElement* root = NULL);
+		virtual ~CloudEffect();
+
+		virtual void loadParams(const TiXmlElement* root);
+
+		virtual bool init();
+
+		virtual bool activate();
+		virtual bool deactivate();
+
+		virtual void draw() const;
+		virtual void tick(float dt);
+
+		inline void setCloudAnimation(float timestep) { this->cloudAnimTimeStep = timestep; }
+
+	private:
+		// Basic noise maps 32x32
+		float 														cloudMap32_a[32 * 32];
+		float 														cloudMap32_b[32 * 32];
+		float 														cloudMap32_c[32 * 32];
+
+		// The cloud map 256x256
+		float 														cloudMap256[256 * 256];
+
+		// Temporary array to hold texture RGB values 
+		char 															cloudTexture[256][256][3];
+
+		GLuint 														texID[2];
+		float 														timer;
+
+		bool															cloudAnimTimeStep;
+
+		float 														noise(int x, int y, int random);
+		float 														interpolate(float x, float y, float  *map);
+		void  														overlapOctaves();
+		void  														expFilter();
+
+		void  														genNoiseMap(float  *map);
+		void  														genCloudTexture();
+		void  														calcAnimMap(float timer);
+
+};
+
+#endif  /* _CLOUD_EFFECT */
Index: trunk/src/lib/graphics/effects/fog_effect.cc
===================================================================
--- trunk/src/lib/graphics/effects/fog_effect.cc	(revision 7796)
+++ trunk/src/lib/graphics/effects/fog_effect.cc	(revision 7810)
@@ -1,19 +1,15 @@
+/*
+	orxonox - the future of 3D-vertical-scrollers
 
+	Copyright (C) 2004 orx
 
-/*
-   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.
+	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: Patrick Boenzli
+	main-programmer: hdavid, amaechler
 */
-
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_GRAPHICS
 
 #include "fog_effect.h"
@@ -24,5 +20,9 @@
 #include "glincl.h"
 
-
+/*#include "shell_command.h"
+SHELL_COMMAND(activateFog, FogEffect, FogEffect::activate)
+	->setAlias("aFog");
+SHELL_COMMAND(deactivateFog, FogEffect, FogEffect::deactivate)
+	->setAlias("dFog");*/
 
 using namespace std;
@@ -30,110 +30,82 @@
 CREATE_FACTORY(FogEffect, CL_FOG_EFFECT);
 
+FogEffect::FogEffect(const TiXmlElement* root)
+{
+	this->setClassID(CL_FOG_EFFECT, "FogEffect");
 
-/**
- *  default constructor
- * @param root The XML-element to load the FogEffect from
- */
- FogEffect::FogEffect(const TiXmlElement* root)
-{
-  this->setClassID(CL_FOG_EFFECT, "FogEffect");
+	this->init();
 
-  this->fogMode = GL_LINEAR;
-  this->fogDensity = 0.001f;
-  this->fogStart = 10.0f;
-  this->fogEnd = 1000.0f;
+	if (root != NULL)
+		this->loadParams(root);
 
-  if (root != NULL)
-    this->loadParams(root);
-
-  this->activate();
+	this->activate();
 }
 
 
-/**
- *  destroys a FogEffect
- */
 FogEffect::~FogEffect()
 {
-  this->deactivate();
+	this->deactivate();
 }
 
 
-/**
- * @param root The XML-element to load the FogEffect from
- */
 void FogEffect::loadParams(const TiXmlElement* root)
 {
-  GraphicsEffect::loadParams(root);
+	WeatherEffect::loadParams(root);
 
+	LoadParam(root, "mode", this, FogEffect, setFogMode);
+	LoadParam(root, "density", this, FogEffect, setFogDensity);
+	LoadParam(root, "range", this, FogEffect, setFogRange);
+	LoadParam(root, "color", this, FogEffect, setFogColor);
+}
 
-  LoadParam(root, "fog-mode", this, FogEffect, setFogMode)
-      .describe("sets the the fog mode {GL_LINEAR, GL_EXP, GL_EXP2}");
-
-  LoadParam(root, "fog-density", this, FogEffect, setFogDensity)
-      .describe("sets the the fog density of the exponentionl functions");
-
-  LoadParam(root, "fog-color", this, FogEffect, setFogColor)
-      .describe("sets the fog color");
-
+bool FogEffect::init()
+{
+	//default values
+	this->fogMode = GL_EXP2;
+	this->fogDensity = 0.001;
+	this->fogStart = 0;
+	this->fogEnd = 5000;
+  this->colorVector = Vector(0.7, 0.7, 0.7);
 }
 
 
-/**
- * initializes the fog effect
- */
-bool FogEffect::init()
-{}
 
-
-/**
- * activates the fog effect
- */
 bool FogEffect::activate()
 {
-  PRINTF(0)( "Enabling Fog Effect, mode: %i, density: %f, start: %f, end: %f, color %f, %f, %f\n", this->fogMode, this->fogDensity,
-             this->fogStart, this->fogEnd, this->colorVector.x, this->colorVector.y, this->colorVector.z);
+	PRINTF(0)( "Enabling FogEffect, mode: %i, density: %f, start: %f, end: %f, color %f, %f, %f\n", this->fogMode, this->fogDensity, this->fogStart, this->fogEnd, this->colorVector.x, this->colorVector.y, this->colorVector.z);
 
-  glEnable(GL_FOG);
-  {
-//     GLfloat fogColor[4] = {0.7, 0.6, 0.6, 1.0};
-    GLfloat fogColor[4] = { colorVector.x, colorVector.y, colorVector.z, 1.0};
+	glEnable(GL_FOG);
+	{
+		GLfloat fogColor[4] = { colorVector.x, colorVector.y, colorVector.z, 1.0};
 
-    glFogi(GL_FOG_MODE, this->fogMode);
-    glFogfv(GL_FOG_COLOR, fogColor);
-    glFogf(GL_FOG_DENSITY, this->fogDensity);
-    glHint(GL_FOG_HINT, GL_DONT_CARE);
-    glFogf(GL_FOG_START, this->fogStart);
-    glFogf(GL_FOG_END, this->fogEnd);
-
-    //glFogi(GL_FOG_COORDINATE_SOURCE, GL_FOG_COORDINATE);
-  }
-  glClearColor(0.5, 0.5, 0.5, 1.0);
+		glFogi(GL_FOG_MODE, this->fogMode);
+		glFogfv(GL_FOG_COLOR, fogColor);
+		glFogf(GL_FOG_DENSITY, this->fogDensity);
+		glHint(GL_FOG_HINT, GL_DONT_CARE);
+		glFogf(GL_FOG_START, this->fogStart);
+		glFogf(GL_FOG_END, this->fogEnd);
+	}
+	glClearColor(0.5, 0.5, 0.5, 1.0);
 }
 
 
-/**
- * deactivates the fog effect
- */
 bool FogEffect::deactivate()
 {
-  glDisable(GL_FOG);
+	PRINTF(0)("Deactivating FogEffect\n");
+	glDisable(GL_FOG);
 }
 
 
-/**
- * converts a gl mode char to a GLint
- * @param mode the mode character
- */
 GLint FogEffect::stringToFogMode(const std::string& mode)
 {
-  if(mode == "GL_LINEAR")
-    return GL_LINEAR;
-  else if(mode == "GL_EXP")
-    return GL_EXP;
-  else if(mode == "GL_EXP2" )
-    return GL_EXP2;
-  else
-    return -1;
+	if(mode == "GL_LINEAR")
+		return GL_LINEAR;
+	else if(mode == "GL_EXP")
+		return GL_EXP;
+	else if(mode == "GL_EXP2" )
+		return GL_EXP2;
+	else
+		return -1;
 }
 
+
Index: trunk/src/lib/graphics/effects/fog_effect.h
===================================================================
--- trunk/src/lib/graphics/effects/fog_effect.h	(revision 7796)
+++ trunk/src/lib/graphics/effects/fog_effect.h	(revision 7810)
@@ -1,6 +1,5 @@
 /**
- * @file fog_effect.h
- *  atmospheric fog
- */
+* @file fog_effect.h
+*/
 
 #ifndef _FOG_EFFECT
@@ -8,40 +7,36 @@
 
 #include "vector.h"
-#include "graphics_effect.h"
 
-class TiXmlElement;
+#include "weather_effect.h"
 
-//! A class that handles FogEffects. The FogEffectManager operates on this.
-class FogEffect : public GraphicsEffect
+class FogEffect : public WeatherEffect
 {
-  public:
-    FogEffect(const TiXmlElement* root = NULL);
-    virtual ~FogEffect();
+	public:
+		FogEffect(const TiXmlElement* root = NULL);
+		virtual ~FogEffect();
 
-    virtual void loadParams(const TiXmlElement* root);
+		virtual void loadParams(const TiXmlElement* root);
 
-    virtual bool init();
+		virtual bool init();
 
-    virtual bool activate();
-    virtual bool deactivate();
+		virtual bool activate();
+		virtual bool deactivate();
 
-    inline void setFogMode(const std::string& mode) { this->fogMode = this->stringToFogMode(mode); }
-    inline void setFogDensity(float density) { this->fogDensity = density; }
-    inline void setFogRange(float start, float end) { this->fogStart = start; this->fogEnd = end; }
-    inline void setFogColor(float r, float g, float b) { this->colorVector = Vector(r, g, b); }
+		inline void setFogMode(const std::string& mode) { this->fogMode = this->stringToFogMode(mode); }
+		inline void setFogDensity(float density) { this->fogDensity = density; }
+		inline void setFogRange(float start, float end) { this->fogStart = start; this->fogEnd = end; }
+		inline void setFogColor(float r, float g, float b) { this->colorVector = Vector(r, g, b); }
 
+	private:
+		GLint stringToFogMode(const std::string& mode);
 
-  private:
-    GLint stringToFogMode(const std::string& mode);
-
-
-  private:
-    GLint                   fogMode;
-    GLfloat                 fogDensity;
-    GLfloat                 fogStart;
-    GLfloat                 fogEnd;
-    Vector                  colorVector;
+	private:
+		GLint                   fogMode;
+		GLfloat                 fogDensity;
+		GLfloat                 fogStart;
+		GLfloat                 fogEnd;
+		Vector                  colorVector;
 };
 
 
-#endif /* _FOG_EFFECT */
+#endif  /* _FOG_EFFECT */
Index: trunk/src/lib/graphics/effects/lense_flare.cc
===================================================================
--- trunk/src/lib/graphics/effects/lense_flare.cc	(revision 7796)
+++ trunk/src/lib/graphics/effects/lense_flare.cc	(revision 7810)
@@ -28,5 +28,5 @@
 #include "state.h"
 
-#include "render2D/billboard.h"
+#include "render2D/image_plane.h"
 
 #include "light.h"
@@ -80,5 +80,5 @@
 LenseFlare::~LenseFlare()
 {
-  std::vector<Billboard*>::iterator it;
+  std::vector<ImagePlane*>::iterator it;
   for( it = flares.begin(); it != flares.end(); it++)
     delete (*it);
@@ -155,9 +155,9 @@
   }
 
-  Billboard* bb = new Billboard(NULL);
+  ImagePlane* bb = new ImagePlane(NULL);
   bb->setTexture(textureName);
   bb->setSize(50, 50);
   this->flares.push_back(bb);
-  PRINTF(4)("Added a Lenseflare Billboard with texture %s\n", textureName.c_str());
+  PRINTF(4)("Added a Lenseflare ImagePlane with texture %s\n", textureName.c_str());
 
   // the first flare belongs to the light source
@@ -178,5 +178,5 @@
   float dist = this->frustumPlane.distancePoint(this->lightSource->getAbsCoor());
   PRINTF(0)("dist: %f\n", dist);
-  std::vector<Billboard*>::const_iterator it;
+  std::vector<ImagePlane*>::const_iterator it;
     for(it = flares.begin(); it != flares.end(); it++)
       (*it)->setVisibility(visibility);
@@ -220,5 +220,5 @@
 
   // now calculate the new coordinates of the billboards
-  std::vector<Billboard*>::iterator it;
+  std::vector<ImagePlane*>::iterator it;
   int i;
   for( it = flares.begin(), i = 0; it != flares.end(); it++, i++)
Index: trunk/src/lib/graphics/effects/lense_flare.h
===================================================================
--- trunk/src/lib/graphics/effects/lense_flare.h	(revision 7796)
+++ trunk/src/lib/graphics/effects/lense_flare.h	(revision 7810)
@@ -20,5 +20,5 @@
 class TiXmlElement;
 class Light;
-class Billboard;
+class ImagePlane;
 
 //! A class that handles LenseFlares. The LenseFlareManager operates on this.
@@ -50,5 +50,5 @@
     float                    isVisible;          //!< Checks visibility
     Light*                   lightSource;        //!< reference to the sun (or primary light source)
-    std::vector<Billboard*>  flares;             //!< the flares array
+    std::vector<ImagePlane*>  flares;             //!< the flares array
 
     Vector2D                 flareVector;        //!< the axis to draw the flares on
Index: trunk/src/lib/graphics/effects/lightening_effect.cc
===================================================================
--- trunk/src/lib/graphics/effects/lightening_effect.cc	(revision 7810)
+++ trunk/src/lib/graphics/effects/lightening_effect.cc	(revision 7810)
@@ -0,0 +1,82 @@
+/*
+   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
+*/
+
+#include "lightening_effect.h"
+
+#include "state.h"
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
+#include "render2D/image_plane.h"
+
+#include "glincl.h"
+#include "parser/tinyxml/tinyxml.h"
+
+using namespace std;
+
+CREATE_FACTORY(LighteningEffect, CL_LIGHTENING_EFFECT);
+
+LighteningEffect::LighteningEffect(const TiXmlElement* root)
+{
+	this->setClassID(CL_LIGHTENING_EFFECT, "LighteningEffect");
+  
+  
+  lightening = new ImagePlane(NULL);
+  lightening->setTexture("maps/lightning_bolt.png");
+  lightening->setSize(50, 50);
+  lightening->setAbsCoor2D(10,10);
+  lightening->setVisibility(true);
+  
+  
+	this->init();
+
+	if (root != NULL)
+		this->loadParams(root);
+
+	this->activate();
+}
+
+LighteningEffect::~LighteningEffect()
+{
+	this->deactivate();
+  delete lightening;
+}
+
+void LighteningEffect::loadParams(const TiXmlElement* root)
+{
+	WeatherEffect::loadParams(root);
+}
+
+
+bool LighteningEffect::init()
+{
+	//Default values
+}
+
+
+bool LighteningEffect::activate()
+{
+	PRINTF(0)( "Activating LighteningEffect\n" );
+
+}
+
+
+bool LighteningEffect::deactivate()
+{
+	PRINTF(0)("Deactivating LighteningEffect\n");
+}
+
+void LighteningEffect::tick (float dt)
+{
+
+}
Index: trunk/src/lib/graphics/effects/lightening_effect.h
===================================================================
--- trunk/src/lib/graphics/effects/lightening_effect.h	(revision 7810)
+++ trunk/src/lib/graphics/effects/lightening_effect.h	(revision 7810)
@@ -0,0 +1,39 @@
+/**
+* @file lightening_effect.h
+*/
+
+#ifndef _LIGHTENING_EFFECT
+#define _LIGHTENING_EFFECT
+
+#include "vector.h"
+#include "vector2D.h"
+
+#include "weather_effect.h"
+
+#include "sound_buffer.h"
+#include "sound_source.h"
+
+
+class ImagePlane;
+
+class LighteningEffect : public WeatherEffect
+{
+	public:
+		LighteningEffect(const TiXmlElement* root = NULL);
+		virtual ~LighteningEffect();
+
+		virtual void loadParams(const TiXmlElement* root);
+
+		virtual bool init();
+
+		virtual bool activate();
+		virtual bool deactivate();
+
+		virtual void tick(float dt);
+
+	private:
+    ImagePlane* lightening;
+
+};
+
+#endif  /* _LIGHTENING_EFFECT */
Index: trunk/src/lib/graphics/effects/rain_effect.cc
===================================================================
--- trunk/src/lib/graphics/effects/rain_effect.cc	(revision 7810)
+++ trunk/src/lib/graphics/effects/rain_effect.cc	(revision 7810)
@@ -0,0 +1,161 @@
+/*
+   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
+*/
+
+#include "rain_effect.h"
+
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
+#include "util/loading/resource_manager.h"
+
+#include "glincl.h"
+#include "p_node.h"
+#include "state.h"
+#include "spark_particles.h"
+#include "plane_emitter.h"
+#include "shell_command.h"
+
+#include "parser/tinyxml/tinyxml.h"
+
+SHELL_COMMAND(activate, RainEffect, activateRain);
+SHELL_COMMAND(deactivate, RainEffect, deactivateRain);
+
+using namespace std;
+
+CREATE_FACTORY(RainEffect, CL_RAIN_EFFECT);
+
+RainEffect::RainEffect(const TiXmlElement* root)
+{
+	this->setClassID(CL_RAIN_EFFECT, "RainEffect");
+
+	this->init();
+
+	if (root != NULL)
+		this->loadParams(root);
+
+	//load rain sound
+	if (this->rainBuffer != NULL)
+		ResourceManager::getInstance()->unload(this->rainBuffer);
+	this->rainBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/rain.wav", WAV);
+
+	//load wind sound
+	if (this->rainWindForce > 0) {
+		if (this->windBuffer != NULL)
+			ResourceManager::getInstance()->unload(this->windBuffer);
+		this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/wind.wav", WAV);
+	}
+
+	this->activate();
+}
+
+RainEffect::~RainEffect()
+{
+	this->deactivate();
+
+	if (this->rainBuffer != NULL)
+		ResourceManager::getInstance()->unload(this->rainBuffer);
+
+	if (this->windBuffer != NULL)
+		ResourceManager::getInstance()->unload(this->windBuffer);
+}
+
+void RainEffect::loadParams(const TiXmlElement* root)
+{
+	WeatherEffect::loadParams(root);
+
+	LoadParam(root, "coord", this, RainEffect, setRainCoord);
+	LoadParam(root, "size", this, RainEffect, setRainSize);
+	LoadParam(root, "rate", this, RainEffect, setRainRate);
+	LoadParam(root, "velocity", this, RainEffect, setRainVelocity);
+	LoadParam(root, "life", this, RainEffect, setRainLife);
+	LoadParam(root, "wind", this, RainEffect, setRainWind);
+	LoadParam(root, "option", this, RainEffect, setRainOption);
+}
+
+
+bool RainEffect::init()
+{
+	//Default values
+	this->rainCoord = Vector(500, 500, 500);
+	this->rainSize = Vector2D(1000, 1000);
+	this->rainRate = 3000;
+	this->rainVelocity = -300;
+	this->rainLife = 4;
+	this->rainMaxParticles = this->rainRate * this->rainLife;
+	this->rainWindForce  = 0;
+
+	this->emitter = new PlaneEmitter(this->rainSize);
+}
+
+
+SparkParticles* RainEffect::rainParticles = NULL;
+
+bool RainEffect::activate()
+{
+	PRINTF(0)( "Activating RainEffect, coord: %f, %f, %f, size: %f, %f, rate: %f, velocity: %f, moveRain: %s\n", this->rainCoord.x, this->rainCoord.y, this->rainCoord.z, this->rainSize.x, this-> rainSize.y, this->rainRate, this->rainVelocity, this->rainMove ? "true" : "false" );
+
+	if (unlikely(RainEffect::rainParticles == NULL))
+	{
+		RainEffect::rainParticles = new SparkParticles((int) this->rainMaxParticles);
+		RainEffect::rainParticles->setName("RainParticles");
+		RainEffect::rainParticles->precache((int)this->rainLife);
+		RainEffect::rainParticles->setLifeSpan(this->rainLife, 2);
+		RainEffect::rainParticles->setRadius(0, 0.03);
+		RainEffect::rainParticles->setRadius(0.2, 0.02);
+		RainEffect::rainParticles->setRadius(1, 0.01);
+		RainEffect::rainParticles->setColor(0, 0.3, 0.3, 0.5, 0.2); // grey blue 1
+		RainEffect::rainParticles->setColor(0.5, 0.4, 0.4, 0.5, 0.2); // grey blue 2
+		RainEffect::rainParticles->setColor(1, 0.7, 0.7, 0.7, 0.2); // light grey
+	}
+
+	this->emitter->setSystem(RainEffect::rainParticles);
+
+	this->emitter->setRelCoor(this->rainCoord);
+
+	this->emitter->setEmissionRate(this->rainRate);
+	this->emitter->setEmissionVelocity(this->rainVelocity);
+
+	this->emitter->setSpread(this->rainWindForce / 50, 0.2);
+	
+	this->soundSource.loop(this->rainBuffer);
+	if (this->rainWindForce > 0)
+		this->soundSource.loop(this->windBuffer);
+}
+
+
+bool RainEffect::deactivate()
+{
+	PRINTF(0)("Deactivating RainEffect\n");
+	this->emitter->setSystem(NULL);
+
+	this->soundSource.stop();
+}
+
+void RainEffect::activateRain()
+{
+	this->activate();
+}
+
+void RainEffect::deactivateRain()
+{
+	this->deactivate();
+}
+
+
+void RainEffect::tick (float dt)
+{
+	if (this->rainMove) {
+		this->rainCoord = State::getCameraNode()->getAbsCoor();
+		this->emitter->setRelCoor(this->rainCoord.x , this->rainCoord.y+800, this->rainCoord.z);
+	}
+}
Index: trunk/src/lib/graphics/effects/rain_effect.h
===================================================================
--- trunk/src/lib/graphics/effects/rain_effect.h	(revision 7810)
+++ trunk/src/lib/graphics/effects/rain_effect.h	(revision 7810)
@@ -0,0 +1,69 @@
+/**
+* @file rain_effect.h
+*/
+
+#ifndef _RAIN_EFFECT
+#define _RAIN_EFFECT
+
+#include "vector.h"
+#include "vector2D.h"
+#include <string>
+
+#include "particle_system.h"
+
+class SparkParticles;
+class PlainEmitter;
+
+#include "weather_effect.h"
+
+#include "sound_buffer.h"
+#include "sound_source.h"
+
+
+class RainEffect : public WeatherEffect
+{
+	public:
+		RainEffect(const TiXmlElement* root = NULL);
+		virtual ~RainEffect();
+
+		virtual void loadParams(const TiXmlElement* root);
+
+		virtual bool init();
+
+		virtual bool activate();
+		virtual bool deactivate();
+
+		void activateRain();
+		void deactivateRain();
+
+		virtual void tick(float dt);
+
+		inline void setRainCoord(float x, float y, float z) { this->rainCoord = Vector(x, y, z); }
+		inline void setRainSize(float x, float y) { this->rainSize = Vector2D(x, y); }
+		inline void setRainRate(float rate) { this->rainRate = rate;}
+		inline void setRainVelocity(float velocity) { this->rainVelocity = -velocity; }
+		inline void setRainLife(float life) { this->rainLife = life; }
+		inline void setRainWind(int force) { this->rainWindForce = force; }
+		inline void setRainOption(const std::string& option) { if (option == "moverain") this->rainMove = true; }
+
+
+	private:
+		static SparkParticles*						rainParticles;
+		ParticleEmitter*									emitter;
+
+		Vector														rainCoord;
+		Vector2D													rainSize;
+		GLfloat														rainRate;
+		GLfloat														rainVelocity;
+		GLfloat														rainLife;
+		GLfloat														rainMaxParticles;
+		int																rainWindForce;
+		bool															rainMove;
+
+		OrxSound::SoundSource			soundSource;
+		OrxSound::SoundBuffer*			rainBuffer;
+		OrxSound::SoundBuffer*			windBuffer;
+};
+
+
+#endif  /* _RAIN_EFFECT */
Index: trunk/src/lib/graphics/effects/snow_effect.cc
===================================================================
--- trunk/src/lib/graphics/effects/snow_effect.cc	(revision 7810)
+++ trunk/src/lib/graphics/effects/snow_effect.cc	(revision 7810)
@@ -0,0 +1,201 @@
+/*
+	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
+*/
+
+#include "snow_effect.h"
+
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
+#include "util/loading/resource_manager.h"
+
+#include "glincl.h"
+#include "debug.h"
+
+#include "p_node.h"
+#include "state.h"
+#include "sprite_particles.h"
+#include "plane_emitter.h"
+#include "shell_command.h"
+
+#include "parser/tinyxml/tinyxml.h"
+
+SHELL_COMMAND(activate, SnowEffect, activateSnow);
+SHELL_COMMAND(deactivate, SnowEffect, deactivateSnow);
+
+using namespace std;
+
+CREATE_FACTORY(SnowEffect, CL_SNOW_EFFECT);
+
+SnowEffect::SnowEffect(const TiXmlElement* root)
+{
+	this->setClassID(CL_SNOW_EFFECT, "SnowEffect");
+
+	this->init();
+
+	if (root != NULL)
+		this->loadParams(root);
+
+	//load wind sound
+	if (this->snowWindForce > 1) {
+		if (this->windBuffer != NULL)
+			ResourceManager::getInstance()->unload(this->windBuffer);
+	       		this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/wind.wav", WAV);
+	}
+
+	this->activate();
+}
+
+
+SnowEffect::~SnowEffect()
+{
+	this->deactivate();
+}
+
+SpriteParticles* SnowEffect::snowParticles = NULL;
+
+void SnowEffect::loadParams(const TiXmlElement* root)
+{
+	WeatherEffect::loadParams(root);
+
+	LoadParam(root, "numParticles", this, SnowEffect, numParticles);
+	LoadParam(root, "materialTexture", this, SnowEffect, materialTexture);
+	LoadParam(root, "lifeSpans", this, SnowEffect, lifeSpan);
+	LoadParam(root, "radius", this, SnowEffect, radius);
+	LoadParam(root, "mass", this, SnowEffect, mass);
+	LoadParam(root, "emissionRate", this, SnowEffect, emissionRate);
+	LoadParam(root, "emissionVelocity", this, SnowEffect, emissionVelocity);
+  LoadParam(root, "wind", this, SnowEffect, wind);
+	LoadParam(root, "size", this, SnowEffect, size);
+	LoadParam(root, "coord", this, SnowEffect, coord);
+}
+
+bool SnowEffect::init()
+{
+	this->emitter = new PlaneEmitter();
+
+	// Default values
+	this->particles = 12000;
+	this->texture = "maps/snow_flake_01_32x32.png";
+	this->life = 8;
+	this->randomLife = 2;
+	this->snowRadius = 3.5;
+	this->randomRadius = 1;
+	this->snowMass = 1.0;
+	this->randomMass = 0.3;
+	this->rate = 900;
+	this->velocity = -100;
+	this->randomVelocity = 5;
+	this->angle = 0.5;
+	this->randomAngle = 0.2;
+	this->alpha = 0.5;
+	this->snowSize = Vector2D(2500, 2500);
+  this->snowCoord = Vector(100,450,400);
+	this->snowWindForce = 1;
+
+	this->activated = false;
+}
+
+bool SnowEffect::activate()
+{
+	PRINTF(0)("Activating SnowEffect\n");
+	activated = true;
+
+	SnowEffect::snowParticles = new SpriteParticles(particles);
+	SnowEffect::snowParticles->setName("SnowEffectTrailParticles");
+	SnowEffect::snowParticles->setMaterialTexture(texture);
+	SnowEffect::snowParticles->setLifeSpan(life, randomLife);
+	SnowEffect::snowParticles->setRadius(0.0, snowRadius, randomRadius);
+	SnowEffect::snowParticles->setRadius(0.2, snowRadius, randomRadius*0.8);
+	SnowEffect::snowParticles->setRadius(1.0, snowRadius, randomRadius*0.5);
+	SnowEffect::snowParticles->setMass(0, snowMass, randomMass);
+	SnowEffect::snowParticles->setColor(0,1, 1, 1, alpha);
+	SnowEffect::snowParticles->setColor(.5, .6, .6, .6, alpha/2);
+	SnowEffect::snowParticles->setColor(1, .0, .0, .0, .0);
+
+	this->emitter->setSystem(SnowEffect::snowParticles);
+
+	this->emitter->setRelCoor(snowCoord);
+	this->emitter->setEmissionRate(rate);
+	this->emitter->setEmissionVelocity(velocity, randomVelocity);
+	this->emitter->setSpread(angle * this->snowWindForce , randomAngle * this->snowWindForce);
+	this->emitter->setSize(snowSize);
+
+  //SnowEffect::snowParticles->precache(8);
+
+	if (this->snowWindForce > 1)
+		this->soundSource.loop(this->windBuffer);
+}
+
+
+bool SnowEffect::deactivate()
+{
+	PRINTF(0)("Deactivating SnowEffect\n");
+	activated = false;
+
+	this->emitter->setSystem(NULL);
+
+	if (this->windBuffer != NULL)
+		ResourceManager::getInstance()->unload(this->windBuffer);
+
+}
+
+void SnowEffect::activateSnow()
+{
+	this->activate();
+}
+
+void SnowEffect::deactivateSnow()
+{
+	this->deactivate();
+}
+
+void SnowEffect::draw() const
+{
+}
+
+void SnowEffect::tick(float dt)
+{
+  float distance = (State::getCameraNode()->getAbsCoor() - Vector(snowCoord.x, State::getCameraNode()->getAbsCoor().y, snowCoord.z)).len();
+  
+  if(activated)
+  {
+    if(distance > 0.3*snowSize.x || distance > 0.3*snowSize.y)
+		  this->deactivate();
+    else if(distance > 0.25*snowSize.x || distance > 0.25*snowSize.y) 
+      this->alpha = 0.15;
+    else if(distance > 0.2*snowSize.x || distance > 0.2*snowSize.y) 
+      this->alpha = 0.25;
+    else if(distance > 0.1*snowSize.x || distance > 0.1*snowSize.y) 
+      this->alpha = 0.4;
+
+    SnowEffect::snowParticles->setColor(0,1, 1, 1, alpha);
+    SnowEffect::snowParticles->setColor(.5, .6, .6, .6, alpha/2);
+    SnowEffect::snowParticles->setColor(1, .0, .0, .0, .0);
+  }
+  else
+  {
+  if(distance < 0.3*snowSize.x || distance < 0.3*snowSize.y )
+    this->activate();
+  if( distance < 0.25*snowSize.x || distance < 0.25*snowSize.y )
+    this->alpha = 0.25;
+  else if( distance < 0.2*snowSize.x || distance < 0.2*snowSize.y )
+    this->alpha = 0.4;
+  else if( distance < 0.1*snowSize.x || distance < 0.1*snowSize.y )
+    this->alpha = 0.5;
+
+    SnowEffect::snowParticles->setColor(0,1, 1, 1, alpha);
+    SnowEffect::snowParticles->setColor(.5, .6, .6, .6, alpha/2);
+    SnowEffect::snowParticles->setColor(1, .0, .0, .0, .0);
+  }
+}
+
Index: trunk/src/lib/graphics/effects/snow_effect.h
===================================================================
--- trunk/src/lib/graphics/effects/snow_effect.h	(revision 7810)
+++ trunk/src/lib/graphics/effects/snow_effect.h	(revision 7810)
@@ -0,0 +1,78 @@
+/**
+* @file snow_effect.h
+*/
+
+#ifndef _SNOW_EFFECT
+#define _SNOW_EFFECT
+
+#include "vector.h"
+#include "particle_system.h"
+#include "material.h"
+#include "vector2D.h"
+
+#include "weather_effect.h"
+
+class SpriteParticles;
+class PlaneEmitter;
+class PNode;
+
+#include "sound_source.h"
+#include "sound_buffer.h"
+
+class SnowEffect : public WeatherEffect
+{
+	public:
+		SnowEffect(const TiXmlElement* root = NULL);
+		virtual ~SnowEffect();
+
+		virtual void loadParams(const TiXmlElement* root);
+
+		virtual bool init();
+
+		virtual bool activate();
+		virtual bool deactivate();
+
+		virtual void draw() const;
+		virtual void tick(float dt);
+
+		void activateSnow();
+		void deactivateSnow();
+
+		inline void numParticles(int n) { this->particles = n; }
+		inline void materialTexture(const std::string& texture) { this->texture = texture; }
+		inline void lifeSpan(float lifeSpan, float randomLifeSpan) { this->life = lifeSpan; this->randomLife = randomLifeSpan; }
+		inline void radius(float radius, float randomRadius) { this->snowRadius = radius; this->randomRadius = randomRadius; }
+		inline void mass(float mass, float randomMass) { this->snowMass = mass; this->randomMass = randomMass; }
+		inline void emissionRate(float emissionRate){ this->rate = emissionRate; }
+		inline void emissionVelocity(float velocity, float randomVelocity){ this->velocity = velocity; this->randomVelocity = randomVelocity; }
+		inline void size(float sizeX, float sizeY) { this->snowSize = Vector2D(sizeX, sizeY); }
+		inline void coord(float x, float y, float z) { this->snowCoord = Vector(x, y, z); }
+    inline void wind(int force) { this->snowWindForce = force; }
+
+
+	private:
+		int 																particles;
+		std::string 												texture;
+		float 															life, randomLife;
+		float																snowRadius, randomRadius;
+		float																snowMass, randomMass;
+		float 															rate;
+		float 															velocity, randomVelocity;
+		float 															angle, randomAngle;
+		float 															alpha;
+		Vector 															snowCoord;
+		Vector2D 														snowSize;
+		int																	snowWindForce;
+
+		bool																activated;
+
+		PlaneEmitter*												emitter;
+
+		static SpriteParticles* 						snowParticles;
+		OrxSound::SoundSource              soundSource;
+		OrxSound::SoundBuffer*             windBuffer;
+
+};
+
+
+#endif  /* _SNOW_EFFECT */
Index: trunk/src/lib/graphics/effects/sun_effect.cc
===================================================================
--- trunk/src/lib/graphics/effects/sun_effect.cc	(revision 7810)
+++ trunk/src/lib/graphics/effects/sun_effect.cc	(revision 7810)
@@ -0,0 +1,76 @@
+
+
+/*
+   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
+*/
+
+
+#include "sun_effect.h"
+
+#include "util/loading/load_param.h"
+
+
+using namespace std;
+
+
+
+/**
+ * @param root The XML-element to load the SunEffect from
+ */
+SunEffect::SunEffect(const TiXmlElement* root)
+{
+  this->setClassID(CL_SUN_EFFECT, "SunEffect");
+  this->bActivated = false;
+}
+
+
+/**
+ *  destroys a SunEffect
+ */
+SunEffect::~SunEffect()
+{
+
+}
+
+
+/**
+ * @param root The XML-element to load the SunEffect from
+ */
+void SunEffect::loadParams(const TiXmlElement* root)
+{
+  BaseObject::loadParams(root);
+}
+
+
+/**
+ *  initializes the graphics effect
+ */
+bool SunEffect::init()
+{}
+
+
+
+/**
+ * draws the effect, if needed
+ */
+void SunEffect::draw() const
+{}
+
+
+
+/**
+ * ticks the effect if there is any time dependancy
+ */
+void SunEffect::tick(float dt)
+{}
+
Index: trunk/src/lib/graphics/effects/sun_effect.h
===================================================================
--- trunk/src/lib/graphics/effects/sun_effect.h	(revision 7810)
+++ trunk/src/lib/graphics/effects/sun_effect.h	(revision 7810)
@@ -0,0 +1,37 @@
+/*!
+ * @file sun_effect.h
+ *  
+ */
+
+#ifndef _SUN_EFFECT_H
+#define _SUN_EFFECT_H
+
+#include "base_object.h"
+
+
+class TiXmlElement;
+
+class SunEffect : public BaseObject
+{
+  public:
+    SunEffect(const TiXmlElement* root = NULL);
+    virtual ~SunEffect();
+
+    virtual void loadParams(const TiXmlElement* root);
+
+    virtual bool init();
+
+    virtual bool activate() = 0;
+    virtual bool deactivate() = 0;
+
+    virtual void draw() const;
+    virtual void tick(float dt);
+
+    inline bool isActivated() const { return this->bActivated; }
+
+  protected:
+    bool              bActivated;
+};
+
+
+#endif /* _SUN_EFFECT */
Index: trunk/src/lib/graphics/effects/volfog_effect.cc
===================================================================
--- trunk/src/lib/graphics/effects/volfog_effect.cc	(revision 7810)
+++ trunk/src/lib/graphics/effects/volfog_effect.cc	(revision 7810)
@@ -0,0 +1,214 @@
+/*
+	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
+*/
+
+#include "volfog_effect.h"
+
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
+
+#include "p_node.h"
+#include "state.h"
+
+#include "glincl.h"
+//#include "shell_command.h"
+
+#define GLX_GLXEXT_PROTOTYPES
+#include <GL/glx.h>
+// #include <GL/glut.h>
+
+//#include <GL/glext.h> //OpenGL Extensions
+//#include <GL/glxext.h> // GLX Extensions 
+
+#ifndef GL_EXT_fog_coord
+#define GL_EXT_fog_coord 1
+typedef void (APIENTRY * PFNGLFOGCOORDFEXTPROC) (GLfloat coord);
+typedef void (APIENTRY * PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord);
+typedef void (APIENTRY * PFNGLFOGCOORDDEXTPROC) (GLdouble coord);
+typedef void (APIENTRY * PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord);
+typedef void (APIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+PFNGLFOGCOORDFEXTPROC glFogCoordfEXT = 0;
+PFNGLFOGCOORDFVEXTPROC glFogCoordfvEXT = 0;
+PFNGLFOGCOORDDEXTPROC glFogCoorddEXT = 0;
+PFNGLFOGCOORDDVEXTPROC glFogCoorddvEXT = 0;
+PFNGLFOGCOORDPOINTEREXTPROC glFogCoordPointerEXT = 0;
+
+
+using namespace std;
+
+CREATE_FACTORY(VolFogEffect, CL_VOLFOG_EFFECT);
+
+VolFogEffect::VolFogEffect(const TiXmlElement* root)
+{
+	this->setClassID(CL_VOLFOG_EFFECT, "VolFogEffect");
+
+	if (root != NULL)
+		this->loadParams(root);
+
+	// Initialize Effect
+	this->init();
+
+	// Activate Effect
+	this->activate();
+}
+
+
+VolFogEffect::~VolFogEffect()
+{
+	this->deactivate();
+}
+
+void VolFogEffect::loadParams(const TiXmlElement* root)
+{
+	WeatherEffect::loadParams(root);
+}
+
+bool VolFogEffect::init()
+{
+	PRINTF(0)("Initalize VolFogEffect\n");
+
+	// set fog mode
+	GLenum fogMode  = GL_EXP;
+
+	// set fog density
+	float  fogDensity  = 0.001f;
+
+	// set fog near & far distance
+	float fogStart = 0.0f;
+	float fogEnd   = 1000.0f;
+
+	// Set fog color
+	float fogColor[4] = {0.6f,0.58f,0.79f,0.0f};
+	
+
+	glFogCoordfEXT       = (PFNGLFOGCOORDFEXTPROC)glXGetProcAddressARB((const GLubyte*)"glFogCoordfEXT");
+	glFogCoordfvEXT      = (PFNGLFOGCOORDFVEXTPROC)glXGetProcAddressARB((const GLubyte*)"glFogCoordfvEXT");
+	glFogCoorddEXT       = (PFNGLFOGCOORDDEXTPROC)glXGetProcAddressARB((const GLubyte*)"glFogCoorddEXT");
+	glFogCoorddvEXT      = (PFNGLFOGCOORDDVEXTPROC)glXGetProcAddressARB((const GLubyte*)"glFogCoorddvEXT");
+	glFogCoordPointerEXT = (PFNGLFOGCOORDPOINTEREXTPROC)glXGetProcAddressARB((const GLubyte*)"glFogCoordPointerEXT");
+
+	// set the fog attributes
+	glFogf (GL_FOG_START,  fogStart);
+	glFogf (GL_FOG_END,    fogEnd);
+	glFogfv(GL_FOG_COLOR,  fogColor);
+	glFogi (GL_FOG_MODE,   fogMode);
+	glFogf (GL_FOG_DENSITY,fogDensity);
+	glFogi (GL_FOG_COORDINATE_SOURCE_EXT,GL_FOG_COORDINATE_EXT);
+
+	// enable the fog
+	glEnable(GL_FOG);
+
+	if (glewInit() == GLEW_OK)
+		PRINTF(0)("glewInit OK\n");
+	else
+		PRINTF(0)("glewInit failed\n");
+
+	if (glewGetExtension("GL_EXT_fog_coord"))
+	{
+		PRINTF(0)("GL_EXT_fog_coord extension found\n");
+		return true;
+	}
+	else
+	{
+		PRINTF(0)("GL_EXT_fog_coord extension NOT found\n");
+		return false;
+	}
+}
+
+
+bool VolFogEffect::activate()
+{
+	PRINTF(0)("Activating VolFogEffect\n");
+}
+
+bool VolFogEffect::deactivate()
+{
+	PRINTF(0)("Deactivating VolFogEffect\n");
+
+	glDisable(GL_FOG);
+}
+
+
+/**
+* draws the effect, if needed
+*/
+void VolFogEffect::draw() const
+{
+  glPushAttrib(GL_ENABLE_BIT);
+  glClearColor(fogColor[0],fogColor[1],fogColor[2],0.0f);
+	glShadeModel(GL_SMOOTH);
+	glEnable(GL_DEPTH_TEST);
+	glEnable(GL_CULL_FACE);
+	glCullFace(GL_BACK);
+
+	/* clear all pixels in colour buffer */
+	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+	/* Enable blending */
+	//glEnable(GL_BLEND);
+	//glBlendFunc(GL_SRC_ALPHA, GL_DST_ALPHA);
+	
+	int i;
+	glLoadIdentity();
+
+	
+	glBegin( GL_LINES );
+		glNormal3f(0,1,0);
+		for(i=-20;i<=20;i+=2)
+		{
+			float fog_c;
+			float diff[3];
+
+			diff[0] = State::getCameraNode()->getAbsCoor().x - i;
+			diff[2] = State::getCameraNode()->getAbsCoor().z + 20;
+			diff[1] = State::getCameraNode()->getAbsCoor().y;
+			fog_c = 1.3f*sqrt(diff[0]*diff[0]+diff[1]*diff[1]+diff[2]*diff[2]);
+			glFogCoordfEXT(fog_c*2);
+			glVertex3f(i,0,-20);
+
+			diff[0] = State::getCameraNode()->getAbsCoor().x - i;
+			diff[2] = State::getCameraNode()->getAbsCoor().z + 20;
+			diff[1] = State::getCameraNode()->getAbsCoor().y;
+			fog_c = 1.3f*sqrt(diff[0]*diff[0]+diff[1]*diff[1]+diff[2]*diff[2]);
+			glFogCoordfEXT(fog_c*2);
+			glVertex3f(i,0,20);
+
+			diff[0] = State::getCameraNode()->getAbsCoor().x - i;
+			diff[2] = State::getCameraNode()->getAbsCoor().z + 20;
+			diff[1] = State::getCameraNode()->getAbsCoor().y;
+			fog_c = 1.3f*sqrt(diff[0]*diff[0]+diff[1]*diff[1]+diff[2]*diff[2]);
+			glFogCoordfEXT(fog_c*2);
+			glVertex3f(-20,0,i);
+
+			diff[0] = State::getCameraNode()->getAbsCoor().x - i;
+			diff[2] = State::getCameraNode()->getAbsCoor().z + 20;
+			diff[1] = State::getCameraNode()->getAbsCoor().y;
+			fog_c = 1.3f*sqrt(diff[0]*diff[0]+diff[1]*diff[1]+diff[2]*diff[2]);
+			glFogCoordfEXT(fog_c*2);
+			glVertex3f(20,0,i);
+		}
+	glEnd();
+
+  glPopAttrib();
+
+}
+
+
+/**
+* ticks the effect if there is any time dependancy
+*/
+void VolFogEffect::tick(float dt)	
+{
+}
Index: trunk/src/lib/graphics/effects/volfog_effect.h
===================================================================
--- trunk/src/lib/graphics/effects/volfog_effect.h	(revision 7810)
+++ trunk/src/lib/graphics/effects/volfog_effect.h	(revision 7810)
@@ -0,0 +1,33 @@
+/**
+* @file volfog_effect.h
+*/
+
+#ifndef _VOLFOG_EFFECT
+#define _VOLFOG_EFFECT
+
+#include "vector.h"
+
+#include "weather_effect.h"
+
+class VolFogEffect : public WeatherEffect
+{
+	public:
+		VolFogEffect(const TiXmlElement* root = NULL);
+		virtual ~VolFogEffect();
+
+		virtual void loadParams(const TiXmlElement* root);
+
+		virtual bool init();
+
+		virtual bool activate();
+		virtual bool deactivate();
+
+		virtual void draw() const;
+		virtual void tick(float dt);
+
+	private:
+		GLfloat fogColor[4];
+
+};
+
+#endif  /* _VOLFOG_EFFECT */
Index: trunk/src/lib/graphics/effects/weather_effect.cc
===================================================================
--- trunk/src/lib/graphics/effects/weather_effect.cc	(revision 7810)
+++ trunk/src/lib/graphics/effects/weather_effect.cc	(revision 7810)
@@ -0,0 +1,74 @@
+
+
+/*
+   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
+*/
+
+
+#include "weather_effect.h"
+#include "util/loading/load_param.h"
+
+
+using namespace std;
+
+
+/**
+ * @param root The XML-element to load the WeatherEffect from
+ */
+WeatherEffect::WeatherEffect(const TiXmlElement* root)
+{
+  this->setClassID(CL_WEATHER_EFFECT, "WeatherEffect");
+  this->bActivated = false;
+}
+
+
+/**
+ *  destroys a WeatherEffects
+ */
+WeatherEffect::~WeatherEffect()
+{
+
+}
+
+
+/**
+ * @param root The XML-element to load the WeatherEffects from
+ */
+void WeatherEffect::loadParams(const TiXmlElement* root)
+{
+  BaseObject::loadParams(root);
+}
+
+
+/**
+ *  initializes the graphics effect
+ */
+bool WeatherEffect::init()
+{}
+
+
+
+/**
+ * draws the effect, if needed
+ */
+void WeatherEffect::draw() const
+{}
+
+
+
+/**
+ * ticks the effect if there is any time dependancy
+ */
+void WeatherEffect::tick(float dt)
+{}
+
Index: trunk/src/lib/graphics/effects/weather_effect.h
===================================================================
--- trunk/src/lib/graphics/effects/weather_effect.h	(revision 7810)
+++ trunk/src/lib/graphics/effects/weather_effect.h	(revision 7810)
@@ -0,0 +1,36 @@
+/*!
+ * @file weather_effect.h
+ *  
+ */
+
+#ifndef _WEATHER_EFFECT_H
+#define _WEATHER_EFFECT_H
+
+#include "base_object.h"
+
+
+class WeatherEffect : public BaseObject
+{
+  public:
+    WeatherEffect(const TiXmlElement* root = NULL);
+    virtual ~WeatherEffect();
+
+    virtual void loadParams(const TiXmlElement* root);
+
+    virtual bool init();
+
+    virtual bool activate() = 0;
+    virtual bool deactivate() = 0;
+
+    virtual void draw() const;
+    virtual void tick(float dt);
+
+    inline bool isActivated() const { return this->bActivated; }
+
+
+  protected:
+    bool              bActivated;
+};
+
+
+#endif /* _WEATHER_EFFECT */
Index: trunk/src/lib/graphics/render2D/billboard.cc
===================================================================
--- trunk/src/lib/graphics/render2D/billboard.cc	(revision 7796)
+++ 	(revision )
@@ -1,171 +1,0 @@
-/*
-   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: Patrick Boenzli
-*/
-
-#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
-
-#include "billboard.h"
-
-#include "util/loading/load_param.h"
-#include "util/loading/factory.h"
-
-#include "graphics_engine.h"
-#include "material.h"
-#include "glincl.h"
-#include "state.h"
-#include "p_node.h"
-
-
-using namespace std;
-
-
-CREATE_FACTORY(Billboard, CL_IMAGE_ENTITY);
-
-
-/**
- * standart constructor
- */
-Billboard::Billboard (const TiXmlElement* root)
-{
-  this->init();
-
-  if( root)
-    this->loadParams(root);
-}
-
-
-/**
- * destroys a Billboard
- */
-Billboard::~Billboard ()
-{
-  if (this->material)
-    delete this->material;
-}
-
-
-/**
- * initializes the Billboard
- */
-void Billboard::init()
-{
-  this->setClassID(CL_BILLBOARD, "Billboard");
-  this->setName("Billboard");
-
-  this->setLayer(E2D_LAYER_TOP);
-  this->setSize(GraphicsEngine::getInstance()->getResolutionX()/10.0, GraphicsEngine::getInstance()->getResolutionY()/10.0);
-
-  //this->setBindNode(this);
-  this->material = new Material();
-  this->setTexture("pictures/error_texture.png");
-}
-
-
-/**
- *  load params
- * @param root TiXmlElement object
- */
-void Billboard::loadParams(const TiXmlElement* root)
-{
-  LoadParam(root, "texture", this->material, Material, setDiffuseMap)
-      .describe("the texture-file to load onto the Billboard");
-
-  LoadParam(root, "size", this, Billboard, setSize)
-      .describe("the size of the Billboard in Pixels");
-}
-
-
-/**
- * sets the size of the Billboard.
- * @param size the size in pixels
- */
-void Billboard::setSize(float sizeX, float sizeY)
-{
-  this->setSize2D(sizeX, sizeY);
-}
-
-
-/**
- * sets the material to load
- * @param textureFile The texture-file to load onto the crosshair
- */
-void Billboard::setTexture(const std::string& textureFile)
-{
-  this->material->setDiffuseMap(textureFile);
-}
-
-
-/**
- * attaches this billboard to a parent
- * @param pNode node to attach to
- */
-void Billboard::attachTo(PNode* pNode)
-{
-  this->source->setParent(pNode);
-}
-
-
-/**
- * ticks the Billboard
- * @param dt the time to ticks
- */
-void Billboard::tick(float dt)
-{
-  float z = 0.0f;
-  glReadPixels ((int)this->getAbsCoor2D().x,
-                 GraphicsEngine::getInstance()->getResolutionY()-(int)this->getAbsCoor2D().y-1,
-                 1,
-                 1,
-                 GL_DEPTH_COMPONENT,
-                 GL_FLOAT,
-                 &z);
-
-  GLdouble objX=.0, objY=.0, objZ=.0;
-  gluUnProject(this->getAbsCoor2D().x,
-               GraphicsEngine::getInstance()->getResolutionY()-this->getAbsCoor2D().y-1,
-               .99,  // z
-               GraphicsEngine::modMat,
-               GraphicsEngine::projMat,
-               GraphicsEngine::viewPort,
-               &objX,
-               &objY,
-               &objZ );
-}
-
-
-/**
- * draws the billboard
- */
-void Billboard::draw() const
-{
-  if( !this->isVisible())
-    return;
-
-  glPushMatrix();
-
-  glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0);
-  this->material->select();
-
-  glBegin(GL_TRIANGLE_STRIP);
-  glTexCoord2f(0, 0);
-  glVertex2f(-this->getSizeX2D(), -this->getSizeY2D());
-  glTexCoord2f(1, 0);
-  glVertex2f(this->getSizeX2D(), -this->getSizeY2D());
-  glTexCoord2f(0, 1);
-  glVertex2f(-this->getSizeX2D(), this->getSizeY2D());
-  glTexCoord2f(1, 1);
-  glVertex2f(this->getSizeX2D(), this->getSizeY2D());
-  glEnd();
-
-  glPopMatrix();
-}
Index: trunk/src/lib/graphics/render2D/billboard.h
===================================================================
--- trunk/src/lib/graphics/render2D/billboard.h	(revision 7796)
+++ 	(revision )
@@ -1,47 +1,0 @@
-/*!
- * @file billboard.h
- *  Definition of a billboard
- */
-
-#ifndef _BILLBOARD_H
-#define _BILLBOARD_H
-
-
-#include "element_2d.h"
-
-#include "vector.h"
-
-
-
-class Model;
-class Material;
-class TiXmlElement;
-
-//! A class that enables the
-class Billboard :  public Element2D
-{
-
-  public:
-    Billboard(const TiXmlElement* root = NULL);
-    virtual ~Billboard();
-
-    void init();
-    void loadParams(const TiXmlElement* root);
-
-    void setSize(float sizeX, float sizeY);
-    void setTexture(const std::string& textureFile);
-    void attachTo(PNode* pnode);
-
-    virtual void tick(float dt);
-    virtual void draw() const;
-
-
-  private:
-    Material*        material;             //!< a material for the Billboard
-    float            rotationSpeed;        //!< Speed of the Rotation.
-
-    PNode*           source;               //!< the source attached to it
-
-};
-
-#endif /* _BILLBOARD_H */
Index: trunk/src/lib/graphics/render2D/image_plane.cc
===================================================================
--- trunk/src/lib/graphics/render2D/image_plane.cc	(revision 7810)
+++ trunk/src/lib/graphics/render2D/image_plane.cc	(revision 7810)
@@ -0,0 +1,171 @@
+/*
+   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: Patrick Boenzli
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
+
+#include "image_plane.h"
+
+#include "util/loading/load_param.h"
+#include "util/loading/factory.h"
+
+#include "graphics_engine.h"
+#include "material.h"
+#include "glincl.h"
+#include "state.h"
+#include "p_node.h"
+
+
+using namespace std;
+
+
+CREATE_FACTORY(ImagePlane, CL_IMAGE_ENTITY);
+
+
+/**
+ * standart constructor
+ */
+ImagePlane::ImagePlane (const TiXmlElement* root)
+{
+  this->init();
+
+  if( root)
+    this->loadParams(root);
+}
+
+
+/**
+ * destroys a ImagePlane
+ */
+ImagePlane::~ImagePlane ()
+{
+  if (this->material)
+    delete this->material;
+}
+
+
+/**
+ * initializes the ImagePlane
+ */
+void ImagePlane::init()
+{
+  this->setClassID(CL_IMAGE_PLANE, "ImagePlane");
+  this->setName("ImagePlane");
+
+  this->setLayer(E2D_LAYER_TOP);
+  this->setSize(GraphicsEngine::getInstance()->getResolutionX()/10.0, GraphicsEngine::getInstance()->getResolutionY()/10.0);
+
+  //this->setBindNode(this);
+  this->material = new Material();
+  this->setTexture("pictures/error_texture.png");
+}
+
+
+/**
+ *  load params
+ * @param root TiXmlElement object
+ */
+void ImagePlane::loadParams(const TiXmlElement* root)
+{
+  LoadParam(root, "texture", this->material, Material, setDiffuseMap)
+      .describe("the texture-file to load onto the ImagePlane");
+
+  LoadParam(root, "size", this, ImagePlane, setSize)
+      .describe("the size of the ImagePlane in Pixels");
+}
+
+
+/**
+ * sets the size of the ImagePlane.
+ * @param size the size in pixels
+ */
+void ImagePlane::setSize(float sizeX, float sizeY)
+{
+  this->setSize2D(sizeX, sizeY);
+}
+
+
+/**
+ * sets the material to load
+ * @param textureFile The texture-file to load onto the crosshair
+ */
+void ImagePlane::setTexture(const std::string& textureFile)
+{
+  this->material->setDiffuseMap(textureFile);
+}
+
+
+/**
+ * attaches this image_plane to a parent
+ * @param pNode node to attach to
+ */
+void ImagePlane::attachTo(PNode* pNode)
+{
+  this->source->setParent(pNode);
+}
+
+
+/**
+ * ticks the ImagePlane
+ * @param dt the time to ticks
+ */
+void ImagePlane::tick(float dt)
+{
+  float z = 0.0f;
+  glReadPixels ((int)this->getAbsCoor2D().x,
+                 GraphicsEngine::getInstance()->getResolutionY()-(int)this->getAbsCoor2D().y-1,
+                 1,
+                 1,
+                 GL_DEPTH_COMPONENT,
+                 GL_FLOAT,
+                 &z);
+
+  GLdouble objX=.0, objY=.0, objZ=.0;
+  gluUnProject(this->getAbsCoor2D().x,
+               GraphicsEngine::getInstance()->getResolutionY()-this->getAbsCoor2D().y-1,
+               .99,  // z
+               GraphicsEngine::modMat,
+               GraphicsEngine::projMat,
+               GraphicsEngine::viewPort,
+               &objX,
+               &objY,
+               &objZ );
+}
+
+
+/**
+ * draws the image_plane
+ */
+void ImagePlane::draw() const
+{
+  if( !this->isVisible())
+    return;
+
+  glPushMatrix();
+
+  glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0);
+  this->material->select();
+
+  glBegin(GL_TRIANGLE_STRIP);
+  glTexCoord2f(0, 0);
+  glVertex2f(-this->getSizeX2D(), -this->getSizeY2D());
+  glTexCoord2f(1, 0);
+  glVertex2f(this->getSizeX2D(), -this->getSizeY2D());
+  glTexCoord2f(0, 1);
+  glVertex2f(-this->getSizeX2D(), this->getSizeY2D());
+  glTexCoord2f(1, 1);
+  glVertex2f(this->getSizeX2D(), this->getSizeY2D());
+  glEnd();
+
+  glPopMatrix();
+}
Index: trunk/src/lib/graphics/render2D/image_plane.h
===================================================================
--- trunk/src/lib/graphics/render2D/image_plane.h	(revision 7810)
+++ trunk/src/lib/graphics/render2D/image_plane.h	(revision 7810)
@@ -0,0 +1,46 @@
+/*!
+ * @file image_plane.h
+ *  Definition of a image_plane
+ */
+
+#ifndef _IMAGE_PLANE_H
+#define _IMAGE_PLANE_H
+
+
+#include "element_2d.h"
+
+#include "vector.h"
+
+
+
+class Material;
+class TiXmlElement;
+
+//! A class that enables the
+class ImagePlane :  public Element2D
+{
+
+  public:
+    ImagePlane(const TiXmlElement* root = NULL);
+    virtual ~ImagePlane();
+
+    void init();
+    void loadParams(const TiXmlElement* root);
+
+    void setSize(float sizeX, float sizeY);
+    void setTexture(const std::string& textureFile);
+    void attachTo(PNode* pnode);
+
+    virtual void tick(float dt);
+    virtual void draw() const;
+
+
+  private:
+    Material*        material;             //!< a material for the ImagePlane
+    float            rotationSpeed;        //!< Speed of the Rotation.
+
+    PNode*           source;               //!< the source attached to it
+
+};
+
+#endif /* _IMAGE_PLANE_H */
Index: trunk/src/lib/sound/sound_source.cc
===================================================================
--- trunk/src/lib/sound/sound_source.cc	(revision 7796)
+++ trunk/src/lib/sound/sound_source.cc	(revision 7810)
@@ -122,5 +122,6 @@
         alSourceStop(this->sourceID);
       alSourcei (this->sourceID, AL_BUFFER, this->buffer->getID());
-      alSourcePlay(this->sourceID);
+    alSourcei (this->sourceID, AL_LOOPING,  AL_FALSE  );
+    alSourcePlay(this->sourceID);
 
       if (DEBUG_LEVEL >= 3)
@@ -143,7 +144,8 @@
     }
 
-    alSourceStop(this->sourceID);
-    alSourcei (this->sourceID, AL_BUFFER, buffer->getID());
-    alSourcePlay(this->sourceID);
+  alSourceStop(this->sourceID);
+  alSourcei (this->sourceID, AL_BUFFER, buffer->getID());
+  alSourcei (this->sourceID, AL_LOOPING,  AL_FALSE  );
+  alSourcePlay(this->sourceID);
 
     if (unlikely(this->buffer != NULL))
@@ -156,8 +158,33 @@
 
 
-  /**
-   * @brief Stops playback of a SoundSource
-   */
-  void SoundSource::stop()
+/**
+ * @brief Plays and loops buffer on this Source
+ * @param buffer the buffer to play back on this Source
+ */
+void SoundSource::loop(const SoundBuffer* buffer)
+{
+  if (this->buffer && this->retrieveSource())
+  {
+    if (this->bPlay)
+      alSourceStop(this->sourceID);
+
+    alSourcei (this->sourceID, AL_BUFFER, this->buffer->getID());
+    alSourcei (this->sourceID, AL_LOOPING,  AL_TRUE  );
+    alSourcePlay(this->sourceID);
+
+    if (DEBUG_LEVEL >= 3)
+      SoundEngine::checkError("Play LoopSource", __LINE__);
+    this->bPlay = true;
+  }
+}
+
+
+/**
+ * @brief Stops playback of a SoundSource
+ */
+void SoundSource::stop()
+{
+  this->bPlay = false;
+  if (this->sourceID != 0)
   {
     this->bPlay = false;
@@ -173,5 +200,5 @@
     }
   }
-
+}
 
   /**
Index: trunk/src/lib/sound/sound_source.h
===================================================================
--- trunk/src/lib/sound/sound_source.h	(revision 7796)
+++ trunk/src/lib/sound/sound_source.h	(revision 7810)
@@ -29,4 +29,6 @@
     void play();
     void play(const SoundBuffer* buffer);
+    void loop();
+    void loop(const SoundBuffer* buffer);
     void stop();
     void pause();
Index: trunk/src/story_entities/game_world.cc
===================================================================
--- trunk/src/story_entities/game_world.cc	(revision 7796)
+++ trunk/src/story_entities/game_world.cc	(revision 7810)
@@ -43,4 +43,5 @@
 
 #include "graphics_engine.h"
+#include "effects/atmospheric_engine.h"
 #include "event_handler.h"
 #include "sound_engine.h"
@@ -384,4 +385,5 @@
 
     GraphicsEngine::getInstance()->tick(this->dtS);
+    AtmosphericEngine::getInstance()->tick(this->dtS);
 
     if( likely(this->dataTank->gameRule != NULL))
@@ -524,4 +526,6 @@
   GraphicsEngine* engine = GraphicsEngine::getInstance();
 
+  AtmosphericEngine::getInstance()->draw();
+
   // set camera
   this->dataTank->localCamera->apply ();
Index: trunk/src/story_entities/game_world_data.cc
===================================================================
--- trunk/src/story_entities/game_world_data.cc	(revision 7796)
+++ trunk/src/story_entities/game_world_data.cc	(revision 7810)
@@ -45,4 +45,5 @@
 
 #include "graphics_engine.h"
+#include "effects/atmospheric_engine.h"
 #include "event_handler.h"
 #include "sound_engine.h"
@@ -322,4 +323,5 @@
   LoadParamXML(root, "LightManager", LightManager::getInstance(), LightManager, loadParams);
   LoadParamXML(root, "GraphicsEngine", GraphicsEngine::getInstance(), GraphicsEngine, loadParams);
+  LoadParamXML(root, "AtmosphericEngine", AtmosphericEngine::getInstance(), AtmosphericEngine, loadParams);
 
   LoadParam(root, "Music", this, GameWorldData, setSoundTrack);
@@ -346,4 +348,5 @@
   /* delete some garphics and scene eingines */
   delete LightManager::getInstance();
+  delete AtmosphericEngine::getInstance();
 
   if (this->music != NULL)
Index: trunk/src/util/multiplayer_team_deathmatch.cc
===================================================================
--- trunk/src/util/multiplayer_team_deathmatch.cc	(revision 7796)
+++ trunk/src/util/multiplayer_team_deathmatch.cc	(revision 7810)
@@ -20,5 +20,5 @@
 #include "util/loading/factory.h"
 
-#include "render2D/billboard.h"
+#include "render2D/image_plane.h"
 #include "state.h"
 #include "class_list.h"
@@ -53,5 +53,5 @@
   this->timeout = 0.0f;
 
-  this->deathScreen = new Billboard();
+  this->deathScreen = new ImagePlane();
   this->deathScreen->setSize(State::getResX()/4.0, State::getResY()/4.0);
   this->deathScreen->setAbsCoor2D(State::getResX()/2.0f, State::getResY()/2.0f);
Index: trunk/src/util/multiplayer_team_deathmatch.h
===================================================================
--- trunk/src/util/multiplayer_team_deathmatch.h	(revision 7796)
+++ trunk/src/util/multiplayer_team_deathmatch.h	(revision 7810)
@@ -16,5 +16,5 @@
 class ObjectManager;
 class Player;
-class Billboard;
+class ImagePlane;
 
 
@@ -52,5 +52,5 @@
     int                teamBKills;                 //!< kills of team B
 
-    Billboard*         deathScreen;                //!< the death screen
+    ImagePlane*         deathScreen;                //!< the death screen
 };
 
Index: trunk/src/world_entities/effects/billboard.cc
===================================================================
--- trunk/src/world_entities/effects/billboard.cc	(revision 7810)
+++ trunk/src/world_entities/effects/billboard.cc	(revision 7810)
@@ -0,0 +1,149 @@
+/*
+   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: Patrick Boenzli
+*/
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON
+
+
+#include "lightning_bolt.h"
+
+#include "util/loading/factory.h"
+#include "material.h"
+
+#include "util/loading/resource_manager.h"
+
+
+
+using namespace std;
+
+CREATE_FACTORY(LightningBolt, CL_LIGHTNING_BOLT);
+
+
+/**
+ *  standard constructor
+*/
+LightningBolt::LightningBolt (const TiXmlElement* root)
+{
+  this->setClassID(CL_LIGHTNING_BOLT, "LightningBolt");
+
+  this->toList(OM_COMMON);
+
+  this->bRender = false;
+  this->time = 0.0;
+  this->flashFrequency = 0.6f;
+  this->flashConstTime = 0.07f;
+
+  this->material = new Material();
+  this->material->setDiffuseMap("maps/lightning_bolt.png");
+  //this->offset = Vector(-1440.00, 100.00, 280.00);
+
+  this->setAbsCoor(offset);
+  this->width = 100.0f;
+  this->height = 300.0f;
+  this->bNewCoordinate = false;
+
+  this->seedX = 200.f;
+  this->seedZ = 500.0f;
+  this->seedTime = 4.0f;
+
+  this->soundSource.setSourceNode(this);
+
+  //load sound
+  if (this->thunderBuffer != NULL)
+    ResourceManager::getInstance()->unload(this->thunderBuffer);
+  this->thunderBuffer = (SoundBuffer*)ResourceManager::getInstance()->load("sound/thunder.wav", WAV);
+}
+
+
+/**
+ *  standard deconstructor
+*/
+LightningBolt::~LightningBolt ()
+{
+}
+
+void LightningBolt::activate()
+{
+}
+
+
+void LightningBolt::deactivate()
+{
+
+}
+
+
+/**
+ *  signal tick, time dependent things will be handled here
+ * @param time since last tick
+*/
+void LightningBolt::tick (float dt)
+{
+  this->time += dt;
+
+  if( this->time > this->flashFrequency)
+  {
+    this->bRender = true;
+    this->time = 0.0f;
+    this->soundSource.play(this->thunderBuffer);
+  }
+  else if( this->bRender && this->time > this->flashConstTime)
+  {
+    this->bRender = false;
+    this->time = 0.0f;
+    this->bNewCoordinate = true;
+  }
+
+  if( this->bNewCoordinate)
+  {
+    this->flashFrequency = this->seedTime * (float)rand()/(float)RAND_MAX + 0.1;
+    this->setAbsCoor( - 800.0f - this->seedX * (float)rand()/(float)RAND_MAX, 250.00, -200.0f + this->seedZ * (float)rand()/(float)RAND_MAX);
+    this->bNewCoordinate = false;
+  }
+}
+
+
+void LightningBolt::draw() const
+{
+  if( this->bRender)
+  {
+
+    glPushMatrix();
+    glTranslatef (this->getAbsCoor ().x,
+                  this->getAbsCoor ().y,
+                  this->getAbsCoor ().z);
+
+    glRotatef(90, 0.0f,1.0f,0.0f);
+
+//     Vector tmpRot = drawPart->orientation.getSpacialAxis();
+//     glRotatef (drawPart->orientation.getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
+
+//     glPushAttrib(GL_ENABLE_BIT);
+//     glDisable(GL_LIGHTING);
+//     glDisable(GL_BLEND);
+
+    this->material->select();
+
+    glBegin(GL_QUADS);
+    glTexCoord2f(1.0f, 1.0f); glVertex3f(-width/2, -height/2,  0.0f);
+    glTexCoord2f(0.0f, 1.0f); glVertex3f( width/2, -height/2,  0.0f);
+    glTexCoord2f(0.0f, 0.0f); glVertex3f( width/2,  height/2,  0.0f);
+    glTexCoord2f(1.0f, 0.0f); glVertex3f(-width/2,  height/2,  0.0f);
+    glEnd();
+
+//     glPopAttrib();
+
+    glPopMatrix();
+  }
+}
+
+
Index: trunk/src/world_entities/effects/billboard.h
===================================================================
--- trunk/src/world_entities/effects/billboard.h	(revision 7810)
+++ trunk/src/world_entities/effects/billboard.h	(revision 7810)
@@ -0,0 +1,51 @@
+/*!
+ * @file lightning_bolt.h
+ * @brief a LightningBolt Projectile
+ */
+
+#ifndef _LIGHTNING_BOLT_H
+#define _LIGHTNING_BOLT_H
+
+#include "world_entity.h"
+
+#include "sound_buffer.h"
+#include "sound_source.h"
+
+class Material;
+
+class LightningBolt : public WorldEntity
+{
+  public:
+    LightningBolt(const TiXmlElement* root = NULL);
+    virtual ~LightningBolt ();
+
+    virtual void activate();
+    virtual void deactivate();
+
+    virtual void tick(float time);
+    virtual void draw() const;
+
+  private:
+    float flashFrequency;                   //!< frequency to activate itself
+    float flashRisingTime;                  //!< time to rise
+    float flashConstTime;                   //!< time to be drawn
+    float flashFallTime;                    //!< time to fall
+
+    float time;                             //!< time
+
+    bool  bRender;
+    bool  bNewCoordinate;
+    Material*      material;
+    Vector         offset;
+    float width;
+    float height;
+
+    float seedX;
+    float seedZ;
+    float seedTime;
+
+    SoundSource    soundSource;
+    SoundBuffer*   thunderBuffer;
+};
+
+#endif /* _LIGHTNING_BOLT_H */
Index: trunk/src/world_entities/space_ships/helicopter.cc
===================================================================
--- trunk/src/world_entities/space_ships/helicopter.cc	(revision 7796)
+++ trunk/src/world_entities/space_ships/helicopter.cc	(revision 7810)
@@ -25,4 +25,6 @@
 
 #include "util/loading/factory.h"
+#include "util/loading/resource_manager.h"
+
 #include "key_mapper.h"
 #include "event_handler.h"
@@ -49,4 +51,7 @@
 {
   this->setPlayer(NULL);
+
+  if (this->chopperBuffer != NULL)
+    ResourceManager::getInstance()->unload(this->chopperBuffer);
 }
 
@@ -96,4 +101,10 @@
   this->getWeaponManager().changeWeaponConfig(1);
   dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false);
+
+  //load sound
+  if (this->chopperBuffer != NULL)
+    ResourceManager::getInstance()->unload(this->chopperBuffer);
+  this->chopperBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/chopper.wav", WAV);
+
 }
 
@@ -205,4 +216,7 @@
   State::getCameraNode()->setParentSoft(this->getWeaponManager().getFixedTarget());
   State::getCameraTargetNode()->setParentSoft(this->getWeaponManager().getFixedTarget());
+
+  this->soundSource.loop(this->chopperBuffer);
+  // PRINTF(0)( "Playing ChopperSound\n" );
 }
 
@@ -211,5 +225,5 @@
   dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false);
   this->detachCamera();
-
+  this->soundSource.stop();
 }
 
Index: trunk/src/world_entities/space_ships/helicopter.h
===================================================================
--- trunk/src/world_entities/space_ships/helicopter.h	(revision 7796)
+++ trunk/src/world_entities/space_ships/helicopter.h	(revision 7810)
@@ -10,4 +10,6 @@
 #include "playable.h"
 
+#include "sound_buffer.h"
+#include "sound_source.h"
 
 class Helicopter : public Playable
@@ -71,4 +73,7 @@
     float                 airViscosity;
 
+    OrxSound::SoundSource soundSource;
+    OrxSound::SoundBuffer*chopperBuffer;
+
 };
 
