première version de brouillard.
This commit is contained in:
parent
c6ffb83438
commit
d3f85ce2fb
12
view.cpp
12
view.cpp
|
@ -4,6 +4,12 @@ View::View(Chose* _root)
|
||||||
: root(_root),
|
: root(_root),
|
||||||
camera(Camera(Vertex(9600,10000,15300),0,179,1000,0.6f)),
|
camera(Camera(Vertex(9600,10000,15300),0,179,1000,0.6f)),
|
||||||
lod(camera.cameraCenter, _root) {
|
lod(camera.cameraCenter, _root) {
|
||||||
|
|
||||||
|
fogColor[0] = 0.5;
|
||||||
|
fogColor[1] = 0.5;
|
||||||
|
fogColor[2] = 0.5;
|
||||||
|
fogColor[3] = 1.0;
|
||||||
|
density = 0.000015;
|
||||||
initWindow();
|
initWindow();
|
||||||
mainLoop();
|
mainLoop();
|
||||||
}
|
}
|
||||||
|
@ -40,6 +46,12 @@ void View::initWindow() {
|
||||||
|
|
||||||
glEnable(GL_LIGHTING); // Active l'éclairage
|
glEnable(GL_LIGHTING); // Active l'éclairage
|
||||||
glEnable(GL_LIGHT0); // Active la lumière 0;
|
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() {
|
void View::setLight() {
|
||||||
|
|
3
view.hh
3
view.hh
|
@ -41,7 +41,8 @@ public :
|
||||||
static const int backFrustum = 100000; // 1km
|
static const int backFrustum = 100000; // 1km
|
||||||
private:
|
private:
|
||||||
Lod lod;
|
Lod lod;
|
||||||
|
GLfloat fogColor[4];
|
||||||
|
GLfloat density;
|
||||||
static const int windowWidth = 1024;
|
static const int windowWidth = 1024;
|
||||||
static const int windowHeight = 768;
|
static const int windowHeight = 768;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user