Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

mountain_lake: waterColor fading compiles, but doesnt work yet

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

Legend:

Unmodified
Added
Removed
  • branches/mountain_lake/src/world_entities/environments/mapped_water.cc

    r8918 r8919  
    106106  this->bFadeReflStrength = false;
    107107  this->bFadeRefraction = false;
     108  this->bFadeWaterColor = false;
    108109
    109110  this->tempcounter = 0;
     
    574575  this->move2 = this->move * this->kNormalMapScale;
    575576
    576   // fading
     577  // fading TODO fix this so it isnt hacky anymore
    577578  if(bFadeWaterUV)
    578579  {
     
    659660  }
    660661
    661 
    662 //   if(this->tempcounter == 300)
    663 //   {
    664 //     PRINTF(0)("\n\n\n\n\n\n///////////////////////test waterchangecolor/////////////////////\n\n\n\n\n\n");
    665 //     this->fadeWaterUV(1, 10);
    666 //   }
     662  if(bFadeWaterColor)
     663  {
     664    this->waterColorRFader = new tAnimation<MappedWater>(this, &MappedWater::resetWaterColorR);
     665    this->waterColorRFader->setInfinity(ANIM_INF_CONSTANT);
     666
     667    this->waterColorRFader->addKeyFrame(this->waterColor.x, this->waterColorFadeTime, ANIM_LINEAR);
     668    this->waterColorRFader->addKeyFrame(this->newWaterColor.x, 0, ANIM_LINEAR);
     669
     670    this->waterColorRFader->replay();
     671
     672    this->waterColorGFader = new tAnimation<MappedWater>(this, &MappedWater::resetWaterColorG);
     673    this->waterColorGFader->setInfinity(ANIM_INF_CONSTANT);
     674
     675    this->waterColorGFader->addKeyFrame(this->waterColor.x, this->waterColorFadeTime, ANIM_LINEAR);
     676    this->waterColorGFader->addKeyFrame(this->newWaterColor.x, 0, ANIM_LINEAR);
     677
     678    this->waterColorGFader->replay();
     679
     680    this->waterColorBFader = new tAnimation<MappedWater>(this, &MappedWater::resetWaterColorB);
     681    this->waterColorBFader->setInfinity(ANIM_INF_CONSTANT);
     682
     683    this->waterColorBFader->addKeyFrame(this->waterColor.x, this->waterColorFadeTime, ANIM_LINEAR);
     684    this->waterColorBFader->addKeyFrame(this->newWaterColor.x, 0, ANIM_LINEAR);
     685
     686    this->waterColorBFader->replay();
     687
     688    bFadeWaterColor = false;
     689  }
     690
    667691  if(this->tempcounter == 100)
    668692  {
    669693    PRINTF(0)("\n\n\n\n\n\n///////////////////////test waterchangecolor/////////////////////\n\n\n\n\n\n");
    670     this->fadeWaterHeight(0, 15);
     694    this->fadeWaterColor(1, 0, 1, 15);
    671695  }
    672696  //PRINTF(0)("counter %i/n", tempcounter);
  • branches/mountain_lake/src/world_entities/environments/mapped_water.h

    r8918 r8919  
    9696  void fadeRefraction(float refraction, float time) { this->newRefraction = refraction; this->refractionFadeTime = time; this->bFadeRefraction = true; }
    9797  void fadeWaterHeight(float y, float time) { this->newWaterHeight = y; this->waterHeightFadeTime = time; this->bFadeWaterHeight = true; }
     98  void fadeWaterColor(float r, float g, float b, float time) { this->newWaterColor = Vector(r, g, b); this->waterColorFadeTime = time; this->bFadeWaterColor = true; }
    9899
    99100private:
     
    140141  Shader::Uniform*          refr_uni;               //!< uniform that is used for the strength of the refraction
    141142
    142   // fading
     143  // fading TODO fix this so it isnt so hacky anymore
    143144  tAnimation<MappedWater>*  waterUVFader;
    144145  float                     newWaterUV;
     
    169170  float                     waterHeightFadeTime;
    170171  bool                      bFadeWaterHeight;
     172  tAnimation<MappedWater>*  waterColorRFader;
     173  tAnimation<MappedWater>*  waterColorGFader;
     174  tAnimation<MappedWater>*  waterColorBFader;
     175  Vector                    newWaterColor;
     176  float                     waterColorFadeTime;
     177  bool                      bFadeWaterColor;
    171178
    172179  int tempcounter;
Note: See TracChangeset for help on using the changeset viewer.