Ignore:
Timestamp:
12/20/06 12:44:49 (18 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp

    r1913 r1914  
    504504                // decrease the weighted average cost of the subdivisoin 
    505505                mTotalCost -= sc->GetRenderCostDecrease(); 
     506                cout << "))))))))))))) " << sc->GetRenderCostDecrease() << endl; 
    506507                mPvsEntries += sc->GetPvsEntriesIncr(); 
    507508 
     
    649650        const float backVol = EvalViewCellsVolume(splitCandidate.mBackObjects) / GetViewSpaceVolume(); 
    650651 
    651         cout <<"here8 "<< parentVol << " " << " old ratio: " << oldRatio << " frointvol: " << frontVol << endl; 
     652        cout <<"here8 "<< parentVol << " " << " old vol: " << oldVolume << " frontvol: " << frontVol << endl; 
    652653        splitCandidate.mCorrectedFrontVolume =  
    653654                mHierarchyManager->EvalCorrectedPvs(frontVol, parentVol, avgRayContri); 
     
    663664        const float relfrontCost = splitCandidate.mCorrectedFrontVolume *  
    664665                EvalAbsCost(splitCandidate.mFrontObjects); 
    665         const float relBackCost =  splitCandidate.mCorrectedFrontVolume *  
     666        const float relBackCost =  splitCandidate.mCorrectedBackVolume *  
    666667                EvalAbsCost(splitCandidate.mBackObjects); 
    667668        const float relParentCost = parentVol *  
     
    21982199        BvhLeaf *bvhLeaf = dynamic_cast<BvhLeaf *>(mRoot); 
    21992200 
    2200         // probability that volume is "seen" from the view cells 
    2201         const float prop = EvalViewCellsVolume(objects) / GetViewSpaceVolume(); 
    2202  
    22032201        // only rays intersecting objects in node are interesting 
    22042202        const int nRays = AssociateObjectsWithRays(sampleRays); 
    22052203        //cout << "using " << nRays << " of " << (int)sampleRays.size() << " rays" << endl; 
    22062204 
     2205        // probability that volume is "seen" from the view cells 
     2206        const float prop = EvalViewCellsVolume(objects) / GetViewSpaceVolume(); 
     2207 
    22072208        // create bvh traversal data 
    22082209        BvhTraversalData oData(bvhLeaf, 0, prop, nRays); 
     
    22232224        oData.mCorrectedPvs = oData.mPvs = (float)mPvsEntries; 
    22242225        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; 
    22262227 
    22272228        BvhSubdivisionCandidate *oSubdivisionCandidate =  
     
    23612362        mRoot = bvhleaf; 
    23622363         
    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(); 
    23692365        // probability that volume is "seen" from the view cells 
     2366        const float viewSpaceVol = mViewCellsManager->GetViewSpaceBox().GetVolume(); 
    23702367        const float prop = EvalViewCellsVolume(objects); 
    2371 #endif 
    23722368 
    23732369        const int nRays = CountRays(objects); 
     
    23892385        bvhLeaf->SetSubdivisionCandidate(oSubdivisionCandidate); 
    23902386 
    2391         const float viewSpaceVol = mViewCellsManager->GetViewSpaceBox().GetVolume(); 
    2392         mTotalCost = (float)objects.size() * prop / viewSpaceVol; 
     2387        mTotalCost = (float)objects.size() * prop; 
    23932388 
    23942389        PrintSubdivisionStats(*oSubdivisionCandidate); 
Note: See TracChangeset for help on using the changeset viewer.