Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 15, 2006, 3:18:34 PM (18 years ago)
Author:
amaechler
Message:

atmospheric: fog - weird fade problems, not solved

File:
1 edited

Legend:

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

    r8457 r8471  
    7979    this->fogFadeInDuration = 0;
    8080    this->fogFadeOutDuration = 0;
    81     this->fogFadeInDensity = 0;
    82     this->fogFadeOutDensity = 0;
     81    this->fogFadeDensity = 0;
    8382    this->localTimer = 0;
    8483    this->fogActivate = false;
     
    9897    glFogfv(GL_FOG_COLOR, fogColor);
    9998    glHint(GL_FOG_HINT, GL_DONT_CARE);
     99    glFogf(GL_FOG_DENSITY, this->fogDensity);
    100100    glFogf(GL_FOG_START, this->fogStart);
    101101    glFogf(GL_FOG_END, this->fogEnd);
    102 
    103     if ( this->fogFadeInActivate )
    104         glFogf(GL_FOG_DENSITY, this->fogFadeInDensity);
    105     else if ( this->fogFadeOutActivate )
    106         glFogf(GL_FOG_DENSITY, this->fogFadeOutDensity);
    107     else
    108         glFogf(GL_FOG_DENSITY, this->fogDensity);
    109102
    110103    glEnable(GL_FOG);
     
    129122        return;
    130123
    131     // If Fog Fade In
    132     if ( this->fogFadeInActivate )
    133         glFogf(GL_FOG_DENSITY, this->fogFadeInDensity);
    134 
    135     // If Fog Fade Out
    136     if ( this->fogFadeOutActivate )
    137         glFogf(GL_FOG_DENSITY, this->fogFadeOutDensity);
     124    // If Fog Fade
     125    if ( this->fogFadeInActivate || this->fogFadeOutActivate )
     126        glFogf(GL_FOG_DENSITY, this->fogFadeDensity);
    138127
    139128}
     
    145134    if ( this->fogFadeInActivate ) {
    146135        this->localTimer += dt;
    147         this->fogFadeInDensity = ( this->localTimer / this->fogFadeInDuration ) * this->fogDensity;
     136        this->fogFadeDensity = ( this->localTimer / this->fogFadeInDuration ) * this->fogDensity;
    148137
    149138        if ( this->localTimer >= this->fogFadeOutDuration )
     
    153142    if ( this->fogFadeOutActivate ) {
    154143        this->localTimer += dt;
    155         this->fogFadeOutDensity = 1 - (( this->localTimer / this->fogFadeInDuration ) * this->fogDensity);
     144        this->fogFadeDensity = 1 - (( this->localTimer / this->fogFadeInDuration ) * this->fogDensity);
    156145
    157146        if ( this->localTimer >= this->fogFadeOutDuration )
Note: See TracChangeset for help on using the changeset viewer.