Changeset 1180


Ignore:
Timestamp:
08/03/06 09:11:06 (18 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis
Files:
5 edited

Legend:

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

    r1179 r1180  
    48844884 
    48854885        VssRayContainer::const_iterator vit, vit_end = constructionRays.end(); 
     4886 
    48864887        for (vit = constructionRays.begin(); vit != vit_end; ++ vit) 
    48874888        { 
     
    49014902 
    49024903        cout << "Computing remaining ray contributions ... "; 
    4903  
    49044904 
    49054905        // recast rest of rays 
     
    56885688                                        else 
    56895689                                        { 
    5690                                                 /// get current leaf the point 
     5690                                                // get current leaf the point is located in 
    56915691                                                KdLeaf *leaf = mOspTree->GetLeaf(ray.mTermination); 
    56925692                                                KdIntersectable *entry = mOspTree->GetOrCreateKdIntersectable(leaf); 
     
    57265726} 
    57275727 
    5728 #if 0 
     5728#if 1 
    57295729void VspOspViewCellsManager::EvalViewCellPartition() 
    57305730{ 
    57315731        int samplesPerPass; 
    57325732        int numSamples; 
    5733         int castSamples = 0; 
     5733        int castSamples = (int)storedRays.size(); 
    57345734 
    57355735        char s[64];  
    5736  
    5737         Environment::GetSingleton()->GetIntValue("ViewCells.Evaluation.samplesPerPass", samplesPerPass); 
    5738         Environment::GetSingleton()->GetIntValue("ViewCells.Evaluation.samples", numSamples); 
    5739  
    57405736        char statsPrefix[100]; 
     5737 
    57415738        Environment::GetSingleton()->GetStringValue("ViewCells.Evaluation.statsPrefix", statsPrefix); 
    57425739 
    5743         Debug << "view cell evaluation samples per pass: " << samplesPerPass << endl; 
    5744         Debug << "view cell evaluation samples: " << numSamples << endl; 
    57455740        Debug << "view cell stats prefix: " << statsPrefix << endl; 
    57465741 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h

    r1179 r1180  
    10111011 
    10121012protected: 
    1013 #if 0 
     1013 
     1014#if 1 
    10141015        virtual void EvalViewCellPartition(); 
    10151016#endif 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp

    r1179 r1180  
    606606        float sampCon = 0.0f; 
    607607 
    608         //-- update pvs 
    609608        if (updatePvs) 
    610609        { 
     610                //-- update pvs of view cell 
    611611                AddSamplesToPvs(leaf, *tData.mRays, sampCon, conSamp); 
    612612 
     
    715715                float sampCon = 0.0f; 
    716716 
    717  
     717#if 0 
    718718                //-- store pvs optained from rays 
     719 
    719720                AddSamplesToPvs(leaf, *tData.mRays, sampCon, conSamp); 
    720721 
     
    725726                mVspStats.contributingSamples += conSamp; 
    726727                mVspStats.sampleContributions += (int)sampCon; 
    727  
     728#endif 
    728729                //-- store additional info 
    729730                if (mStoreRays) 
     
    974975 
    975976void VspTree::AddSamplesToPvs(VspLeaf *leaf, 
    976                                                          const RayInfoContainer &rays, 
    977                                                          float &sampleContributions, 
    978                                                          int &contributingSamples) 
     977                                                          const RayInfoContainer &rays, 
     978                                                          float &sampleContributions, 
     979                                                          int &contributingSamples) 
    979980{ 
    980981        sampleContributions = 0; 
     
    29402941        mBoundingBox = kdTree.GetBox(); 
    29412942        mRoot = kdTree.GetRoot(); 
     2943 
    29422944        mSplitCandidates = new vector<SortableEntry>; 
    29432945} 
     
    29462948OspTree::~OspTree() 
    29472949{ 
     2950        // delete kd intersectables 
    29482951        KdIntersectableMap::iterator it, it_end = mKdIntersectables.end(); 
    29492952 
     
    34783481 
    34793482        const float oldRenderCost = (float)totalPvs * totalVol + Limits::Small; 
    3480         const float newRenderCost =  
    3481                 (float)pvsFront * volFront +  
    3482                 (float)pvsBack * volBack + 
    3483                 (float)totalPvs * frontAndBackVol; 
     3483        const float newRenderCost = (float)pvsFront * volFront +  
     3484                                                                (float)pvsBack * volBack + 
     3485                                                                (float)totalPvs * frontAndBackVol; 
    34843486 
    34853487 
     
    44924494 
    44934495 
     4496float OspTree::EvalViewCellsVolume(const RayInfoContainer &rays) const 
     4497{ 
     4498        float vol = 0; 
     4499        ViewCell::NewMail(); 
     4500 
     4501        RayInfoContainer::const_iterator rit, rit_end = rays.end(); 
     4502 
     4503        for (rit = rays.begin(); rit != rays.end(); ++ rit) 
     4504        { 
     4505                VssRay *ray = (*rit).mRay; 
     4506 
     4507                if (!ray->mTerminationObject && !ray->mOriginObject) 
     4508                        continue; 
     4509                 
     4510                ViewCellContainer viewCells; 
     4511                mVspTree->CastLineSegment(ray->mOrigin, ray->mTermination, viewCells); 
     4512 
     4513                ViewCellContainer::const_iterator vit, vit_end = viewCells.end(); 
     4514                         
     4515                for (vit = viewCells.begin(); vit != vit_end; ++ vit) 
     4516                { 
     4517                        ViewCell *vc = *vit; 
     4518 
     4519                        if (!vc->Mailed()) 
     4520                        { 
     4521                                vc->Mail(); 
     4522                                vol += vc->GetVolume(); 
     4523                        } 
     4524                }                
     4525        } 
     4526 
     4527        return vol; 
     4528} 
     4529 
    44944530 
    44954531/********************************************************************/ 
     
    46324668        mOspTree.EvalSplitCandidate(*oSplitCandidate); 
    46334669 
    4634         mOspTree.mTotalCost = (float)objects.size(); 
     4670        const float vol = mOspTree.EvalViewCellsVolume(rays); 
     4671 
     4672        mOspTree.mTotalCost = (float)objects.size() * vol; 
    46354673        mOspTree.EvalSubdivisionStats(*oSplitCandidate); 
    46364674 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.h

    r1178 r1180  
    14061406 
    14071407 
    1408         /** Compute "pvs size of this object container 
    1409                 @ note bot relly pvs size just weighted sum of object taking their 
     1408        /** Compute "pvs size" of this object container 
     1409                @note not really pvs size just weighted sum of object taking their 
    14101410                appearances in pvss into account 
    14111411        */ 
     
    17041704                float &volRight); 
    17051705 
     1706        float EvalViewCellsVolume(const RayInfoContainer &rays) const; 
     1707 
     1708 
    17061709protected: 
    17071710 
Note: See TracChangeset for help on using the changeset viewer.