Index: /branches/atmospheric_engine/src/lib/graphics/effects/volfog_effect.cc
===================================================================
--- /branches/atmospheric_engine/src/lib/graphics/effects/volfog_effect.cc	(revision 7556)
+++ /branches/atmospheric_engine/src/lib/graphics/effects/volfog_effect.cc	(revision 7557)
@@ -33,18 +33,8 @@
     this->loadParams(root);
 
+  // Initialize Effect
   this->init();
 
-  //if (! this->init())                        // Check And Enable Fog Extension If Available
-    //return false;                         // Return False If Extension Not Supported
-
-  // Set Up Fog 
-  //glEnable(GL_FOG);                         // Enable Fog
-  //glFogi(GL_FOG_MODE, GL_LINEAR);                   // Fog Fade Is Linear
-  //glFogfv(GL_FOG_COLOR, fogColor);                  // Set The Fog Color
-  //glFogf(GL_FOG_START,  1.0f);                    // Set The Fog Start
-  //glFogf(GL_FOG_END,    0.0f);                    // Set The Fog End
-  //glHint(GL_FOG_HINT, GL_NICEST);                   // Per-Pixel Fog Calculation
-  //glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT);    // Set Fog Based On Vertice Coordinates
-
+  // Activate Effect
   this->activate();
 }
@@ -65,13 +55,23 @@
   PRINTF(0)("Initalize VolFogEffect\n");
 
-  fogColor[0] = 0.6f;
-  fogColor[1] = 0.3f;
-  fogColor[2] = 0.0f;
-  fogColor[3] = 1.0f;
+  // Set fog color
+  float fogColor[4] = {0.4, 0.4, 0.4, 1.0};
 
-  //glDepthFunc (GL_LEQUAL);                            // The Type Of Depth Testing
-  //glEnable (GL_DEPTH_TEST);                           // Enable Depth Testing
-  //glShadeModel (GL_SMOOTH);                           // Select Smooth Shading
-  //glHint (GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Set Perspective Calculations To Most AccurateAbility
+  // glClearColor(0.0, 0.0, 0.0, 1.0);  //sets bg color?!
+
+  /* set up fog params */	
+  glEnable(GL_FOG);						// Enable Fog
+  glFogi(GL_FOG_MODE, GL_LINEAR);				// Fog Fade Is Linear
+  glFogfv(GL_FOG_COLOR, fogColor);				// Set The Fog Color
+  glFogf(GL_FOG_START, 0.0f);					// Set The Fog Start
+  glFogf(GL_FOG_END, 1.0f);					// Set The Fog End
+  glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT);	// Set Perspective Calculations To Most Accurate
+  // glHint(GL_FOG_HINT, GL_NICEST);				// Per-Pixel Fog Calculation
+
+  /* enable texturing & set texturing function */
+  glEnable(GL_TEXTURE_2D);
+  glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
+
+  // *********************************************
 
   char extensions[ 16384 ];
@@ -92,5 +92,5 @@
 
   PRINTF(0)( "%s\n", (char *)glGetString( GL_EXTENSIONS ) );
-  PRINTF(0)( "%s not found, dammit.\n", Extension_Name );
+  PRINTF(0)( "%s not found.\n", Extension_Name );
   return false;
 }
