Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8471 in orxonox.OLD for branches/atmospheric_engine/src


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

atmospheric: fog - weird fade problems, not solved

Location:
branches/atmospheric_engine/src/lib/graphics/effects
Files:
3 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 )
  • branches/atmospheric_engine/src/lib/graphics/effects/fog_effect.h

    r8457 r8471  
    6464    GLint stringToFogMode(const std::string& mode);
    6565
    66     bool        fogActivate;
     66    bool          fogActivate;
    6767
    68     bool        fogFadeInActivate;
    69     bool        fogFadeOutActivate;
     68    bool          fogFadeInActivate;
     69    bool          fogFadeOutActivate;
    7070
    7171    GLfloat       fogFadeInDuration;
    7272    GLfloat       fogFadeOutDuration;
    7373
    74     float       localTimer;
     74    float         localTimer;
    7575
    76     GLint       fogMode;
     76    GLint         fogMode;
    7777    GLfloat       fogDensity;
    78     GLfloat       fogFadeInDensity;
    79     GLfloat       fogFadeOutDensity;
     78    GLfloat       fogFadeDensity;
    8079
    8180    GLfloat       fogStart;
  • branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.cc

    r8457 r8471  
    6767    }
    6868
    69     if(rainActivate)
     69    if(rainActivate) {
    7070        this->activate();
     71        RainEffect::rainParticles->precache((int)this->rainLife);
     72    }
    7173}
    7274
     
    153155    this->emitter->setSpread(this->rainWindForce / 50, 0.2);
    154156
    155     RainEffect::rainParticles->precache((int)this->rainLife);
    156 
    157157    this->soundSource.loop(this->rainBuffer, this->soundRainVolume);
    158158    if (this->rainWindForce != 0)
Note: See TracChangeset for help on using the changeset viewer.