Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 18, 2006, 3:28:50 PM (18 years ago)
Author:
amaechler
Message:

branches/atmosphere_engine: fog weirdness…

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/atmospheric_engine/src/lib/graphics/effects/fog_effect.cc

    r7683 r7689  
    3333{
    3434        this->setClassID(CL_FOG_EFFECT, "FogEffect");
    35        
    36         this->fogMode = GL_LINEAR;
    37         this->fogDensity = 0.1f;
    38         this->fogStart = 0.0f;
    39         this->fogEnd = 5000.0f;
    40   this->colorVector = Vector(0.7, 0.7, 0.7);
     35
     36        this->init();
    4137
    4238        if (root != NULL)
     
    4541        this->activate();
    4642}
    47 
    4843
    4944
     
    6156        LoadParam(root, "fog-density", this, FogEffect, setFogDensity);
    6257        LoadParam(root, "fog-color", this, FogEffect, setFogColor);
    63 
    64 
    6558}
    6659
    6760bool FogEffect::init()
    68 {}
     61{
     62        //default values
     63        this->fogMode = GL_LINEAR;
     64        this->fogDensity = 0.1;
     65        this->fogStart = 0;
     66        this->fogEnd = 5000;
     67  this->colorVector = Vector(0.7, 0.7, 0.7);
     68}
    6969
    7070
     
    7676        glEnable(GL_FOG);
    7777        {
    78                 //GLfloat fogColor[4] = {0.7, 0.6, 0.6, 1.0};
    7978                GLfloat fogColor[4] = { colorVector.x, colorVector.y, colorVector.z, 1.0};
    8079
     
    8584                glFogf(GL_FOG_START, this->fogStart);
    8685                glFogf(GL_FOG_END, this->fogEnd);
    87 
    88                 //glFogi(GL_FOG_COORDINATE_SOURCE, GL_FOG_COORDINATE);
    8986        }
    9087        glClearColor(0.5, 0.5, 0.5, 1.0);
     
    9794        glDisable(GL_FOG);
    9895}
    99 
    10096
    10197
Note: See TracChangeset for help on using the changeset viewer.