Ignore:
Timestamp:
03/08/07 13:23:13 (17 years ago)
Author:
mattausch
Message:

improved performance of osp

File:
1 edited

Legend:

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

    r2206 r2210  
    881881                                                                                        splitCandidate.GetAvgRayContribution()); 
    882882         
     883        splitCandidate.mFrontPvs = fPvsSize; 
     884        splitCandidate.mBackPvs = bPvsSize; 
     885 
    883886        if (0) 
    884887        cout << "vsp pvs" 
     
    902905 
    903906        const VspTraversalData &tData = sc.mParentData; 
    904         const AxisAlignedPlane splitPlane = sc.mSplitPlane; 
     907        const AxisAlignedPlane &splitPlane = sc.mSplitPlane; 
    905908 
    906909        /////////////// 
     
    917920 
    918921        //-- compute pvs 
    919         frontData.mPvs = (float)EvalPvsEntriesSize(*frontData.mRays); 
    920         backData.mPvs = (float)EvalPvsEntriesSize(*backData.mRays); 
     922        frontData.mPvs = sc.mFrontPvs;//(float)EvalPvsEntriesSize(*frontData.mRays); 
     923        backData.mPvs = sc.mBackPvs;//(float)EvalPvsEntriesSize(*backData.mRays); 
    921924         
    922925        //-- compute pvs correction for coping with undersampling 
     
    934937 
    935938        //-- compute render cost 
    936         frontData.mRenderCost = (float)EvalPvsCost(*frontData.mRays); 
    937         backData.mRenderCost = (float)EvalPvsCost(*backData.mRays); 
     939        frontData.mRenderCost = sc.mFrontRenderCost;//(float)EvalPvsCost(*frontData.mRays); 
     940        backData.mRenderCost = sc.mBackRenderCost;//(float)EvalPvsCost(*backData.mRays); 
    938941         
    939942        frontData.mCorrectedRenderCost = sc.mCorrectedFrontRenderCost; 
     
    12751278        const float maxBand = minBox + mMaxBand * sizeBox; 
    12761279 
     1280        // sort by the current dimension 
    12771281        SortSubdivisionCandidates(usedRays, axis, minBand, maxBand); 
    12781282 
     
    15891593        sc.mCorrectedBackRenderCost = mHierarchyManager->EvalCorrectedPvs(pvsBack, penaltyOld, avgRayContri); 
    15901594 
     1595        sc.mFrontRenderCost = pvsFront; 
     1596        sc.mBackRenderCost = pvsBack; 
     1597 
    15911598        const float oldRenderCost = pOverall * penaltyOld; 
    15921599        const float newRenderCost = sc.mCorrectedFrontRenderCost * pFront +  
     
    17271734 
    17281735        const float renderCost = countEntries ? 1 :  
    1729                 mHierarchyManager->mBvHierarchy->EvalAbsCost(leaf->mObjects); 
     1736                mBvHierarchy->EvalAbsCost(leaf->mObjects); 
    17301737         
    17311738        // leaf in no pvs => new 
     
    22862293        case HierarchyManager::BV_BASED_OBJ_SUBDIV: 
    22872294                { 
    2288                         BvhLeaf *bvhleaf = mHierarchyManager->mBvHierarchy->GetLeaf(obj); 
     2295                        BvhLeaf *bvhleaf = mBvHierarchy->GetLeaf(obj); 
    22892296 
    22902297                        if (!bvhleaf->Mailed()) 
     
    29012908        VspSubdivisionCandidate::sVspTree = this; 
    29022909         
     2910        mBvHierarchy = mHierarchyManager->mBvHierarchy; 
     2911 
    29032912        // initialise termination criteria 
    29042913        mTermMinProbability *= mBoundingBox.GetVolume(); 
     
    29692978        case HierarchyManager::BV_BASED_OBJ_SUBDIV: 
    29702979                { 
    2971                         BvhLeaf *leaf = mHierarchyManager->mBvHierarchy->GetLeaf(obj); 
     2980                        BvhLeaf *leaf = mBvHierarchy->GetLeaf(obj); 
    29722981 
    29732982                        if (!leaf->Mailed()) 
     
    30493058        case HierarchyManager::BV_BASED_OBJ_SUBDIV: 
    30503059                { 
    3051                         BvhLeaf *leaf = mHierarchyManager->mBvHierarchy->GetLeaf(obj); 
     3060                        BvhLeaf *leaf = mBvHierarchy->GetLeaf(obj); 
    30523061 
    30533062                        if (-- leaf->mCounter == 0) 
     
    30983107        case HierarchyManager::BV_BASED_OBJ_SUBDIV: 
    30993108                { 
    3100                         BvhLeaf *leaf = mHierarchyManager->mBvHierarchy->GetLeaf(obj); 
     3109                        BvhLeaf *leaf = mBvHierarchy->GetLeaf(obj); 
    31013110 
    31023111                        if (!leaf->Mailed()) 
     
    31513160        case HierarchyManager::BV_BASED_OBJ_SUBDIV: 
    31523161                { 
    3153                         BvhLeaf *leaf = mHierarchyManager->mBvHierarchy->GetLeaf(obj); 
     3162                        BvhLeaf *leaf = mBvHierarchy->GetLeaf(obj); 
    31543163                        if (!leaf->Mailed()) 
    31553164                        { 
     
    31983207                case HierarchyManager::BV_BASED_OBJ_SUBDIV: 
    31993208                { 
    3200                         BvhLeaf *leaf = mHierarchyManager->mBvHierarchy->GetLeaf(obj); 
     3209                        BvhLeaf *leaf = mBvHierarchy->GetLeaf(obj); 
    32013210                        UpdateContributionsToPvs(leaf, cf, frontPvs, backPvs, totalPvs, false); 
    32023211                        break; 
     
    32273236        case HierarchyManager::BV_BASED_OBJ_SUBDIV: 
    32283237                { 
    3229                         BvhLeaf *leaf = mHierarchyManager->mBvHierarchy->GetLeaf(obj); 
     3238                        BvhLeaf *leaf = mBvHierarchy->GetLeaf(obj); 
    32303239                        UpdateContributionsToPvs(leaf, cf, pvsFront, pvsBack, totalPvs, true); 
    32313240                        break; 
     
    32693278        case HierarchyManager::BV_BASED_OBJ_SUBDIV: 
    32703279                { 
    3271                         BvhLeaf *bvhleaf = mHierarchyManager->mBvHierarchy->GetLeaf(obj); 
     3280                        BvhLeaf *bvhleaf = mBvHierarchy->GetLeaf(obj); 
    32723281 
    32733282                        if (!bvhleaf->Mailed()) 
Note: See TracChangeset for help on using the changeset viewer.