Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

water: fog :-(

Location:
branches/water/src/world_entities/environments
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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.