Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7982 in orxonox.OLD for branches/water/src/world_entities


Ignore:
Timestamp:
May 30, 2006, 3:30:47 PM (18 years ago)
Author:
stefalie
Message:

branches/water: light!

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

Legend:

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

    r7832 r7982  
    3939  mat.setDiffuseMap("pictures/dudvmap.bmp", GL_TEXTURE_2D, 0);
    4040  // load refraction texture
    41   mat.setDiffuseMap("pictures/sky-replace.jpg", 1);
     41 // mat.setDiffuseMap("pictures/sky-replace.jpg", 1);
    4242  // load normal map
    4343  mat.setDiffuseMap("pictures/normalmap.bmp", GL_TEXTURE_2D, 2);
     
    123123  // HACK
    124124
    125   glDisable(GL_BLEND);
    126125  //glActiveTexture(GL_TEXTURE0);
    127126  //glBindTexture(GL_TEXTURE_2D, this->texture);
    128 
     127  mat.unselect();
    129128  mat.select();
    130   glBindTexture(GL_TEXTURE_2D, this->mat.getDiffuseTexture(0));
     129  //glBindTexture(GL_TEXTURE_2D, this->mat.getDiffuseTexture(0));
    131130
    132131
     
    134133  this->shader->activateShader();
    135134  GLint uniform;
     135  Shader::Uniform* uni;
    136136
    137137  // Set the variable "reflection" to correspond to the first texture unit
    138   uniform = glGetUniformLocationARB(shader->getProgram(), "reflection");
    139   glUniform1iARB(uniform, 0); //second paramter is the texture unit
     138  uni = new Shader::Uniform (shader, "reflection");
     139  uni->set(0);
     140  //uniform = glGetUniformLocationARB(shader->getProgram(), "reflection");
     141  //glUniform1iARB(uniform, 0); //second paramter is the texture unit
    140142
    141143  // Set the variable "refraction" to correspond to the second texture unit
    142   uniform = glGetUniformLocationARB(shader->getProgram(), "refraction");
    143   glUniform1iARB(uniform, 1);
     144 // uni = new Shader::Uniform (shader, "refraction");
     145 // uni->set(1);
     146  //uniform = glGetUniformLocationARB(shader->getProgram(), "refraction");
     147  //glUniform1iARB(uniform, 1);
    144148
    145149  // Set the variable "normalMap" to correspond to the third texture unit
    146   uniform = glGetUniformLocationARB(shader->getProgram(), "normalMap");
    147   glUniform1iARB(uniform, 2);
     150  uni = new Shader::Uniform (shader, "normalMap");
     151  uni->set(2);
     152  //uniform = glGetUniformLocationARB(shader->getProgram(), "normalMap");
     153  //glUniform1iARB(uniform, 2);
    148154
    149155  // Set the variable "dudvMap" to correspond to the fourth texture unit
    150   uniform = glGetUniformLocationARB(shader->getProgram(), "dudvMap");
    151   glUniform1iARB(uniform, 3);
     156  uni = new Shader::Uniform (shader, "dudvMap");
     157  uni->set(3);
     158  //uniform = glGetUniformLocationARB(shader->getProgram(), "dudvMap");
     159  //glUniform1iARB(uniform, 3);
    152160
    153161  // Set the variable "depthMap" to correspond to the fifth texture unit
    154   uniform = glGetUniformLocationARB(shader->getProgram(), "depthMap");
    155   glUniform1iARB(uniform, 4);
     162 // uni = new Shader::Uniform (shader, "depthMap");
     163 // uni->set(4);
     164  //uniform = glGetUniformLocationARB(shader->getProgram(), "depthMap");
     165  //glUniform1iARB(uniform, 4);
    156166  // FIXME we dont have a depthMap yet :-(
    157167
     
    177187
    178188
    179   float move2 = this->move * this->kNormalMapScale;
    180   float refrUV = this->g_WaterUV;
    181   float normalUV = this->g_WaterUV * this->kNormalMapScale;
     189
    182190
    183191
     
    219227
    220228
     229  Material::unselect();
     230
    221231  glPopMatrix();
    222232}
     
    225235{
    226236  this->move += this->g_WaterFlow = 0.004;
     237  this->move2 = this->move * this->kNormalMapScale;
     238  this->refrUV = this->g_WaterUV;
     239  this->normalUV = this->g_WaterUV * this->kNormalMapScale;
    227240}
    228241
  • branches/water/src/world_entities/environments/mapped_water.h

    r7823 r7982  
    4040    float           kNormalMapScale;
    4141    float           g_WaterFlow;
     42    float           move2;
     43    float           refrUV;
     44    float           normalUV;
    4245
    4346    int             textureSize;                //!< size of the texture
Note: See TracChangeset for help on using the changeset viewer.