Changeset 2397 for GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src
- Timestamp:
- 05/28/07 16:30:37 (18 years ago)
- Location:
- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreIlluminationManager.cpp
r2379 r2397 312 312 OgreTechniqueGroup* group = 0; 313 313 314 bool materialCopied = false; 314 315 for(unsigned int t = 0 ; t < mat->getNumTechniques() ; t++) 315 316 { … … 323 324 if( techniques.size() > 0) 324 325 { 326 bool needMaterialCopy = false; 327 328 std::vector<IllumTechniqueParams*>::iterator it = techniques.begin(); 329 std::vector<IllumTechniqueParams*>::iterator itend = techniques.end(); 330 while(it!=itend) 331 { 332 needMaterialCopy = needMaterialCopy || needMaterialCopyForTechnique(*it); 333 it++; 334 } 335 325 336 if(rend == 0) 326 337 { … … 339 350 sharedruns->updateBounds(); 340 351 } 341 String newMaterialName = mat->getName() + "_clone_" + rend->getName(); 342 Material* newMat = mat->clone(newMaterialName).getPointer(); 343 rend->setMaterialName(newMaterialName); 344 mat = sube->getMaterial().getPointer(); 345 break; 352 353 if(needMaterialCopy) 354 { 355 String newMaterialName = mat->getName() + "_clone_" + rend->getName(); 356 Material* newMat = mat->clone(newMaterialName).getPointer(); 357 rend->setMaterialName(newMaterialName); 358 mat = sube->getMaterial().getPointer(); 359 materialCopied = true; 360 } 361 362 if(materialCopied) 363 break; 346 364 } 347 365 } … … 495 513 } 496 514 } 515 516 bool OgreIlluminationManager::needMaterialCopyForTechnique(IllumTechniqueParams* params) 517 { 518 std::list<RenderTechniqueFactory*>::iterator it = techniqueFactories.begin(); 519 std::list<RenderTechniqueFactory*>::iterator itend = techniqueFactories.end(); 520 521 while(it != itend) 522 { 523 RenderTechniqueFactory* factory = *it; 524 525 if(factory->isType(params->getTypeName())) 526 return factory->needMaterialCopy(params); 527 528 it++; 529 } 530 } 531 497 532 void OgreIlluminationManager::preAllUpdates() 498 533 { -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreDepthShadowReceiverRenderTechnique.cpp
r2372 r2397 19 19 SceneBlendFactor passBlendingDEST, 20 20 bool createNewPasses, 21 int startTextureUnitID, 21 int startTextureUnitID, 22 bool nearestLightsFromCamera, 22 23 Pass* pass, 23 24 OgreRenderable* parentRenderable, … … 42 43 this->createNewPasses = createNewPasses; 43 44 this->startTextureUnitID = startTextureUnitID; 45 46 this->nearestLightsFromCamera = nearestLightsFromCamera; 44 47 45 48 if(createNewPasses) … … 86 89 { 87 90 LightList lights; 91 Vector3 center = OgreIlluminationManager::getSingleton().getMainCamera()->getWorldPosition(); 92 if(!nearestLightsFromCamera) 93 center = ((OgreSharedRuns*) sharedRuns)->getRootPosition(); 88 94 Root::getSingleton()._getCurrentSceneManager()->_populateLightList( 89 ((OgreSharedRuns*) sharedRuns)->getRootPosition(),95 center, 90 96 100000.0, 91 97 lights); … … 336 342 f->startTextureUnitID = StringConverter::parseInt(params); 337 343 } 344 void parseNearestFromCamera(String& params, RenderTechniqueFactory* factory) 345 { 346 OgreDepthShadowReceiverRenderTechniqueFactory* f = (OgreDepthShadowReceiverRenderTechniqueFactory*) factory; 347 f->nearestLightsFromCamera = StringConverter::parseBool(params); 348 } 338 349 } 339 350 … … 358 369 this->attributeParsers.insert(AttribParserList::value_type("new_passes", (ILLUM_ATTRIBUTE_PARSER) parseCreateNewPasses)); 359 370 this->attributeParsers.insert(AttribParserList::value_type("start_tex_id", (ILLUM_ATTRIBUTE_PARSER) parseStartTexID)); 371 this->attributeParsers.insert(AttribParserList::value_type("nearest_from_camera", (ILLUM_ATTRIBUTE_PARSER) parseNearestFromCamera)); 360 372 } 361 373 … … 382 394 createNewPasses = true; 383 395 startTextureUnitID = 0; 396 nearestLightsFromCamera = true; 384 397 385 398 parseParams(params); … … 401 414 createNewPasses, 402 415 startTextureUnitID, 416 nearestLightsFromCamera, 403 417 pass, 404 418 parentRenderable, … … 408 422 } 409 423 424 bool OgreDepthShadowReceiverRenderTechniqueFactory::needMaterialCopy(IllumTechniqueParams* params) 425 { 426 nearestLightsFromCamera = true; 427 parseParams(params); 428 if(nearestLightsFromCamera) 429 return false; 430 else 431 return true; 432 } 433 -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreHierarchicalParticleSystemTechnique.cpp
r1425 r2397 34 34 this->useVParam = useVParam; 35 35 this->useFParam = useFParam; 36 36 37 37 //create the Particle system 38 38 childPSysName = parentOgreRenderable->getName() + "_small_PSYS"; -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgrePathMapRenderTechnique.cpp
r2366 r2397 23 23 24 24 this->clusters = OgreIlluminationManager::getSingleton().getPathMapClusters(parentRenderable->getName()); 25 26 25 Pass* passToSet = pass; 27 26 -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreSBBRenderTechnique.cpp
r2379 r2397 6 6 7 7 OgreSBBRenderTechnique::OgreSBBRenderTechnique( unsigned char depthTexID, 8 bool bindTexture, 8 9 Pass* pass, 9 10 OgreRenderable* parentRenderable, … … 14 15 { 15 16 this->depthTexID = depthTexID; 17 this->bindTexture = bindTexture; 16 18 17 19 OgreIlluminationManager::getSingleton().createGlobalRun(ILLUMRUN_SCENE_CAMERA_DEPTH); … … 25 27 OgreIlluminationManager::getSingleton().addUpdateListener(this); 26 28 29 if(bindTexture) 27 30 pass->getTextureUnitState(depthTexID)->setTextureName(run->getDepthTextureName()); 28 31 … … 70 73 f->depthTexID = StringConverter::parseUnsignedInt(params); 71 74 } 75 void parseBindTexture(String& params, RenderTechniqueFactory* factory) 76 { 77 OgreSBBRenderTechniqueFactory* f = (OgreSBBRenderTechniqueFactory*) factory; 78 f->bindTexture = StringConverter::parseBool(params); 79 } 72 80 } 73 81 … … 80 88 //register parsers 81 89 this->attributeParsers.insert(AttribParserList::value_type("texture_unit_id", (ILLUM_ATTRIBUTE_PARSER) parseDepthTexID)); 90 this->attributeParsers.insert(AttribParserList::value_type("bind_texture", (ILLUM_ATTRIBUTE_PARSER) parseBindTexture)); 82 91 } 83 92 … … 90 99 //reset parameters 91 100 depthTexID = 1; 92 101 bindTexture = true; 102 93 103 parseParams(params); 94 104 95 105 OgreSBBRenderTechnique* result = new OgreSBBRenderTechnique( 96 106 depthTexID, 107 bindTexture, 97 108 pass, 98 109 parentRenderable,
Note: See TracChangeset
for help on using the changeset viewer.