Changeset 8471 in orxonox.OLD for branches/atmospheric_engine/src/lib/graphics/effects/fog_effect.cc
- Timestamp:
- Jun 15, 2006, 3:18:34 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/atmospheric_engine/src/lib/graphics/effects/fog_effect.cc
r8457 r8471 79 79 this->fogFadeInDuration = 0; 80 80 this->fogFadeOutDuration = 0; 81 this->fogFadeInDensity = 0; 82 this->fogFadeOutDensity = 0; 81 this->fogFadeDensity = 0; 83 82 this->localTimer = 0; 84 83 this->fogActivate = false; … … 98 97 glFogfv(GL_FOG_COLOR, fogColor); 99 98 glHint(GL_FOG_HINT, GL_DONT_CARE); 99 glFogf(GL_FOG_DENSITY, this->fogDensity); 100 100 glFogf(GL_FOG_START, this->fogStart); 101 101 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 else108 glFogf(GL_FOG_DENSITY, this->fogDensity);109 102 110 103 glEnable(GL_FOG); … … 129 122 return; 130 123 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); 138 127 139 128 } … … 145 134 if ( this->fogFadeInActivate ) { 146 135 this->localTimer += dt; 147 this->fogFade InDensity = ( this->localTimer / this->fogFadeInDuration ) * this->fogDensity;136 this->fogFadeDensity = ( this->localTimer / this->fogFadeInDuration ) * this->fogDensity; 148 137 149 138 if ( this->localTimer >= this->fogFadeOutDuration ) … … 153 142 if ( this->fogFadeOutActivate ) { 154 143 this->localTimer += dt; 155 this->fogFade OutDensity = 1 - (( this->localTimer / this->fogFadeInDuration ) * this->fogDensity);144 this->fogFadeDensity = 1 - (( this->localTimer / this->fogFadeInDuration ) * this->fogDensity); 156 145 157 146 if ( this->localTimer >= this->fogFadeOutDuration )
Note: See TracChangeset
for help on using the changeset viewer.