@@ -113,83 +113,62 @@
 void VolFogEffect::draw() const
 {
-    glPushAttrib(GL_ENABLE_BIT);
+	//glPushAttrib(GL_ENABLE_BIT);
+	
+	/* clear all pixels in colour buffer */
+	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 
-glClearDepth (1.0f); 
-  glDepthFunc (GL_LEQUAL);                            // The Type Of Depth Testing
-  glEnable (GL_DEPTH_TEST);                           // Enable Depth Testing
-  glShadeModel (GL_SMOOTH);                           // Select Smooth Shading
-  glHint (GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Set Perspective Calculations To Most AccurateAbili
+	//glLoadIdentity ();	// Reset The Modelview Matrix
 
 
-  // Set Up Fog 
-  glEnable(GL_FOG);                         // Enable Fog
-  glFogi(GL_FOG_MODE, GL_LINEAR);                   // Fog Fade Is Linear
-  glFogfv(GL_FOG_COLOR, fogColor);                  // Set The Fog Color
-  glFogf(GL_FOG_START,  1.0f);                    // Set The Fog Start
-  glFogf(GL_FOG_END,    0.0f);                    // Set The Fog End
-  glHint(GL_FOG_HINT, GL_NICEST);                   // Per-Pixel Fog Calculation
-  glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT);    // Set Fog Based On Vertice Coordinates
+	// glBindTexture(GL_TEXTURE_2D, 0);
+	/* draw the panels */
+	glBegin(GL_QUADS); // Floor
+		glFogCoordfEXT(0.0f);	glVertex3f(0.0f,0.0f,0.0f);
+		glFogCoordfEXT(0.0f);	glVertex3f(100.0f,0.0f,0.0f);
+		glFogCoordfEXT(0.0f);	glVertex3f(100.0f,0.0f, 100.0f);
+		glFogCoordfEXT(0.0f);	glVertex3f(0.0f,0.0f, 100.0f);
+	glEnd();
 
+	glBegin(GL_QUADS); // Roof
+		glFogCoordfEXT(5.0f);glVertex3f(0.0f, 100.0f,0.0f);
+		glFogCoordfEXT(5.0f);glVertex3f( 100.0f, 100.0f,0.0f);
+		glFogCoordfEXT(5.0f);glVertex3f( 100.0f, 100.0f, 100.0f);
+		glFogCoordfEXT(5.0f);glVertex3f(0.0f, 100.0f, 100.0f);
+	glEnd();
 
+	glBegin(GL_QUADS); // Back Wall
+	 	glFogCoordfEXT(0.0f);	glVertex3f(0.0f,0.0f,0.0f);
+		glFogCoordfEXT(0.0f);	glVertex3f( 100.0f,0.0f,0.0f);
+		glFogCoordfEXT(5.0f);glVertex3f( 100.0f, 100.0f,0.0f);
+		glFogCoordfEXT(5.0f);glVertex3f(0.0f, 100.0f,0.0f);
+	glEnd();
 
-  //glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);        // Clear Screen And Depth Buffer
-  //glLoadIdentity ();                          // Reset The Modelview Matrix
+	glBegin(GL_QUADS); // Front Wall
+	 	glFogCoordfEXT(0.0f);		glVertex3f(0.0f,0.0f,100.0f);
+		glFogCoordfEXT(0.0f);	glVertex3f( 100.0f,0.0f,100.0f);
+		glFogCoordfEXT(5.0f);glVertex3f( 100.0f, 100.0f,100.0f);
+		glFogCoordfEXT(5.0f);glVertex3f(0.0f, 100.0f,100.0f);
+	glEnd();
 
-  //glTranslatef(camx, 0.0f, camz);             // Move To Our Camera Z/X Position
+	glBegin(GL_QUADS); // Right Wall
+		glFogCoordfEXT(0.0f);	glVertex3f( 100.0f,0.0f, 100.0f);
+		glFogCoordfEXT(5.0f);glVertex3f( 100.0f, 100.0f, 100.0f);
+		glFogCoordfEXT(5.0f);glVertex3f( 100.0f, 100.0f,0.0f);
+		glFogCoordfEXT(0.0f);	glVertex3f( 100.0f,0.0f,0.0f);
+	glEnd();
 
-  // glFogCoordEXT is very similar to glVertex3f. If you understand
-  // the way vertexs are applied in OpenGL, you will not have any dificulty
-  // understanding glFogCoordEXT.
+	glBegin(GL_QUADS); // Left Wall
+	 	glFogCoordfEXT(0.0f);	glVertex3f(0.0f,0.0f, 100.0f);
+		glFogCoordfEXT(5.0f);	glVertex3f(0.0f, 100.0f, 100.0f);
+		glFogCoordfEXT(5.0f);	glVertex3f(0.0f, 100.0f,0.0f);
+		glFogCoordfEXT(0.0f);	glVertex3f(0.0f,0.0f,0.0f);
+	glEnd();
+	
+	/* process all buffered OpenGL commands */
+	glFlush();
 
-  // In this tutorial we are applyng the fog in a corridor, so the fog
-  // goes from the less density (the minor z) to a bigger density (the biggest z).
-  // If you check the fog_start and fog_eng, it's 0 and 1.
+	// glPopAttrib();
+}
 
