Changeset 7982 in orxonox.OLD for branches/water/src/world_entities
- Timestamp:
- May 30, 2006, 3:30:47 PM (18 years ago)
- 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 39 39 mat.setDiffuseMap("pictures/dudvmap.bmp", GL_TEXTURE_2D, 0); 40 40 // load refraction texture 41 mat.setDiffuseMap("pictures/sky-replace.jpg", 1);41 // mat.setDiffuseMap("pictures/sky-replace.jpg", 1); 42 42 // load normal map 43 43 mat.setDiffuseMap("pictures/normalmap.bmp", GL_TEXTURE_2D, 2); … … 123 123 // HACK 124 124 125 glDisable(GL_BLEND);126 125 //glActiveTexture(GL_TEXTURE0); 127 126 //glBindTexture(GL_TEXTURE_2D, this->texture); 128 127 mat.unselect(); 129 128 mat.select(); 130 glBindTexture(GL_TEXTURE_2D, this->mat.getDiffuseTexture(0));129 //glBindTexture(GL_TEXTURE_2D, this->mat.getDiffuseTexture(0)); 131 130 132 131 … … 134 133 this->shader->activateShader(); 135 134 GLint uniform; 135 Shader::Uniform* uni; 136 136 137 137 // 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 140 142 141 143 // 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); 144 148 145 149 // 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); 148 154 149 155 // 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); 152 160 153 161 // 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); 156 166 // FIXME we dont have a depthMap yet :-( 157 167 … … 177 187 178 188 179 float move2 = this->move * this->kNormalMapScale; 180 float refrUV = this->g_WaterUV; 181 float normalUV = this->g_WaterUV * this->kNormalMapScale; 189 182 190 183 191 … … 219 227 220 228 229 Material::unselect(); 230 221 231 glPopMatrix(); 222 232 } … … 225 235 { 226 236 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; 227 240 } 228 241 -
branches/water/src/world_entities/environments/mapped_water.h
r7823 r7982 40 40 float kNormalMapScale; 41 41 float g_WaterFlow; 42 float move2; 43 float refrUV; 44 float normalUV; 42 45 43 46 int textureSize; //!< size of the texture
Note: See TracChangeset
for help on using the changeset viewer.