Changeset 578


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

added upper and lower boundary for pvs penalty in heuristics

Location:
trunk/VUT/GtpVisibilityPreprocessor
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/scripts/default.env

    r577 r578  
    2323        useGlRenderer false 
    2424#       type sampling 
    25 #       type vss 
    26         type rss 
     25        type vss 
     26#       type rss 
    2727        detectEmptyViewSpace false 
    2828} 
     
    176176        # samples used for view cell construction 
    177177        Construction { 
    178                 samples 500000 
    179                 samplesPerPass 50000 
     178                samples 1500000 
     179                samplesPerPass 40000 
    180180        } 
    181181 
    182182        exportToFile false 
    183         loadFromFile true 
     183        loadFromFile false 
    184184 
    185185        #type kdTree 
     
    271271VspBspTree { 
    272272        Construction { 
    273                 samples 90000 
     273                samples 900000 
    274274                epsilon 0.005 
    275275                randomize false 
     
    315315                #maxAccRayLength        100 
    316316                 
    317                 maxViewCells            500 
     317                maxViewCells            5000 
    318318                 
    319319                # used for pvs criterium 
     
    336336        PostProcess { 
    337337                maxCostRatio 0.1 
    338                 minViewCells 5000 
     338                minViewCells 110 
    339339                useRaysForMerge false 
    340340                exportMergeStats false 
  • 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 
  • trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.h

    r574 r578  
    763763class BspMergeCandidate 
    764764 
     765        friend class VspBspTree; 
     766 
    765767public: 
    766768 
     
    807809        static bool sUseArea; 
    808810 
     811        static int sUpperPvsLimit; 
     812        static int sLowerPvsLimit; 
     813 
     814protected: 
     815 
     816         
    809817        /** Evaluates the merge costs of the leaves. 
    810818        */ 
    811819        void EvalMergeCost(); 
    812820 
    813 protected: 
     821        /** penalty for a given pvs size. 
     822        */ 
     823        inline float EvalPvsPenalty(int pvs) const; 
    814824 
    815825        /** Cost of a view cell. 
Note: See TracChangeset for help on using the changeset viewer.