Changeset 8247 in orxonox.OLD for branches/atmospheric_engine/src/lib/graphics/effects
- Timestamp:
- Jun 8, 2006, 2:55:02 PM (19 years ago)
- Location:
- branches/atmospheric_engine/src/lib/graphics/effects
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/atmospheric_engine/src/lib/graphics/effects/cloud_effect.cc
r8242 r8247 155 155 156 156 // glClearColor(0.0f, 0.0f, 0.0f, 0.0f); 157 glShadeModel(GL_SMOOTH);158 glEnable(GL_DEPTH_TEST);159 glEnable(GL_CULL_FACE);160 glCullFace(GL_BACK);161 glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);162 163 glLineWidth(3.0f);157 // glShadeModel(GL_SMOOTH); 158 // glEnable(GL_DEPTH_TEST); 159 // glEnable(GL_CULL_FACE); 160 // glCullFace(GL_BACK); 161 // glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); 162 163 // glLineWidth(3.0f); 164 164 165 165 static float time = 0.0f; -
branches/atmospheric_engine/src/lib/graphics/effects/fog_effect.cc
r8023 r8247 38 38 this->loadParams(root); 39 39 40 if( this->fogActivate)41 40 if (this->fogActivate) 41 this->activate(); 42 42 } 43 43 … … 57 57 LoadParam(root, "range", this, FogEffect, setFogRange); 58 58 LoadParam(root, "color", this, FogEffect, setFogColor); 59 LoadParam(root, "option", this, FogEffect, setFogOption); 59 60 LOAD_PARAM_START_CYCLE(root, element); 61 { 62 LoadParam_CYCLE(element, "option", this, FogEffect, setFogOption); 63 } 64 LOAD_PARAM_END_CYCLE(element); 60 65 } 61 66 … … 63 68 { 64 69 //default values 65 70 this->fogActivate = false; 66 71 this->fogMode = GL_EXP2; 67 72 this->fogDensity = 0.001; 68 73 this->fogStart = 0; 69 74 this->fogEnd = 5000; 70 75 this->colorVector = Vector(0.7, 0.7, 0.7); 71 76 } 72 73 77 74 78 … … 76 80 { 77 81 PRINTF(0)( "Enabling FogEffect, mode: %i, density: %f, start: %f, end: %f, color %f, %f, %f\n", this->fogMode, this->fogDensity, this->fogStart, this->fogEnd, this->colorVector.x, this->colorVector.y, this->colorVector.z); 82 83 this->fogActivate = true; 78 84 79 85 glEnable(GL_FOG); … … 95 101 { 96 102 PRINTF(0)("Deactivating FogEffect\n"); 103 104 this->fogActivate = false; 105 97 106 glDisable(GL_FOG); 98 107 } -
branches/atmospheric_engine/src/lib/graphics/effects/fog_effect.h
r8023 r8247 22 22 virtual bool activate(); 23 23 virtual bool deactivate(); 24 25 26 24 25 void activateFog() { this->activate(); } 26 void deactivateFog() { this->deactivate(); } 27 27 28 28 inline void setFogMode(const std::string& mode) { this->fogMode = this->stringToFogMode(mode); } … … 30 30 inline void setFogRange(float start, float end) { this->fogStart = start; this->fogEnd = end; } 31 31 inline void setFogColor(float r, float g, float b) { this->colorVector = Vector(r, g, b); } 32 32 inline void setFogOption(const std::string& option) { if (option == "activate") this->fogActivate = true; } 33 33 34 34 private: 35 35 GLint stringToFogMode(const std::string& mode); 36 36 37 private:38 GLint fogMode; 39 GL float fogDensity;40 GLfloat fogStart;41 GLfloat fogEnd;42 Vector colorVector;43 bool fogActivate;37 bool fogActivate; 38 39 GLint fogMode; 40 GLfloat fogDensity; 41 GLfloat fogStart; 42 GLfloat fogEnd; 43 Vector colorVector; 44 44 }; 45 45 -
branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.cc
r8242 r8247 116 116 117 117 lightMan = LightManager::getInstance(); 118 this->rainAmbient = lightMan->getAmbientColor(); 118 119 } 119 120 … … 163 164 this->rainActivate = false; 164 165 this->emitter->setSystem(NULL); 166 167 // Stop Sound 165 168 this->soundSource.stop(); 166 169 167 lightMan->setAmbientColor(1,1,1); 170 // Restore Light Ambient 171 lightMan->setAmbientColor(this->rainAmbient, this->rainAmbient, this->rainAmbient); 168 172 } 169 173 … … 182 186 float progress = this->localTimer / this->rainStartDuration; 183 187 184 // PRINTF(0)("Progress %f: \n", progress); 188 // Dim Light 189 lightMan->setAmbientColor(1.1 - progress, 1.1 - progress, 1.1 - progress); 185 190 186 191 // use alpha in color to fade in -
branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.h
r8180 r8247 78 78 float soundRainVolume; 79 79 80 LightManager* lightMan; 80 LightManager* lightMan; 81 GLfloat rainAmbient; 82 81 83 }; 82 84
Note: See TracChangeset
for help on using the changeset viewer.