Changeset 2727


Ignore:
Timestamp:
05/30/08 03:47:56 (16 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/scripts/run_gvs_vps.sh

    r2726 r2727  
    4242-gvs_total_samples=1000000 \ 
    4343-gvs_samples_per_pass=1000000 \ 
    44 -gvs_initial_samples=2000 \ 
     44-gvs_initial_samples=50 \ 
    4545-gvs_max_viewcells=1 \ 
    46 -gvs_min_contribution=50 \ 
     46-gvs_min_contribution=500 \ 
    4747-gvs_per_viewcell=true \ 
    4848-preprocessor_detect_empty_viewspace+ \ 
  • GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp

    r2726 r2727  
    15731573        int i = 0; 
    15741574 
    1575         // $ tmp matt: somehow this is not properly initialised 
    1576         ClearErrorBuffer(); 
    1577         cout << "here4 " << mPvsErrorBuffer.size() << endl; 
     1575        // $matt tmp: somehow this is not properly initialised 
     1576        //ClearErrorBuffer(); 
     1577         
    15781578        for (sit = viewPoints.begin(); sit != sit_end; ++ sit, ++ i)  
    15791579        { 
  • GTP/trunk/Lib/Vis/Preprocessing/src/GtpVisibility05.vcproj

    r2720 r2727  
    770770                                </File> 
    771771                                <File 
    772                                         RelativePath=".\IntelRayCaster.h" 
    773                                         > 
    774                                 </File> 
    775                                 <File 
    776                                         RelativePath=".\InternalRayCaster.h" 
    777                                         > 
    778                                 </File> 
    779                                 <File 
    780772                                        RelativePath=".\Intersectable.h" 
    781773                                        > 
     
    855847                                <File 
    856848                                        RelativePath=".\Ray.h" 
    857                                         > 
    858                                 </File> 
    859                                 <File 
    860                                         RelativePath=".\RayCaster.h" 
    861849                                        > 
    862850                                </File> 
     
    988976                                </File> 
    989977                                <File 
    990                                         RelativePath=".\IntelRayCaster.cpp" 
    991                                         > 
    992                                 </File> 
    993                                 <File 
    994                                         RelativePath=".\InternalRayCaster.cpp" 
    995                                         > 
    996                                 </File> 
    997                                 <File 
    998978                                        RelativePath=".\Intersectable.cpp" 
    999979                                        > 
     
    10521032                                </File> 
    10531033                                <File 
    1054                                         RelativePath=".\RayCaster.cpp" 
    1055                                         > 
    1056                                 </File> 
    1057                                 <File 
    10581034                                        RelativePath=".\RayInfo.cpp" 
    10591035                                        > 
     
    11321108                                </File> 
    11331109                        </Filter> 
     1110                </Filter> 
     1111                <Filter 
     1112                        Name="raycaster" 
     1113                        > 
     1114                        <File 
     1115                                RelativePath=".\IntelRayCaster.cpp" 
     1116                                > 
     1117                        </File> 
     1118                        <File 
     1119                                RelativePath=".\IntelRayCaster.h" 
     1120                                > 
     1121                        </File> 
     1122                        <File 
     1123                                RelativePath=".\InternalRayCaster.cpp" 
     1124                                > 
     1125                        </File> 
     1126                        <File 
     1127                                RelativePath=".\InternalRayCaster.h" 
     1128                                > 
     1129                        </File> 
     1130                        <File 
     1131                                RelativePath=".\RayCaster.cpp" 
     1132                                > 
     1133                        </File> 
     1134                        <File 
     1135                                RelativePath=".\RayCaster.h" 
     1136                                > 
     1137                        </File> 
    11341138                </Filter> 
    11351139        </Files> 
  • GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp

    r2726 r2727  
    425425        castTimer.Entry(); 
    426426        // cast single ray to check if a triangle was missed 
     427        // note: not efficient!! 
    427428        VssRay *newRay = mRayCaster->CastRay(sray, mViewCellsManager->GetViewSpaceBox(), !mPerViewCell); 
    428429        castTimer.Exit(); 
     
    433434        if (!newRay) return castRays; 
    434435 
     436        rayTimer.Entry(); 
     437 
    435438        // new triangle discovered? => add new ray to queue 
    436         rayTimer.Entry(); 
    437439        HandleRay(newRay); 
     440 
    438441        rayTimer.Exit(); 
    439  
    440  
    441442 
    442443#else 
     
    795796        castTimer.Exit(); 
    796797 
    797         mGvsStats.mReverseSamples += reverseRays.size(); 
     798        mGvsStats.mReverseSamples += (int)reverseRays.size(); 
    798799 
    799800        return true; 
     
    809810        simpleRays.clear(); 
    810811 
    811          
    812812        generationTimer.Entry(); 
     813 
    813814        ViewCellBorderBasedDistribution vcStrat(*this, mCurrentViewCell); 
    814     GenerateRays(numSamples, *mDistribution, simpleRays, sInvalidSamples); 
     815        GenerateRays(numSamples, *mDistribution, simpleRays, sInvalidSamples); 
     816 
    815817        generationTimer.Exit(); 
    816818 
    817         //cout << "sr: " << simpleRays.size() << endl; 
    818         // generate vss rays 
     819        // cast generated samples  
    819820        static VssRayContainer samples; 
    820821        samples.clear(); 
     
    823824        const bool pruneInvalidRays = true; 
    824825         
     826#if 0 
    825827        castTimer.Entry(); 
     828 
    826829        CastRays(simpleRays, samples, castDoubleRays, pruneInvalidRays); 
     830         
    827831        castTimer.Exit(); 
     832 
     833#else 
     834        static SimpleRayContainer jitteredRays; 
     835 
     836        for (size_t i = 0; i < simpleRays.size(); ++ i) 
     837        { 
     838                SimpleRay mainRay = simpleRays[i]; 
     839                 
     840                jitteredRays.clear(); 
     841                jitteredRays.push_back(mainRay); 
     842 
     843                generationTimer.Entry(); 
     844 
     845                GenerateJitteredRays(jitteredRays, mainRay, 15, 0); 
     846 
     847                generationTimer.Exit(); 
     848                castTimer.Entry(); 
     849 
     850                CastRays(jitteredRays, samples, castDoubleRays, pruneInvalidRays); 
     851 
     852                castTimer.Entry(); 
     853        } 
     854#endif 
    828855 
    829856        // add to ray queue 
     
    832859        initialTimer.Exit(); 
    833860 
    834         return (int)simpleRays.size(); 
     861        return (int)samples.size(); 
    835862} 
    836863 
     
    14341461        int oldContribution = 0; 
    14351462        int passSamples = 0; 
    1436         for (int i = 0; i < 0; ++ i) 
     1463 
     1464        for (int i = 0; i < 2; ++ i) 
    14371465                mGenericStats[i] = 0; 
    14381466 
     
    15581586                mGvsStats.mPvsCost = 0; // todo objectPvs.EvalPvsCost(); 
    15591587        } 
    1560         else if (0) // compute pvs kd nodes that intersect view cell 
    1561         { 
    1562                 ObjectContainer mykdobjects; 
    1563  
    1564                 // extract kd pvs 
    1565                 ObjectContainer::const_iterator it, it_end = mTrianglePvs.end(); 
    1566  
    1567                 for (it = mTrianglePvs.begin(); it != it_end; ++ it) 
    1568                 { 
    1569                         Intersectable *obj = *it; 
    1570                         // find intersecting objects not yet in pvs (i.e., only unmailed) 
    1571                         mKdTree->CollectKdObjects(obj->GetBox(), mykdobjects); 
    1572                 } 
    1573  
    1574                 // add pvs 
    1575                 it_end = mykdobjects.end(); 
    1576  
    1577                 for (it = mykdobjects.begin(); it != it_end; ++ it) 
    1578                 { 
    1579                         mCurrentViewCell->GetPvs().AddSampleDirty(*it, 1.0f); 
    1580                 } 
    1581  
    1582                 cout << "added " << (int)mykdobjects.size() << " new objects " << endl; 
    1583  
    1584                 mGvsStats.mPerViewCellPvs = mCurrentViewCell->GetPvs().GetSize(); 
    1585                 mGvsStats.mPvsCost = mCurrentViewCell->GetPvs().EvalPvsCost(); 
     1588        else 
     1589        { 
     1590                 if (0) // compute pvs kd nodes that intersect view cell 
     1591                 { 
     1592                         ObjectContainer mykdobjects; 
     1593 
     1594                         // extract kd pvs 
     1595                         ObjectContainer::const_iterator it, it_end = mTrianglePvs.end(); 
     1596 
     1597                         for (it = mTrianglePvs.begin(); it != it_end; ++ it) 
     1598                         { 
     1599                                 Intersectable *obj = *it; 
     1600                                 // find intersecting objects not yet in pvs (i.e., only unmailed) 
     1601                                 mKdTree->CollectKdObjects(obj->GetBox(), mykdobjects); 
     1602                         } 
     1603 
     1604                         // add pvs 
     1605                         it_end = mykdobjects.end(); 
     1606 
     1607                         for (it = mykdobjects.begin(); it != it_end; ++ it) 
     1608                         { 
     1609                                 mCurrentViewCell->GetPvs().AddSampleDirty(*it, 1.0f); 
     1610                         } 
     1611                  
     1612                         cout << "added " << (int)mykdobjects.size() << " new objects " << endl; 
     1613                 } 
     1614 
     1615                 mGvsStats.mPerViewCellPvs = mCurrentViewCell->GetPvs().GetSize(); 
     1616                 mGvsStats.mPvsCost = mCurrentViewCell->GetPvs().EvalPvsCost(); 
    15861617 
    15871618        } 
     
    16021633             << mGvsStats.mPvsCost << " pvs tri: " << mTrianglePvs.size() << endl; 
    16031634 
    1604         cout << "invalid samples ratio: " << (float)sInvalidSamples / mGvsStats.mPerViewCellSamples << endl; 
     1635        //cout << "invalid samples ratio: " << (float)sInvalidSamples / mGvsStats.mPerViewCellSamples << endl; 
    16051636 
    16061637        float rayTime = rayTimer.TotalTime(); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ObjectPvs.cpp

    r2723 r2727  
    3535 
    3636                // already processed node (=> objects already in pvs)? 
    37                 if (1)//!node->Mailed()) 
     37                //node->Mail(); 
     38                if (node->IsLeaf()) 
    3839                { 
    39                         //node->Mail(); 
    40                         if (node->IsLeaf()) 
     40                        KdLeaf *leaf = static_cast<KdLeaf *>(node); 
     41 
     42                        // Objects already accounted for can only be found among those 
     43                        // which are referenced in more than one leaf 
     44                        ObjectContainer::const_iterator oit, oit_end = leaf->mObjects.end(); 
     45 
     46                        for (oit = leaf->mObjects.begin(); oit != oit_end; ++ oit) 
    4147                        { 
    42                                 KdLeaf *leaf = static_cast<KdLeaf *>(node); 
    43 #if USE_MULTIPLE_OBJECTS                                 
    44                                 // add #objects exclusivly in this node 
    45                                 pvs += (int)(leaf->mObjects.size() - leaf->mMultipleObjects.size()); 
     48                                Intersectable *obj = *oit;                                               
    4649 
    47                                 // Objects already accounted for can only be found among those 
    48                                 // which are referenced in more than one leaf 
    49                                 ObjectContainer::const_iterator oit, oit_end = leaf->mMultipleObjects.end(); 
    50                                                  
    51                                 for (oit = leaf->mMultipleObjects.begin(); oit != oit_end; ++ oit) 
     50                                if (!obj->Mailed2()) 
    5251                                { 
    53                                         Intersectable *obj = *oit;                                               
    54                              
    55                                         if (1)//!obj->Mailed()) 
    56                                         { 
    57                                                 //obj->Mail(); 
    58                                                 if (dummyPvs.AddSample(obj)) 
    59                                                         ++ pvs; 
    60                                         } 
     52                                        //if (dummyPvs.AddSample(obj, 1.0f))++ pvs; 
     53                                        obj->Mail2(); 
     54                                        ++ pvs; 
    6155                                } 
    62 #else 
     56                        } 
     57                } 
     58                else // traverse tree 
     59                { 
     60                        KdInterior *interior = static_cast<KdInterior *>(node); 
    6361 
    64                                 // Objects already accounted for can only be found among those 
    65                                 // which are referenced in more than one leaf 
    66                                 ObjectContainer::const_iterator oit, oit_end = leaf->mObjects.end(); 
    67                                  
    68                                 for (oit = leaf->mObjects.begin(); oit != oit_end; ++ oit) 
    69                                   { 
    70                                         Intersectable *obj = *oit;                                               
    71                                          
    72                                         if (!obj->Mailed2()) 
    73                                           { 
    74                                                   //if (dummyPvs.AddSample(obj, 1.0f))++ pvs; 
    75                                                   obj->Mail2(); 
    76                                                   ++pvs; 
    77                                           } 
    78                                   } 
    79                                  
    80 #endif 
    81                         } 
    82                         else // traverse tree 
    83                         { 
    84                                 KdInterior *interior = static_cast<KdInterior *>(node); 
    85  
    86                                 tStack.push(interior->mFront); 
    87                                 tStack.push(interior->mBack); 
    88                         } 
     62                        tStack.push(interior->mFront); 
     63                        tStack.push(interior->mBack); 
    8964                } 
    9065        } 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ReverseGvs.cpp

    r2686 r2727  
    411411 
    412412        if (counter < 50) { 
    413           sprintf(filename, "reverse_rays_%03d.x3d", counter++); 
     413          sprintf_s(filename, "reverse_rays_%03d.x3d", counter++); 
    414414           
    415415          VssRay tRay(origin, termination, NULL, NULL); 
     
    454454Vector3 
    455455ReverseGvs::ComputeSilhouetteTerminationMutation(const VssRay &ray, 
    456                                                                                                                                 const Vector3 &origin, 
    457                                                                                                                                 const AxisAlignedBox3 &box, 
    458                                                                                                                                 const Vector3 &U, 
    459                                                                                                                                 const Vector3 &V, 
    460                                                                                                                                 const float radius 
    461                                                                                                                                 ) 
     456                                                                                                 const Vector3 &origin, 
     457                                                                                                 const AxisAlignedBox3 &box, 
     458                                                                                                 const Vector3 &U, 
     459                                                                                                 const Vector3 &V, 
     460                                                                                                 const float radius 
     461                                                                                                 ) 
    462462{ 
    463463#ifdef GTP_INTERNAL 
Note: See TracChangeset for help on using the changeset viewer.