Changeset 8729 in orxonox.OLD for branches/water/src/world_entities/environments/mapped_water.cc
- Timestamp:
- Jun 22, 2006, 3:49:22 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/water/src/world_entities/environments/mapped_water.cc
r8719 r8729 19 19 #include "util/loading/resource_manager.h" 20 20 #include "state.h" 21 #include "math.h" 21 22 22 23 … … 53 54 delete shader; 54 55 delete cam_uni; 56 delete color_uni; 57 delete light_uni; 58 delete shine_uni; 55 59 } 56 60 … … 68 72 this->setWaterAngle(0); 69 73 this->setNormalMapScale(0.25f); 74 this->setWaterColor(0.1f, 0.2f, 0.4f); 75 this->setShininess(128); 70 76 71 77 // initialization of the texture coords, speeds etc... … … 75 81 this->move = 0; 76 82 this->move2 = this->move * this->kNormalMapScale; 83 84 77 85 } 78 86 … … 132 140 Shader::Uniform(shader, "depthMap").set(2); 133 141 // Give the variable "waterColor" a blue color 134 Shader::Uniform(shader, "waterColor").set(0.1f, 0.2f, 0.4f, 1.0f); 142 color_uni = new Shader::Uniform(shader, "waterColor"); 143 color_uni->set(waterColor.x, waterColor.y, waterColor.z, 1.0f); 135 144 // Give the variable "lightPos" our hard coded light position 136 Shader::Uniform(shader, "lightPos").set(lightPos.x, lightPos.y, lightPos.z, 1.0f); 145 light_uni = new Shader::Uniform(shader, "lightPos"); 146 light_uni->set(lightPos.x, lightPos.y, lightPos.z, 1.0f); 147 // Set the variable "shine" 148 shine_uni = new Shader::Uniform(shader, "kShine"); 149 shine_uni->set(this->shininess); 137 150 // uniform for the camera position 138 151 cam_uni = new Shader::Uniform(shader, "cameraPos"); … … 156 169 LoadParam(root, "normalmapscale", this, MappedWater, setNormalMapScale); 157 170 LoadParam(root, "waterangle", this, MappedWater, setWaterAngle); 171 LoadParam(root, "watercolor", this, MappedWater, setWaterColor); 172 LoadParam(root, "shininess", this, MappedWater, setShininess); 158 173 } 159 174
Note: See TracChangeset
for help on using the changeset viewer.