Changeset 8316 in orxonox.OLD for trunk/src/lib/graphics/effects
- Timestamp:
- Jun 11, 2006, 1:57:27 PM (19 years ago)
- Location:
- trunk/src/lib/graphics/effects
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/effects/fog_effect.cc
r8255 r8316 72 72 this->fogFadeDuration = 0; 73 73 this->localTimer = 0; 74 74 75 75 this->fogMode = GL_EXP2; 76 76 this->fogDensity = 0.001; … … 79 79 this->colorVector = Vector(0.7, 0.7, 0.7); 80 80 81 return true; 81 82 } 82 83 … … 87 88 88 89 this->fogActivate = true; 89 90 90 91 GLfloat fogColor[4] = { colorVector.x, colorVector.y, colorVector.z, 1.0}; 91 92 glFogi(GL_FOG_MODE, this->fogMode); … … 95 96 glFogf(GL_FOG_START, this->fogStart); 96 97 glFogf(GL_FOG_END, this->fogEnd); 97 98 98 99 glEnable(GL_FOG); 99 100 // glClearColor(0.5, 0.5, 0.5, 1.0); 101 return true; 100 102 } 101 103 … … 106 108 107 109 this->fogActivate = false; 108 110 109 111 glDisable(GL_FOG); 112 113 return true; 110 114 } 111 115 … … 122 126 if (!this->fogActivate) 123 127 return; 124 128 125 129 126 130 if (this->fogFadeDuration != 0 && this->localTimer < this->fogFadeDuration) { -
trunk/src/lib/graphics/effects/graphics_effect.cc
r7193 r8316 61 61 */ 62 62 bool GraphicsEffect::init() 63 {} 63 { 64 return true; 65 } 64 66 65 67 -
trunk/src/lib/graphics/effects/lense_flare.cc
r7844 r8316 104 104 */ 105 105 bool LenseFlare::init() 106 {} 106 { 107 return true; 108 } 107 109 108 110 … … 113 115 { 114 116 this->bActivated = true; 117 118 return true; 115 119 } 116 120 … … 122 126 { 123 127 this->bActivated = false; 128 129 return true; 124 130 } 125 131 … … 130 136 */ 131 137 GLint LenseFlare::stringToFogMode(const std::string& mode) 132 {} 138 { 139 PRINTF(1)("NOT IMPLEMENTED"); 140 return 0; 141 } 133 142 134 143 -
trunk/src/lib/graphics/effects/lightening_effect.cc
r8255 r8316 36 36 { 37 37 this->setClassID(CL_LIGHTENING_EFFECT, "LighteningEffect"); 38 38 39 39 this->init(); 40 40 … … 54 54 { 55 55 WeatherEffect::loadParams(root); 56 56 57 57 LoadParam(root, "coord", this, LighteningEffect, coord); 58 58 LoadParam(root, "option", this, LighteningEffect, setLighteningOption); … … 68 68 { 69 69 lighteningActivate = false; 70 70 71 71 this->time = 0.0; 72 72 this->flashFrequency = 1.4f; … … 117 117 ResourceManager::getInstance()->unload(this->thunderBuffer); 118 118 this->thunderBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/thunder.wav", WAV);*/ 119 120 return true; 119 121 } 120 122 … … 149 151 this->time = 0; 150 152 lighteningActivate = true; 153 154 return true; 151 155 } 152 156 … … 160 164 this->billboard[3]->setVisibiliy(false); 161 165 lighteningActivate = false; 166 167 168 return true; 162 169 } 163 170 … … 166 173 if(!lighteningActivate) 167 174 return; 168 175 169 176 this->time += dt; 170 177 … … 175 182 else 176 183 this->flashLight->setDiffuseColor(100,100,100); 177 184 178 185 //PRINTF(0)("100*time: %f %i\n", 100*time, (int)(100*time)); 179 186 }*/ 180 187 181 188 if( this->time > this->flashFrequency) 182 189 { 183 190 this->billboard[0]->setVisibiliy(true); 184 191 this->time = 0.0f; 185 192 186 193 this->flashLight = new Light(); 187 194 this->flashLight->setAbsCoor(this->billboard[0]->getAbsCoor().x, this->billboard[0]->getAbsCoor().y, this->billboard[0]->getAbsCoor().z); 188 195 this->flashLight->setDiffuseColor(100,100,100); 189 196 190 197 //this->soundSource.play(this->thunderBuffer); 191 198 } … … 195 202 this->time = 0.0f; 196 203 this->bNewCoordinate = true; 197 204 198 205 if(flashLight != NULL) 199 206 { -
trunk/src/lib/graphics/effects/rain_effect.cc
r8255 r8316 117 117 lightMan = LightManager::getInstance(); 118 118 this->rainAmbient = lightMan->getAmbientColor(); 119 120 return true; 119 121 } 120 122 … … 150 152 151 153 this->emitter->setSpread(this->rainWindForce / 50, 0.2); 152 154 153 155 this->soundSource.loop(this->rainBuffer, this->soundRainVolume); 154 156 if (this->rainWindForce != 0) this->soundSource.loop(this->windBuffer, 0.1f * this->rainWindForce); 155 157 156 158 lightMan->setAmbientColor(.1,.1,.1); 159 160 return true; 157 161 } 158 162 … … 161 165 { 162 166 PRINTF(0)("Deactivating RainEffect\n"); 163 167 164 168 this->rainActivate = false; 165 169 this->emitter->setSystem(NULL); … … 170 174 // Restore Light Ambient 171 175 lightMan->setAmbientColor(this->rainAmbient, this->rainAmbient, this->rainAmbient); 176 177 return true; 172 178 } 173 179 … … 176 182 if (!this->rainActivate) 177 183 return; 178 184 179 185 if (this->rainMove) { 180 186 this->rainCoord = State::getCameraNode()->getAbsCoor(); … … 202 208 // this->soundSource.fadein(this->rainBuffer, 10); 203 209 } 204 210 205 211 } 206 212 -
trunk/src/lib/graphics/effects/snow_effect.cc
r8255 r8316 79 79 LoadParam(root, "size", this, SnowEffect, size); 80 80 LoadParam(root, "coord", this, SnowEffect, coord); 81 81 82 82 LOAD_PARAM_START_CYCLE(root, element); 83 83 { … … 111 111 this->snowCoord = Vector(100,450,400); 112 112 this->snowWindForce = 1; 113 114 return true; 113 115 } 114 116 … … 143 145 if (this->snowWindForce > 1) 144 146 this->soundSource.loop(this->windBuffer); 147 148 return true; 145 149 } 146 150 … … 156 160 ResourceManager::getInstance()->unload(this->windBuffer); 157 161 162 return true; 158 163 } 159 164 … … 171 176 /* 172 177 float distance = (State::getCameraNode()->getAbsCoor() - Vector(snowCoord.x, State::getCameraNode()->getAbsCoor().y, snowCoord.z)).len(); 173 178 174 179 if(activated) 175 180 { … … 182 187 else if(distance > 0.1*snowSize.x || distance > 0.1*snowSize.y) 183 188 this->alpha = 0.4; 184 189 185 190 SnowEffect::snowParticles->setColor(0,1, 1, 1, alpha); 186 191 SnowEffect::snowParticles->setColor(.5, .6, .6, .6, alpha/2); … … 197 202 else if( distance < 0.1*snowSize.x || distance < 0.1*snowSize.y ) 198 203 this->alpha = 0.5; 199 204 200 205 SnowEffect::snowParticles->setColor(0,1, 1, 1, alpha); 201 206 SnowEffect::snowParticles->setColor(.5, .6, .6, .6, alpha/2); -
trunk/src/lib/graphics/effects/volfog_effect.cc
r7810 r8316 29 29 30 30 //#include <GL/glext.h> //OpenGL Extensions 31 //#include <GL/glxext.h> // GLX Extensions 31 //#include <GL/glxext.h> // GLX Extensions 32 32 33 33 #ifndef GL_EXT_fog_coord … … 92 92 // Set fog color 93 93 float fogColor[4] = {0.6f,0.58f,0.79f,0.0f}; 94 94 95 95 96 96 glFogCoordfEXT = (PFNGLFOGCOORDFEXTPROC)glXGetProcAddressARB((const GLubyte*)"glFogCoordfEXT"); … … 132 132 { 133 133 PRINTF(0)("Activating VolFogEffect\n"); 134 135 return true; 134 136 } 135 137 … … 139 141 140 142 glDisable(GL_FOG); 143 144 return true; 141 145 } 142 146 … … 160 164 //glEnable(GL_BLEND); 161 165 //glBlendFunc(GL_SRC_ALPHA, GL_DST_ALPHA); 162 166 163 167 int i; 164 168 glLoadIdentity(); 165 169 166 170 167 171 glBegin( GL_LINES ); 168 172 glNormal3f(0,1,0); … … 210 214 * ticks the effect if there is any time dependancy 211 215 */ 212 void VolFogEffect::tick(float dt) 213 { 214 } 216 void VolFogEffect::tick(float dt) 217 { 218 } -
trunk/src/lib/graphics/effects/weather_effect.cc
r8255 r8316 56 56 */ 57 57 bool WeatherEffect::init() 58 {} 58 { 59 return true; 60 } 59 61 60 62
Note: See TracChangeset
for help on using the changeset viewer.