Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8867 in orxonox.OLD


Ignore:
Timestamp:
Jun 28, 2006, 4:08:57 PM (18 years ago)
Author:
stefalie
Message:

mountain_lake: now its possible to set the strength of the reflection in the oxw file

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

    r8866 r8867  
    6363  delete shineSize_uni;
    6464  delete shineStrength_uni;
     65  delete reflStrength_uni;
    6566  delete refr_uni;
    6667}
     
    7576  this->setWaterSize(100, 100);
    7677  this->setWaterUV(9);
    77   this->setWaterFlow(0.08);
     78  this->setWaterFlow(0.08f);
    7879  this->setLightPos(0, 10, 0);
    7980  this->setWaterAngle(0);
     
    8182  this->setWaterColor(0.1f, 0.2f, 0.4f);
    8283  this->setShineSize(128);
    83   this->setShineStrength(0.7);
     84  this->setShineStrength(0.7f);
     85  this->setReflStrength(1.0f);
    8486  this->setRefraction(0.009f);
    8587
     
    160162  shineStrength_uni = new Shader::Uniform(shader, "shineStrength");
    161163  shineStrength_uni->set(this->shineStrength);
     164  // Set the variable "reflStrength"
     165  reflStrength_uni = new Shader::Uniform(shader, "reflStrength");
     166  reflStrength_uni->set(this->reflStrength);
    162167  // Set the variable "refraction"
    163168  refr_uni = new Shader::Uniform(shader, "kRefraction");
     
    227232  // Set the variable "shine"
    228233  shineStrength_uni->set(this->shineStrength);
     234
     235  this->shader->deactivateShader();
     236}
     237
     238/**
     239 * @brief resets the strength of the reflection in the Shader
     240 * @param strength new value for the strength of the reflection
     241 */
     242void MappedWater::resetReflStrength(float strength)
     243{
     244  this->shader->activateShader();
     245  this->reflStrength = strength;
     246
     247  // Set the variable "shine"
     248  reflStrength_uni->set(this->reflStrength);
    229249
    230250  this->shader->deactivateShader();
     
    281301  LoadParam(root, "shinesize", this, MappedWater, setShineSize);
    282302  LoadParam(root, "shinestrength", this, MappedWater, setShineStrength);
     303  LoadParam(root, "reflstrength", this, MappedWater, setReflStrength);
    283304  LoadParam(root, "refraction", this, MappedWater, setRefraction);
    284305}
  • branches/mountain_lake/src/world_entities/environments/mapped_water.h

    r8866 r8867  
    1212  <waterangle>0</waterangle>
    1313  <normalmapscale>0.25</normalmapscale><!-- you won't see a big differnce if you change that -->
    14   <shineSize>128</shineSize><!-- the bigger the value, the smaller the specular reflection point -->
    15   <shineStrength>0.7</shineStrength>
     14  <shinesize>128</shinesize><!-- the bigger the value, the smaller the specular reflection point -->
     15  <shinestrength>0.7</shinestrength>
     16  <reflstrength>1</reflstrength>
    1617  <refraction>0.009</refraction>
    1718  <watercolor>0.1, 0.2, 0.4</watercolor>
     
    5556  void setShineSize(float shine) { this->shineSize = shine; }
    5657  void setShineStrength(float strength) { this->shineStrength = strength; }
     58  void setReflStrength(float strength) { this->reflStrength = strength; }
    5759  void setRefraction(float refraction) { this->refraction = refraction; }
    5860  void setWaterColor(float r, float g, float b) { this->waterColor = Vector(r,g,b); this->newWaterColor = this->waterColor; }
     
    6365  void resetShineSize(float shine);
    6466  void resetShineStrength(float strength);
     67  void resetReflStrength(float strength);
    6568  void resetRefraction(float refraction);
    6669  void resetLightPos(float x, float y, float z);
     
    9699  float               shineSize;              //!< the bigger the value, the smaller the specular reflection point
    97100  float               shineStrength;
     101  float               reflStrength;
    98102  float               refraction;
    99103
     
    107111  Shader::Uniform*    shineStrength_uni;      //!< uniform that is used for the strenght of the specular reflection
    108112  Shader::Uniform*    refr_uni;               //!< uniform that is used for the strength of the refraction
     113  Shader::Uniform*    reflStrength_uni;       //!< uniform that is used for the strength of the reflection
    109114
    110115
Note: See TracChangeset for help on using the changeset viewer.