Changeset 2071


Ignore:
Timestamp:
02/01/07 14:42:05 (17 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/scripts/generate_viewcells.env

    r2070 r2071  
    1212 
    1313Preprocessor { 
    14 samplesPerPass 3000000 
     14        samplesPerPass 3000000 
    1515        useGlRenderer false 
    1616        type vss 
     
    1919        loadMeshes false 
    2020        # internal raycaster 
    21         rayCastMethod 0 
     21#       rayCastMethod 0 
    2222        # intel raycaster 
    23 #       rayCastMethod 1 
     23        rayCastMethod 1 
    2424        exportVisibility false 
    2525        loadKdTree false 
     
    190190VspBspTree { 
    191191        Construction { 
    192                 samples 200000 
     192                samples 2000000 
    193193                epsilon 0.0000001 
    194194                randomize false 
  • GTP/trunk/Lib/Vis/Preprocessing/src/InternalRayCaster.cpp

    r2070 r2071  
    201201#endif 
    202202 
     203        AxisAlignedBox3 ebox = sbox; 
     204        ebox.Enlarge(Vector3(1e-3f)); 
     205 
    203206        SimpleRayContainer::const_iterator sit, sit_end = rays.end(); 
    204207 
     
    207210        { 
    208211                CastRay(*sit, vssRays, sbox, castDoubleRays, pruneInvalidRays); 
    209                 if (!vssRays.empty() && (!vssRays.back() || !sbox.IsInside(*vssRays.back()))) 
     212                if (!vssRays.empty() && (!vssRays.back() || !ebox.IsInside(*vssRays.back()))) 
    210213                cout << "error " << *vssRays.back()<<endl; 
    211214        } 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Mutation.cpp

    r2063 r2071  
    473473  static Vector3 shifts[packetSize]; 
    474474  // mutate the  
    475   float alpha = RandomValue(0.0f, 2.0f*M_PI); 
     475  float alpha = RandomValue(0.0f, Real(2.0*M_PI)); 
    476476  //float alpha = vr2.x*2.0f*M_PI; 
    477477   
  • GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h

    r2066 r2071  
    712712template <typename T, typename S> 
    713713float Pvs<T, S>::AddSample(T sample, const float pdf) 
    714 {cout << "t"; 
     714{ 
    715715        ++ mSamples; 
    716716         
  • GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp

    r2069 r2071  
    205205bool SpatialBoxBasedDistribution::GenerateSample(SimpleRay &ray) 
    206206{ 
     207                Vector3 origin, direction;  
     208 
     209        mPreprocessor.mViewCellsManager->GetViewPoint(origin); 
     210        direction = mPreprocessor.mKdTree->GetBox().GetRandomPoint() - origin; 
     211        //cout << "z"; 
     212        const float c = Magnitude(direction); 
     213 
     214        if (c <= Limits::Small)  
     215                return false; 
     216 
     217        const float pdf = 1.0f; 
     218 
     219        direction *= 1.0f / c; 
     220        ray = SimpleRay(origin, direction, SPATIAL_BOX_BASED_DISTRIBUTION, pdf); 
     221 
     222        return true; 
     223 
     224        /* 
    207225  Vector3 origin, direction;  
    208226 
     
    226244  ray = SimpleRay(origin, direction, SPATIAL_BOX_BASED_DISTRIBUTION, pdf); 
    227245   
    228   return true; 
     246  return true;*/ 
    229247} 
    230248 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp

    r2066 r2071  
    265265                                                        float &contribution) 
    266266{  
    267         cout<<"e"; 
    268267        const bool result = mPvs.AddSample(sample, pdf);//, contribution); 
    269268        // have to recompute pvs size 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp

    r2069 r2071  
    36553655 
    36563656        /////////// 
    3657         //-- faster way of computing pvs: 
    3658         //-- construct merged pvs by adding 
    3659         //-- and only those of the next pvs which were not mailed. 
    3660         //-- note: sumpdf is not correct!! 
     3657        //-- merge pvss 
    36613658 
    36623659        vector<ObjectPvs>::iterator oit = pvsList.begin(); 
     
    36663663                ObjectPvsIterator pit = (*oit).GetIterator(); 
    36673664                 
    3668                 // first mark all object from this pvs 
     3665                // add pvss to new pvs: use mailing to avoid adding entries two times. 
    36693666                while (pit.HasMoreEntries()) 
    36703667                {                
     
    36773674                                intersect->Mail(); 
    36783675 
    3679                                 if (pvs.AddSampleDirtyCheck(intersect, entry.mData.mSumPdf)) 
    3680                                 { 
    3681                                         if (pvs.RequiresResort()) 
    3682                                         { 
    3683                                                 pvs.SimpleSort(); 
    3684                                         } 
    3685                                 } 
    3686                                  
     3676                                pvs.AddSampleDirty(intersect, entry.mData.mSumPdf); 
    36873677                        } 
    36883678                } 
    36893679        } 
     3680 
     3681        if (0) pvs.Sort(); 
    36903682 
    36913683        // store pvs in this node 
     
    36993691         
    37003692#else  
    3701         // really merge cells: slow put sumPdf is correct 
     3693        // really merge cells: slow but sumPdf is correct 
    37023694        viewCellInterior->GetPvs().Merge(backVc->GetPvs()); 
    37033695        viewCellInterior->GetPvs().Merge(frontVc->GetPvs()); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp

    r2063 r2071  
    912912                } 
    913913                if (attrName == "pvs")  
    914                 {//cout <<"e"; 
     914                { 
    915915                        StrX attrValue(attributes.getValue(i)); 
    916916                        const char *ptr = attrValue.LocalForm(); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp

    r2070 r2071  
    2727#define COUNT_ORIGIN_OBJECTS 1 
    2828 
    29 #define STORE_PVS 0 
     29#define STORE_PVS 1 
    3030 
    3131 
     
    959959                EvalSubdivisionCandidate(backCandidate); 
    960960         
    961                 cout << "f cost: " << frontCandidate.mPriority << endl; 
    962                 cout << "b cost: " << backCandidate.mPriority << endl; 
     961                cout << "f cost: " << frontCandidate.mPriority << " " << frontCandidate.mRenderCostDecr << endl; 
     962                cout << "b cost: " << backCandidate.mPriority << " " << backCandidate.mRenderCostDecr << endl; 
    963963                tQueue.push(frontCandidate); 
    964964                tQueue.push(backCandidate); 
     
    12731273                if (ray->mTerminationObject)  
    12741274                { 
    1275                         cout << "m"; 
     1275                        //cout << "m"; 
    12761276                        if (vc->AddPvsSample(ray->mTerminationObject, ray->mPdf, contribution)) 
    12771277                                madeContrib = true; 
Note: See TracChangeset for help on using the changeset viewer.