Changeset 1180 for GTP/trunk/Lib/Vis/Preprocessing
- Timestamp:
- 08/03/06 09:11:06 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1179 r1180 4884 4884 4885 4885 VssRayContainer::const_iterator vit, vit_end = constructionRays.end(); 4886 4886 4887 for (vit = constructionRays.begin(); vit != vit_end; ++ vit) 4887 4888 { … … 4901 4902 4902 4903 cout << "Computing remaining ray contributions ... "; 4903 4904 4904 4905 4905 // recast rest of rays … … 5688 5688 else 5689 5689 { 5690 // / get current leaf the point5690 // get current leaf the point is located in 5691 5691 KdLeaf *leaf = mOspTree->GetLeaf(ray.mTermination); 5692 5692 KdIntersectable *entry = mOspTree->GetOrCreateKdIntersectable(leaf); … … 5726 5726 } 5727 5727 5728 #if 05728 #if 1 5729 5729 void VspOspViewCellsManager::EvalViewCellPartition() 5730 5730 { 5731 5731 int samplesPerPass; 5732 5732 int numSamples; 5733 int castSamples = 0;5733 int castSamples = (int)storedRays.size(); 5734 5734 5735 5735 char s[64]; 5736 5737 Environment::GetSingleton()->GetIntValue("ViewCells.Evaluation.samplesPerPass", samplesPerPass);5738 Environment::GetSingleton()->GetIntValue("ViewCells.Evaluation.samples", numSamples);5739 5740 5736 char statsPrefix[100]; 5737 5741 5738 Environment::GetSingleton()->GetStringValue("ViewCells.Evaluation.statsPrefix", statsPrefix); 5742 5739 5743 Debug << "view cell evaluation samples per pass: " << samplesPerPass << endl;5744 Debug << "view cell evaluation samples: " << numSamples << endl;5745 5740 Debug << "view cell stats prefix: " << statsPrefix << endl; 5746 5741 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h
r1179 r1180 1011 1011 1012 1012 protected: 1013 #if 0 1013 1014 #if 1 1014 1015 virtual void EvalViewCellPartition(); 1015 1016 #endif -
GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp
r1179 r1180 606 606 float sampCon = 0.0f; 607 607 608 //-- update pvs609 608 if (updatePvs) 610 609 { 610 //-- update pvs of view cell 611 611 AddSamplesToPvs(leaf, *tData.mRays, sampCon, conSamp); 612 612 … … 715 715 float sampCon = 0.0f; 716 716 717 717 #if 0 718 718 //-- store pvs optained from rays 719 719 720 AddSamplesToPvs(leaf, *tData.mRays, sampCon, conSamp); 720 721 … … 725 726 mVspStats.contributingSamples += conSamp; 726 727 mVspStats.sampleContributions += (int)sampCon; 727 728 #endif 728 729 //-- store additional info 729 730 if (mStoreRays) … … 974 975 975 976 void VspTree::AddSamplesToPvs(VspLeaf *leaf, 976 const RayInfoContainer &rays,977 float &sampleContributions,978 int &contributingSamples)977 const RayInfoContainer &rays, 978 float &sampleContributions, 979 int &contributingSamples) 979 980 { 980 981 sampleContributions = 0; … … 2940 2941 mBoundingBox = kdTree.GetBox(); 2941 2942 mRoot = kdTree.GetRoot(); 2943 2942 2944 mSplitCandidates = new vector<SortableEntry>; 2943 2945 } … … 2946 2948 OspTree::~OspTree() 2947 2949 { 2950 // delete kd intersectables 2948 2951 KdIntersectableMap::iterator it, it_end = mKdIntersectables.end(); 2949 2952 … … 3478 3481 3479 3482 const float oldRenderCost = (float)totalPvs * totalVol + Limits::Small; 3480 const float newRenderCost = 3481 (float)pvsFront * volFront + 3482 (float)pvsBack * volBack + 3483 (float)totalPvs * frontAndBackVol; 3483 const float newRenderCost = (float)pvsFront * volFront + 3484 (float)pvsBack * volBack + 3485 (float)totalPvs * frontAndBackVol; 3484 3486 3485 3487 … … 4492 4494 4493 4495 4496 float OspTree::EvalViewCellsVolume(const RayInfoContainer &rays) const 4497 { 4498 float vol = 0; 4499 ViewCell::NewMail(); 4500 4501 RayInfoContainer::const_iterator rit, rit_end = rays.end(); 4502 4503 for (rit = rays.begin(); rit != rays.end(); ++ rit) 4504 { 4505 VssRay *ray = (*rit).mRay; 4506 4507 if (!ray->mTerminationObject && !ray->mOriginObject) 4508 continue; 4509 4510 ViewCellContainer viewCells; 4511 mVspTree->CastLineSegment(ray->mOrigin, ray->mTermination, viewCells); 4512 4513 ViewCellContainer::const_iterator vit, vit_end = viewCells.end(); 4514 4515 for (vit = viewCells.begin(); vit != vit_end; ++ vit) 4516 { 4517 ViewCell *vc = *vit; 4518 4519 if (!vc->Mailed()) 4520 { 4521 vc->Mail(); 4522 vol += vc->GetVolume(); 4523 } 4524 } 4525 } 4526 4527 return vol; 4528 } 4529 4494 4530 4495 4531 /********************************************************************/ … … 4632 4668 mOspTree.EvalSplitCandidate(*oSplitCandidate); 4633 4669 4634 mOspTree.mTotalCost = (float)objects.size(); 4670 const float vol = mOspTree.EvalViewCellsVolume(rays); 4671 4672 mOspTree.mTotalCost = (float)objects.size() * vol; 4635 4673 mOspTree.EvalSubdivisionStats(*oSplitCandidate); 4636 4674 -
GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.h
r1178 r1180 1406 1406 1407 1407 1408 /** Compute "pvs size of this object container1409 @ note bot relly pvs size just weighted sum of object taking their1408 /** Compute "pvs size" of this object container 1409 @note not really pvs size just weighted sum of object taking their 1410 1410 appearances in pvss into account 1411 1411 */ … … 1704 1704 float &volRight); 1705 1705 1706 float EvalViewCellsVolume(const RayInfoContainer &rays) const; 1707 1708 1706 1709 protected: 1707 1710
Note: See TracChangeset
for help on using the changeset viewer.