première version de brouillard.

This commit is contained in:
Yoann 2012-01-13 18:03:47 +01:00
parent c6ffb83438
commit d3f85ce2fb
2 changed files with 14 additions and 1 deletions

View File

@ -4,6 +4,12 @@ View::View(Chose* _root)
: root(_root),
camera(Camera(Vertex(9600,10000,15300),0,179,1000,0.6f)),
lod(camera.cameraCenter, _root) {
fogColor[0] = 0.5;
fogColor[1] = 0.5;
fogColor[2] = 0.5;
fogColor[3] = 1.0;
density = 0.000015;
initWindow();
mainLoop();
}
@ -40,6 +46,12 @@ void View::initWindow() {
glEnable(GL_LIGHTING); // Active l'éclairage
glEnable(GL_LIGHT0); // Active la lumière 0;
glEnable (GL_FOG);
glFogi (GL_FOG_MODE, GL_EXP2);
glFogfv (GL_FOG_COLOR, fogColor);
glFogf (GL_FOG_DENSITY, density);
glHint (GL_FOG_HINT, GL_NICEST);
}
void View::setLight() {

View File

@ -41,7 +41,8 @@ public :
static const int backFrustum = 100000; // 1km
private:
Lod lod;
GLfloat fogColor[4];
GLfloat density;
static const int windowWidth = 1024;
static const int windowHeight = 768;