Changeset 7759 in orxonox.OLD for branches/atmospheric_engine
- Timestamp:
- May 22, 2006, 11:23:00 AM (19 years ago)
- Location:
- branches/atmospheric_engine/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/atmospheric_engine/src/defs/glincl.h
r7577 r7759 17 17 #include <OpenGL/gl.h> 18 18 #include <OpenGL/glu.h> 19 20 //#include <OpenGL/glx.h> // GLX21 //#include <OpenGL/glext.h> //OpenGL Extensions22 //#include <OpenGL/glxext.h> // GLX Extensions23 24 19 #endif 25 20 -
branches/atmospheric_engine/src/lib/graphics/effects/volfog_effect.cc
r7652 r7759 19 19 20 20 #include "glincl.h" 21 #include "shell_command.h" 21 //#include "shell_command.h" 22 23 #define GLX_GLXEXT_PROTOTYPES 24 #include <GL/glx.h> 25 26 //#include <GL/glext.h> //OpenGL Extensions 27 //#include <GL/glxext.h> // GLX Extensions 28 29 #ifndef GL_EXT_fog_coord 30 #define GL_EXT_fog_coord 1 31 32 typedef void (APIENTRY * PFNGLFOGCOORDFEXTPROC) (GLfloat coord); 33 typedef void (APIENTRY * PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); 34 typedef void (APIENTRY * PFNGLFOGCOORDDEXTPROC) (GLdouble coord); 35 typedef void (APIENTRY * PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); 36 typedef void (APIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); 37 #endif 38 39 PFNGLFOGCOORDFEXTPROC glFogCoordfEXT = 0; 40 PFNGLFOGCOORDFVEXTPROC glFogCoordfvEXT = 0; 41 PFNGLFOGCOORDDEXTPROC glFogCoorddEXT = 0; 42 PFNGLFOGCOORDDVEXTPROC glFogCoorddvEXT = 0; 43 PFNGLFOGCOORDPOINTEREXTPROC glFogCoordPointerEXT = 0; 44 22 45 23 46 using namespace std; … … 53 76 { 54 77 PRINTF(0)("Initalize VolFogEffect\n"); 78 79 // set fog mode 80 GLenum fogMode = GL_EXP2; 81 82 // set fog density 83 float fogDensity = 0.03f; 84 85 // set fog near & far distance 86 float fogStart = 0.05f; 87 float fogEnd = 100.0f; 88 89 // Set fog color 90 float fogColor[4] = {0.0, 1.0, 0.0, 1.0}; 55 91 92 glClearColor(fogColor[0],fogColor[1],fogColor[2],0.0f); 93 glShadeModel(GL_SMOOTH); 94 glEnable(GL_DEPTH_TEST); 95 glEnable(GL_CULL_FACE); 96 glCullFace(GL_BACK); 97 98 glFogCoordfEXT = (PFNGLFOGCOORDFEXTPROC)glXGetProcAddressARB((const GLubyte*)"glFogCoordfEXT"); 99 glFogCoordfvEXT = (PFNGLFOGCOORDFVEXTPROC)glXGetProcAddressARB((const GLubyte*)"glFogCoordfvEXT"); 100 glFogCoorddEXT = (PFNGLFOGCOORDDEXTPROC)glXGetProcAddressARB((const GLubyte*)"glFogCoorddEXT"); 101 glFogCoorddvEXT = (PFNGLFOGCOORDDVEXTPROC)glXGetProcAddressARB((const GLubyte*)"glFogCoorddvEXT"); 102 glFogCoordPointerEXT = (PFNGLFOGCOORDPOINTEREXTPROC)glXGetProcAddressARB((const GLubyte*)"glFogCoordPointerEXT"); 103 104 // set the fog attributes 105 glFogf (GL_FOG_START, fogStart); 106 glFogf (GL_FOG_END, fogEnd); 107 glFogfv(GL_FOG_COLOR, fogColor); 108 glFogi (GL_FOG_MODE, fogMode); 109 glFogf (GL_FOG_DENSITY,fogDensity); 110 glFogi (GL_FOG_COORDINATE_SOURCE_EXT,GL_FOG_COORDINATE_EXT); 111 112 // enable the fog 113 glEnable(GL_FOG); 114 56 115 if (glewInit() == GLEW_OK) 57 116 PRINTF(0)("glewInit OK\n"); 58 117 else 59 118 PRINTF(0)("glewInit failed\n"); 60 61 // Set fog color62 float fogColor[4] = {0.0, 1.0, 0.0, 1.0};63 64 /* set up fog params */65 glEnable(GL_FOG); // Enable Fog66 glFogi(GL_FOG_MODE, GL_LINEAR); // Fog Fade Is Linear67 glFogfv(GL_FOG_COLOR, fogColor); // Set The Fog Color68 glFogf(GL_FOG_START, 0.0f); // Set The Fog Start69 glFogf(GL_FOG_END, 1.0f); // Set The Fog End70 glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT); // Set The Fog based on vertice coordinates71 // glHint(GL_FOG_HINT, GL_NICEST); // Per-Pixel Fog Calculation72 73 // glClearColor(0.0, 0.0, 0.0, 1.0); //sets bg color?!74 75 /* enable texturing & set texturing function */76 // glEnable(GL_TEXTURE_2D);77 // glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);78 119 79 120 if (glewGetExtension("GL_EXT_fog_coord")) … … 106 147 void VolFogEffect::draw() const 107 148 { 108 //glPushAttrib(GL_ENABLE_BIT);109 149 110 150 /* clear all pixels in colour buffer */ … … 115 155 //glBlendFunc(GL_SRC_ALPHA, GL_DST_ALPHA); 116 156 117 //glLoadIdentity (); // Reset The Modelview Matrix118 119 // glBindTexture(GL_TEXTURE_2D, 0);120 157 /* draw the panels */ 121 158 glBegin(GL_QUADS); // Floor … … 164 201 glFlush(); 165 202 166 // glPopAttrib();167 203 } 168 204 -
branches/atmospheric_engine/src/lib/graphics/effects/volfog_effect.h
r7652 r7759 31 31 }; 32 32 33 34 33 #endif /* _VOLFOG_EFFECT */
Note: See TracChangeset
for help on using the changeset viewer.