Changeset 1886 for GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCubeMapRenderTechnique.cpp
- Timestamp:
- 12/13/06 16:36:34 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCubeMapRenderTechnique.cpp
r1725 r1886 17 17 String environmentMaterial, 18 18 int layer, 19 bool getMinMax, 20 bool attachToTexUnit, 21 String minVariableName, 22 String maxVariableName, 19 23 Pass* pass, 20 24 OgreRenderable* parentRenderable, … … 25 29 RenderTechnique(parentRenderable, parentTechniqueGroup) 26 30 { 31 this->minVariableName = minVariableName; 32 this->maxVariableName = maxVariableName; 33 this->attachToTexUnit = attachToTexUnit; 34 this->getMinMax = getMinMax; 35 27 36 this->texID = texID; 28 37 this->selfMaterial = selfMaterial; … … 50 59 String cubemapname = cuberun->getCubeMapTextureName(); 51 60 52 pass->getTextureUnitState(texID)->setTextureName(cubemapname); 61 if(attachToTexUnit) 62 pass->getTextureUnitState(texID)->setTextureName(cubemapname); 63 if(getMinMax) 64 { 65 if(minVariableName != "") 66 pass->getFragmentProgramParameters()->setNamedConstant(minVariableName, cuberun->getMin()); 67 if(maxVariableName != "") 68 pass->getFragmentProgramParameters()->setNamedConstant(maxVariableName, cuberun->getMax()); 69 } 53 70 } 54 71 … … 69 86 selfMaterial, 70 87 environmentMaterial, 88 getMinMax, 71 89 cubemapLayer); 72 90 } … … 169 187 f->environmentMaterial = params; 170 188 } 189 190 void parseMinVarName(String& params, RenderTechniqueFactory* factory) 191 { 192 OgreCubeMapRenderTechniqueFactory* f = (OgreCubeMapRenderTechniqueFactory*) factory; 193 f->minVariableName = params; 194 } 195 void parseMaxVarName(String& params, RenderTechniqueFactory* factory) 196 { 197 OgreCubeMapRenderTechniqueFactory* f = (OgreCubeMapRenderTechniqueFactory*) factory; 198 f->maxVariableName = params; 199 } 200 171 201 void parseLayer(String& params, RenderTechniqueFactory* factory) 172 202 { 173 203 OgreCubeMapRenderTechniqueFactory* f = (OgreCubeMapRenderTechniqueFactory*) factory; 174 204 f->layer = StringConverter::parseInt(params); 205 } 206 207 void parseGetMinMax(String& params, RenderTechniqueFactory* factory) 208 { 209 OgreCubeMapRenderTechniqueFactory* f = (OgreCubeMapRenderTechniqueFactory*) factory; 210 f->getMinMax = StringConverter::parseBool(params); 211 } 212 213 void parseAttachTexUnit(String& params, RenderTechniqueFactory* factory) 214 { 215 OgreCubeMapRenderTechniqueFactory* f = (OgreCubeMapRenderTechniqueFactory*) factory; 216 f->attachToTexUnit = StringConverter::parseBool(params); 175 217 } 176 218 … … 196 238 this->attributeParsers.insert(AttribParserList::value_type("env_material", (ILLUM_ATTRIBUTE_PARSER) parseEnvMaterial)); 197 239 this->attributeParsers.insert(AttribParserList::value_type("layer", (ILLUM_ATTRIBUTE_PARSER) parseLayer)); 240 this->attributeParsers.insert(AttribParserList::value_type("get_minmax", (ILLUM_ATTRIBUTE_PARSER) parseGetMinMax)); 241 this->attributeParsers.insert(AttribParserList::value_type("attach_to_texture_unit", (ILLUM_ATTRIBUTE_PARSER) parseAttachTexUnit)); 242 this->attributeParsers.insert(AttribParserList::value_type("min_var_name", (ILLUM_ATTRIBUTE_PARSER) parseMinVarName)); 243 this->attributeParsers.insert(AttribParserList::value_type("max_var_name", (ILLUM_ATTRIBUTE_PARSER) parseMaxVarName)); 198 244 199 245 } … … 215 261 environmentMaterial = ""; 216 262 layer = 0; 263 getMinMax = false; 264 attachToTexUnit = true; 265 minVariableName = ""; 266 maxVariableName = ""; 267 217 268 } 218 269 … … 241 292 environmentMaterial, 242 293 layer, 294 getMinMax, 295 attachToTexUnit, 296 minVariableName, 297 maxVariableName, 243 298 pass, 244 299 parentRenderable,
Note: See TracChangeset
for help on using the changeset viewer.