Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8473 in orxonox.OLD for branches/water


Ignore:
Timestamp:
Jun 15, 2006, 3:59:09 PM (19 years ago)
Author:
stefalie
Message:

water: fog :-(

Location:
branches/water/src
Files:
3 edited

Legend:

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

    r8362 r8473  
    7171        this->localTimer = 0;
    7272
    73         this->fogMode = GL_EXP2;
     73        this->fogMode = GL_LINEAR;
    7474        this->fogDensity = 0.001;
    7575        this->fogStart = 0;
    76         this->fogEnd = 5000;
    77         this->colorVector = Vector(0.7, 0.7, 0.7);
     76        this->fogEnd = 1000;
     77        this->colorVector = Vector(0.0f, 0.0f, 0.7f);
    7878
    7979        return true;
  • branches/water/src/world_entities/environments/mapped_water.cc

    r8467 r8473  
    2020#include "state.h"
    2121
    22 //#include "fog_effect.h"
    23 
    2422
    2523CREATE_FACTORY(MappedWater, CL_MAPPED_WATER);
     
    3432    this->loadParams(root);
    3533
    36   PRINTF(0)("MaxTextureUnits: %i\n", Material::getMaxTextureUnits());
     34  //PRINTF(0)("MaxTextureUnits: %i\n", Material::getMaxTextureUnits());
    3735
    3836  // TODO rename texture to reflection texture
     
    134132
    135133  this->shader->deactivateShader();
     134 
     135 
     136  this->fog = new FogEffect();
     137  fog->setFogColor(0.1f, 0.2f, 0.4f);
     138  fog->setFogRange(0.0f, 500.0f);
     139  fog->setFogDensity(0.03f);
    136140}
    137141
     
    140144  delete shader;
    141145  delete cam_uni;
     146  delete fog;
    142147}
    143148
     
    158163  glTranslatef(this->waterPos.x,this->waterPos.y,this->waterPos.z);
    159164
    160   mat.unselect();
     165  /////????//mat.unselect();
    161166  mat.select();
    162167
     
    215220  mat.unselect();
    216221
    217   if(this->waterPos.y)
     222  if(pos.y < this->waterPos.y)
    218223  {
    219224    // draw some fog
    220     //FogEffect::activate();
     225    this->fog->activate();
     226  }
     227  else
     228  {
     229    this->fog->deactivate();
    221230  }
    222231
     
    230239  this->move2 = this->move * this->kNormalMapScale;
    231240  this->refrUV = this->g_WaterUV;
    232   this->normalUV = this->g_WaterUV * this->kNormalMapScale;
     241  this->normalUV = this->g_WaterUV * this->kNormalMapScale; 
    233242}
    234243
  • branches/water/src/world_entities/environments/mapped_water.h

    r8467 r8473  
    77#define _MAPPED_WATER_H
    88
    9 /* INCLUDES */
    109#include "world_entity.h"
    1110#include "material.h"
    1211#include "shader.h"
     12#include "effects/fog_effect.h"
     13
    1314
    1415class MappedWater : public WorldEntity
     
    5152    Shader::Uniform*    cam_uni;                    //!< uniform that is used for the camera position
    5253
     54    FogEffect*          fog;
     55
    5356};
    5457
Note: See TracChangeset for help on using the changeset viewer.