Ignore:
Timestamp:
01/25/06 18:28:09 (18 years ago)
Author:
mattausch
Message:

added upper and lower boundary for pvs penalty in heuristics

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.cpp

    r576 r578  
    3838float BspMergeCandidate::sOverallCost = 0; 
    3939bool BspMergeCandidate::sUseArea = false; 
     40 
     41 
     42int BspMergeCandidate::sUpperPvsLimit = 120; 
     43int BspMergeCandidate::sLowerPvsLimit = 5; 
     44 
    4045 
    4146 
     
    400405                                                          geom); 
    401406 
    402         // first node is kd node 
    403         tData.mIsKdNode = true; 
     407        // first node is kd node, i.e. an axis aligned box 
     408        if (1) 
     409        tData.mIsKdNode = true; 
     410        else 
     411                tData.mIsKdNode = false; 
    404412 
    405413        tStack.push(tData); 
     
    13861394                { 
    13871395                        // try to equalize render differences 
    1388                         const float oldCost = pOverall * (float)totalPvs + Limits::Small; 
    1389                         float newCost = fabs(pvsFront * pFront - pvsBack * pBack); 
     1396                        //const float oldCost = pOverall * (float)totalPvs + Limits::Small; 
     1397                        //float newCost = fabs(pvsFront * pFront - pvsBack * pBack); 
     1398                        const float oldCost = pOverall + Limits::Small; 
     1399                        float newCost = (float)abs(pvsFront - pvsBack); 
    13901400 
    13911401                        cost += mPvsFactor * newCost / oldCost; 
     
    35233533 
    35243534 
     3535inline float BspMergeCandidate::EvalPvsPenalty(int pvs) const 
     3536{ 
     3537        // clamp to minmax values 
     3538        if (pvs > sUpperPvsLimit) 
     3539                return (float)sUpperPvsLimit; 
     3540        if (pvs < sLowerPvsLimit) 
     3541                return (float)sLowerPvsLimit; 
     3542 
     3543        return (float)pvs; 
     3544} 
     3545 
     3546 
    35253547void BspMergeCandidate::EvalMergeCost() 
    35263548{ 
     
    35323554        //const int newPvs = diff1 + vc1->GetPvs().GetSize(); 
    35333555        const int newPvs = ComputeMergedPvsSize(vc1->GetPvs(), vc2->GetPvs()); 
     3556        const float f = EvalPvsPenalty(newPvs); 
    35343557 
    35353558        //-- compute ratio of old cost 
Note: See TracChangeset for help on using the changeset viewer.