- Timestamp:
- 12/20/06 12:44:49 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
r1913 r1914 504 504 // decrease the weighted average cost of the subdivisoin 505 505 mTotalCost -= sc->GetRenderCostDecrease(); 506 cout << "))))))))))))) " << sc->GetRenderCostDecrease() << endl; 506 507 mPvsEntries += sc->GetPvsEntriesIncr(); 507 508 … … 649 650 const float backVol = EvalViewCellsVolume(splitCandidate.mBackObjects) / GetViewSpaceVolume(); 650 651 651 cout <<"here8 "<< parentVol << " " << " old ratio: " << oldRatio << " frointvol: " << frontVol << endl;652 cout <<"here8 "<< parentVol << " " << " old vol: " << oldVolume << " frontvol: " << frontVol << endl; 652 653 splitCandidate.mCorrectedFrontVolume = 653 654 mHierarchyManager->EvalCorrectedPvs(frontVol, parentVol, avgRayContri); … … 663 664 const float relfrontCost = splitCandidate.mCorrectedFrontVolume * 664 665 EvalAbsCost(splitCandidate.mFrontObjects); 665 const float relBackCost = splitCandidate.mCorrected FrontVolume *666 const float relBackCost = splitCandidate.mCorrectedBackVolume * 666 667 EvalAbsCost(splitCandidate.mBackObjects); 667 668 const float relParentCost = parentVol * … … 2198 2199 BvhLeaf *bvhLeaf = dynamic_cast<BvhLeaf *>(mRoot); 2199 2200 2200 // probability that volume is "seen" from the view cells2201 const float prop = EvalViewCellsVolume(objects) / GetViewSpaceVolume();2202 2203 2201 // only rays intersecting objects in node are interesting 2204 2202 const int nRays = AssociateObjectsWithRays(sampleRays); 2205 2203 //cout << "using " << nRays << " of " << (int)sampleRays.size() << " rays" << endl; 2206 2204 2205 // probability that volume is "seen" from the view cells 2206 const float prop = EvalViewCellsVolume(objects) / GetViewSpaceVolume(); 2207 2207 2208 // create bvh traversal data 2208 2209 BvhTraversalData oData(bvhLeaf, 0, prop, nRays); … … 2223 2224 oData.mCorrectedPvs = oData.mPvs = (float)mPvsEntries; 2224 2225 oData.mCorrectedVolume = oData.mVolume = prop; 2225 cout << "here52 " << oData.mCorrectedPvs << " " << oData.mVolume << " " << oData.mCorrectedVolume << endl;2226 cout << "here52 " << oData.mCorrectedPvs << " " << oData.mVolume << " " << oData.mCorrectedVolume << " prop: " << prop << endl; 2226 2227 2227 2228 BvhSubdivisionCandidate *oSubdivisionCandidate = … … 2361 2362 mRoot = bvhleaf; 2362 2363 2363 #if PROBABILIY_IS_BV_VOLUME 2364 mTermMinProbability *= mBoundingBox.GetVolume(); 2365 // probability that bounding volume is seen 2366 const float prop = GetBoundingBox().GetVolume(); 2367 #else 2368 mTermMinProbability *= mVspTree->GetBoundingBox().GetVolume(); 2364 //mTermMinProbability *= mVspTree->GetBoundingBox().GetVolume(); 2369 2365 // probability that volume is "seen" from the view cells 2366 const float viewSpaceVol = mViewCellsManager->GetViewSpaceBox().GetVolume(); 2370 2367 const float prop = EvalViewCellsVolume(objects); 2371 #endif2372 2368 2373 2369 const int nRays = CountRays(objects); … … 2389 2385 bvhLeaf->SetSubdivisionCandidate(oSubdivisionCandidate); 2390 2386 2391 const float viewSpaceVol = mViewCellsManager->GetViewSpaceBox().GetVolume(); 2392 mTotalCost = (float)objects.size() * prop / viewSpaceVol; 2387 mTotalCost = (float)objects.size() * prop; 2393 2388 2394 2389 PrintSubdivisionStats(*oSubdivisionCandidate);
Note: See TracChangeset
for help on using the changeset viewer.