Ignore:
Timestamp:
02/08/06 15:05:04 (18 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r604 r605  
    6767mOutOfBoundsCell(NULL), 
    6868mStoreRays(false), 
    69 mRenderCostWeight(0.5) 
     69mRenderCostWeight(0.5), 
     70mUseRandomAxis(false) 
    7071{ 
    7172        bool randomize = false; 
     
    429430        tQueue.push(tData); 
    430431 
    431         mTotalCost = tData.GetCost() / mBox.GetVolume(); 
     432        mTotalCost = tData.mPvs * tData.mProbability / mBox.GetVolume(); 
    432433 
    433434        mSubdivisionStats  
    434                         << "#Leaves\n1\n" <<  endl 
     435                        << "#ViewCells\n1\n" <<  endl 
    435436                        << "#RenderCostDecrease\n0\n" << endl  
    436437                        << "#TotalRenderCost\n" << mTotalCost << endl; 
     
    528529                        if (1) 
    529530                        { 
     531                                float cFront = tFrontData.mPvs * tFrontData.mProbability; 
     532                                float cBack = tBackData.mPvs * tBackData.mProbability; 
     533                                float cData = tData.mPvs * tData.mProbability;; 
     534 
    530535                                float costDecr =  
    531                                         (tFrontData.GetCost() + tBackData.GetCost() - tData.GetCost()) / mBox.GetVolume(); 
     536                                        (cFront + cBack - cData) / mBox.GetVolume(); 
    532537                                mTotalCost += costDecr; 
    533538 
    534539                                mSubdivisionStats  
    535                                                 << "#Leaves\n" << mBspStats.Leaves() << endl 
     540                                                << "#ViewCells\n" << mBspStats.Leaves() << endl 
    536541                                                << "#RenderCostDecrease\n" << -costDecr << endl  
    537542                                                << "#TotalRenderCost\n" << mTotalCost << endl; 
     
    957962        } 
    958963 
    959         const int sAxis = box.Size().DrivingAxis(); 
     964        const int sAxis = mUseRandomAxis ? Random(3) : box.Size().DrivingAxis(); 
    960965 
    961966        for (axis = 0; axis < 3; ++ axis) 
Note: See TracChangeset for help on using the changeset viewer.