Index: /branches/atmospheric_engine/src/defs/glincl.h
===================================================================
--- /branches/atmospheric_engine/src/defs/glincl.h	(revision 7758)
+++ /branches/atmospheric_engine/src/defs/glincl.h	(revision 7759)
@@ -17,9 +17,4 @@
 #include <OpenGL/gl.h>
 #include <OpenGL/glu.h>
-
-//#include <OpenGL/glx.h> // GLX
-//#include <OpenGL/glext.h> //OpenGL Extensions
-//#include <OpenGL/glxext.h> // GLX Extensions 
-
 #endif
 
Index: /branches/atmospheric_engine/src/lib/graphics/effects/volfog_effect.cc
===================================================================
--- /branches/atmospheric_engine/src/lib/graphics/effects/volfog_effect.cc	(revision 7758)
+++ /branches/atmospheric_engine/src/lib/graphics/effects/volfog_effect.cc	(revision 7759)
@@ -19,5 +19,28 @@
 
 #include "glincl.h"
-#include "shell_command.h"
+//#include "shell_command.h"
+
+#define GLX_GLXEXT_PROTOTYPES
+#include <GL/glx.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;
@@ -53,27 +76,45 @@
 {
 	PRINTF(0)("Initalize VolFogEffect\n");
+
+	// set fog mode
+	GLenum fogMode  = GL_EXP2;
+
+	// set fog density
+	float  fogDensity  = 0.03f;
+
+	// set fog near & far distance
+	float fogStart = 0.05f;
+	float fogEnd   = 100.0f;
+
+	// Set fog color
+	float fogColor[4] = {0.0, 1.0, 0.0, 1.0};
 	
+	glClearColor(fogColor[0],fogColor[1],fogColor[2],0.0f);
+	glShadeModel(GL_SMOOTH);
+	glEnable(GL_DEPTH_TEST);
+	glEnable(GL_CULL_FACE);
+	glCullFace(GL_BACK);
+
+	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");
-
-	// Set fog color
-	float fogColor[4] = {0.0, 1.0, 0.0, 1.0};
-
-	/* 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 The Fog based on vertice coordinates
-	// glHint(GL_FOG_HINT, GL_NICEST);				// Per-Pixel Fog Calculation
-
-	// glClearColor(0.0, 0.0, 0.0, 1.0);  //sets bg color?!
-
-	/* enable texturing & set texturing function */
-	// glEnable(GL_TEXTURE_2D);
-	// glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
 
 	if (glewGetExtension("GL_EXT_fog_coord"))
@@ -106,5 +147,4 @@
 void VolFogEffect::draw() const
 {
-	//glPushAttrib(GL_ENABLE_BIT);
 	
 	/* clear all pixels in colour buffer */
@@ -115,7 +155,4 @@
 	//glBlendFunc(GL_SRC_ALPHA, GL_DST_ALPHA);
 
-	//glLoadIdentity ();	// Reset The Modelview Matrix
-
-	// glBindTexture(GL_TEXTURE_2D, 0);
 	/* draw the panels */
 	glBegin(GL_QUADS); // Floor
@@ -164,5 +201,4 @@
 	glFlush();
 
-	// glPopAttrib();
 }
 
Index: /branches/atmospheric_engine/src/lib/graphics/effects/volfog_effect.h
===================================================================
--- /branches/atmospheric_engine/src/lib/graphics/effects/volfog_effect.h	(revision 7758)
+++ /branches/atmospheric_engine/src/lib/graphics/effects/volfog_effect.h	(revision 7759)
@@ -31,4 +31,3 @@
 };
 
-
 #endif  /* _VOLFOG_EFFECT */
