Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 1, 2006, 5:29:06 PM (18 years ago)
Author:
stefalie
Message:

water: reflection textures is ok

File:
1 edited

Legend:

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

    r8089 r8090  
    5656  // set the size of the refraction and reflection textures
    5757  this->textureSize = 512;
    58   unsigned int channels = 32;
    59   GLenum type = GL_RGBA;
    60   unsigned int* pTextureReflection = new unsigned int [this->textureSize * this->textureSize * channels];
    61   memset(pTextureReflection, 0, this->textureSize * this->textureSize * channels * sizeof(unsigned int));
    62   unsigned int* pTextureRefraction = new unsigned int [this->textureSize * this->textureSize * channels];
    63   memset(pTextureRefraction, 0, this->textureSize * this->textureSize * channels * sizeof(unsigned int));
     58  //unsigned int channels = 32;
     59  //GLenum type = GL_RGBA;
     60  //unsigned int* pTextureReflection = new unsigned int [this->textureSize * this->textureSize * channels];
     61  //memset(pTextureReflection, 0, this->textureSize * this->textureSize * channels * sizeof(unsigned int));
     62  //unsigned int* pTextureRefraction = new unsigned int [this->textureSize * this->textureSize * channels];
     63  //memset(pTextureRefraction, 0, this->textureSize * this->textureSize * channels * sizeof(unsigned int));
    6464  // Register the texture with OpenGL and bind it to the texture ID
    65   mat.select();
    66   glBindTexture(GL_TEXTURE_2D, this->mat.getDiffuseTexture(0));
     65  //mat.select();
     66  //glBindTexture(GL_TEXTURE_2D, this->mat.getDiffuseTexture(0));
    6767
    6868  // Create the texture and store it on the video card
    69   glTexImage2D(GL_TEXTURE_2D, 0, channels, this->textureSize, this->textureSize, 0, type, GL_UNSIGNED_INT, pTextureReflection);
     69  //glTexImage2D(GL_TEXTURE_2D, 0, channels, this->textureSize, this->textureSize, 0, type, GL_UNSIGNED_INT, pTextureReflection);
    7070
    7171  //gluBuild2DMipmaps(GL_TEXTURE_2D, channels, this->textureSize, this->textureSize, type,  GL_UNSIGNED_INT, pTexture);
    7272
    7373  //the same for the refraction
    74   glBindTexture(GL_TEXTURE_2D, this->mat.getDiffuseTexture(1));
    75   glTexImage2D(GL_TEXTURE_2D, 0, channels, this->textureSize, this->textureSize, 0, type, GL_UNSIGNED_INT, pTextureRefraction);
     74  //glBindTexture(GL_TEXTURE_2D, this->mat.getDiffuseTexture(1));
     75  //glTexImage2D(GL_TEXTURE_2D, 0, channels, this->textureSize, this->textureSize, 0, type, GL_UNSIGNED_INT, pTextureRefraction);
    7676
    7777  // Set the texture quality
     
    8282
    8383  // Since we stored the texture space with OpenGL, we can delete the image data
    84   delete [] pTextureReflection;
    85   delete [] pTextureRefraction;
     84  //delete [] pTextureReflection;
     85  //delete [] pTextureRefraction;
    8686
    8787
     
    293293
    294294  mat.select();
    295   mat.renderToTexture(1, GL_TEXTURE_2D, 0, 0, 0, 0, 0, textureSize, textureSize);
     295  //mat.renderToTexture(1, GL_TEXTURE_2D, 0, 0, 0, 0, 0, textureSize, textureSize);
    296296  //glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, 0, 0, textureSize, textureSize, 0);
    297297  //mat.renderToTexture(0, GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, 0, textureSize, textureSize, 0);
Note: See TracChangeset for help on using the changeset viewer.