-  // So, we will pass to the function glFogCoordEXT, the fog value corresponding
-  // with the glVertex3f value.If we are drawing a quad from z minus to z major, 
-  // we do exactly the same with glFogCoord.
-
-  // For example, in the first quad, is vertex coordinates in the Z field are all 
-  // -15.0f. So we want the fog to completely fill this quad, so we assign 0 to all
-  // the glFogCoordExt.
-  
-  glBegin(GL_QUADS);                          // Back Wall
-    glFogCoordfEXT( 0.0f); glVertex3f(-2.5f,-2.5f,-15.0f);
-    glFogCoordfEXT( 0.0f); glVertex3f( 2.5f,-2.5f,-15.0f);
-    glFogCoordfEXT( 0.0f); glVertex3f( 2.5f, 2.5f,-15.0f);
-    glFogCoordfEXT( 0.0f); glVertex3f(-2.5f, 2.5f,-15.0f);
-  glEnd();
-
-  glBegin(GL_QUADS);                          // Floor
-    glFogCoordfEXT( 0.0f); glVertex3f(-2.5f,-2.5f,-15.0f);
-    glFogCoordfEXT( 0.0f); glVertex3f( 2.5f,-2.5f,-15.0f);
-    glFogCoordfEXT( 1.0f); glVertex3f( 2.5f,-2.5f, 15.0f);
-    glFogCoordfEXT( 1.0f); glVertex3f(-2.5f,-2.5f, 15.0f);
-  glEnd();
-
-  glBegin(GL_QUADS);                          // Roof
-    glFogCoordfEXT( 0.0f); glVertex3f(-2.5f, 2.5f,-15.0f);
-    glFogCoordfEXT( 0.0f); glVertex3f( 2.5f, 2.5f,-15.0f);
-    glFogCoordfEXT( 1.0f); glVertex3f( 2.5f, 2.5f, 15.0f);
-    glFogCoordfEXT( 1.0f); glVertex3f(-2.5f, 2.5f, 15.0f);
-  glEnd();
-
-  glBegin(GL_QUADS);                          // Right Wall
-    glFogCoordfEXT( 1.0f); glVertex3f( 2.5f,-2.5f, 15.0f);
-    glFogCoordfEXT( 1.0f); glVertex3f( 2.5f, 2.5f, 15.0f);
-    glFogCoordfEXT( 0.0f); glVertex3f( 2.5f, 2.5f,-15.0f);
-    glFogCoordfEXT( 0.0f); glVertex3f( 2.5f,-2.5f,-15.0f);
-  glEnd();
-
-  glBegin(GL_QUADS);                          // Left Wall
-    glFogCoordfEXT( 1.0f); glVertex3f(-2.5f,-2.5f, 15.0f);
-    glFogCoordfEXT( 1.0f); glVertex3f(-2.5f, 2.5f, 15.0f);
-    glFogCoordfEXT( 0.0f); glVertex3f(-2.5f, 2.5f,-15.0f);
-    glFogCoordfEXT( 0.0f); glVertex3f(-2.5f,-2.5f,-15.0f);
-  glEnd();
- 
-  //glFlush ();                             // Flush The GL Rendering Pipeline
-  glPopAttrib();
-}
 
 
Index: /branches/atmospheric_engine/src/lib/graphics/effects/volfog_effect.h
===================================================================
--- /branches/atmospheric_engine/src/lib/graphics/effects/volfog_effect.h	(revision 7556)
+++ /branches/atmospheric_engine/src/lib/graphics/effects/volfog_effect.h	(revision 7557)
@@ -31,5 +31,4 @@
 
   private:
-
     GLfloat fogColor[4];
 
