Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7816 in orxonox.OLD for branches/water/src


Ignore:
Timestamp:
May 24, 2006, 4:56:48 PM (19 years ago)
Author:
stefalie
Message:


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

Legend:

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

    r7814 r7816  
    2626
    2727MappedWater::MappedWater(const TiXmlElement* root)
    28     : texture(GL_TEXTURE_2D)
    2928{
    3029  this->setClassID(CL_MAPPED_WATER, "MappedWater");
     
    6160  mat.select();
    6261  glBindTexture(GL_TEXTURE_2D, this->mat.getDiffuseTexture(0));
    63   printf("========= CREATE %d\n", this->texture.getTexture());
    6462
    6563  // Create the texture and store it on the video card
     
    120118
    121119
    122 /*  // Shader init
     120  // Shader init
    123121  //this->shader->activateShader();
    124   GLint uniform;
     122  //GLint uniform;
    125123
    126124  // Set the variable "reflection" to correspond to the first texture unit
    127   uniform = glGetUniformLocationARB(shader->getProgram(), "reflection");
    128   glUniform1iARB(uniform, 0); //second paramter is the texture unit
     125  //uniform = glGetUniformLocationARB(shader->getProgram(), "reflection");
     126  //glUniform1iARB(uniform, 0); //second paramter is the texture unit
    129127
    130128  // Set the variable "refraction" to correspond to the second texture unit
     
    138136
    139137  // Set the variable "dudvMap" to correspond to the fourth texture unit
    140   uniform = glGetUniformLocationARB(shader->getProgram(), "dudvMap");
    141   glUniform1iARB(uniform, 3);
     138  //uniform = glGetUniformLocationARB(shader->getProgram(), "dudvMap");
     139  //glUniform1iARB(uniform, 3);
    142140
    143141  // Set the variable "depthMap" to correspond to the fifth texture unit
     
    147145
    148146  // Give the variable "waterColor" a blue color
    149   uniform = glGetUniformLocationARB(shader->getProgram(), "waterColor");
    150   glUniform4fARB(uniform, 0.1f, 0.2f, 0.4f, 1.0f);
     147  //uniform = glGetUniformLocationARB(shader->getProgram(), "waterColor");
     148  //glUniform4fARB(uniform, 0.1f, 0.2f, 0.4f, 1.0f);
    151149
    152150  // FIXME set camera and light information
     
    155153  // Store the camera position in a variable
    156154  //CVector3 vPosition = g_Camera.Position();
    157   Vector vPosition(50.0f, 50.0f, 50.0f);
     155  //Vector vPosition(50.0f, 50.0f, 50.0f);
    158156
    159157  // Give the variable "lightPos" our hard coded light position
    160   uniform = glGetUniformLocationARB(shader->getProgram(), "lightPos");
    161   glUniform4fARB(uniform, lightPos.x, lightPos.y, lightPos.z, 1.0f);
     158  //uniform = glGetUniformLocationARB(shader->getProgram(), "lightPos");
     159  //glUniform4fARB(uniform, lightPos.x, lightPos.y, lightPos.z, 1.0f);
    162160
    163161  // Give the variable "cameraPos" our camera position
    164   uniform = glGetUniformLocationARB(shader->getProgram(), "cameraPos");
    165   glUniform4fARB(uniform, vPosition.x, vPosition.y, vPosition.z, 1.0f);
    166 */
     162  //uniform = glGetUniformLocationARB(shader->getProgram(), "cameraPos");
     163  //glUniform4fARB(uniform, vPosition.x, vPosition.y, vPosition.z, 1.0f);
     164
    167165  glBegin(GL_QUADS);
    168166  glNormal3f(0, 1, 0);
     
    172170  glMultiTexCoord2f(GL_TEXTURE3, 0, 0);
    173171  glMultiTexCoord2f(GL_TEXTURE4, 0, 0);
    174   glVertex3f(-500, 0, 500);
     172  glVertex3f(0, 0, 0);
    175173
    176174  glMultiTexCoord2f(GL_TEXTURE0, 1, 0);
     
    179177  glMultiTexCoord2f(GL_TEXTURE3, 1, 0);
    180178  glMultiTexCoord2f(GL_TEXTURE4, 1, 0);
    181   glVertex3f(500, 0, 500);
     179  glVertex3f(0, 0, 1000);
    182180
    183181  glMultiTexCoord2f(GL_TEXTURE0, 1, 1);
     
    186184  glMultiTexCoord2f(GL_TEXTURE3, 1, 1);
    187185  glMultiTexCoord2f(GL_TEXTURE4, 1, 1);
    188   glVertex3f(500, 0, -500);
     186  glVertex3f(1000, 0, 1000);
    189187
    190188  glMultiTexCoord2f(GL_TEXTURE0, 0, 1);
     
    193191  glMultiTexCoord2f(GL_TEXTURE3, 0, 1);
    194192  glMultiTexCoord2f(GL_TEXTURE4, 0, 1);
    195   glVertex3f(-500, 0, -500);
     193  glVertex3f(1000, 0, 0);
    196194  glEnd();
    197   //this->shader->deactivateShader();
     195
     196  this->shader->deactivateShader();
    198197
    199198  glPopMatrix();
     
    277276
    278277  glPopAttrib();
    279  
    280278}
    281279
  • branches/water/src/world_entities/environments/mapped_water.h

    r7796 r7816  
    3737    Material        mat;
    3838
    39     Texture         texture;
    4039    int             textureSize;       //!< size of the texture
    4140    Shader*         shader;
Note: See TracChangeset for help on using the changeset viewer.