Changeset 8090 in orxonox.OLD for branches/water/src/world_entities/environments
- Timestamp:
- Jun 1, 2006, 5:29:06 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/water/src/world_entities/environments/mapped_water.cc
r8089 r8090 56 56 // set the size of the refraction and reflection textures 57 57 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)); 64 64 // 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)); 67 67 68 68 // 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); 70 70 71 71 //gluBuild2DMipmaps(GL_TEXTURE_2D, channels, this->textureSize, this->textureSize, type, GL_UNSIGNED_INT, pTexture); 72 72 73 73 //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); 76 76 77 77 // Set the texture quality … … 82 82 83 83 // 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; 86 86 87 87 … … 293 293 294 294 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); 296 296 //glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, 0, 0, textureSize, textureSize, 0); 297 297 //mat.renderToTexture(0, GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, 0, textureSize, textureSize, 0);
Note: See TracChangeset
for help on using the changeset viewer.