Ignore:
Timestamp:
01/23/08 03:20:29 (16 years ago)
Author:
bittner
Message:

GetPvsCost? changed, APplyFilter2 collects small kdnodes

Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
10 edited

Legend:

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

    r2629 r2635  
    1818#include "RayCaster.h" 
    1919#include "tgaimg.h" 
     20 
    2021 
    2122#ifdef USE_HAVRAN_RAYCASTER 
  • GTP/trunk/Lib/Vis/Preprocessing/src/HavranRayCaster.cpp

    r2629 r2635  
    243243#endif 
    244244 
    245 #if 0 
     245#if 1 
    246246  // This is shooting ray by ray 
    247247  SimpleRayContainer::const_iterator sit, sit_end = rays.end(); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ObjectPvs.cpp

    r2606 r2635  
    1010#include "BvHierarchy.h" 
    1111 
     12// $$ switched off by JB for testing 
     13#define USE_MULTIPLE_OBJECTS  0 
    1214using namespace std; 
    1315 
     
    3840                        { 
    3941                                KdLeaf *leaf = static_cast<KdLeaf *>(node); 
    40                         
     42#if USE_MULTIPLE_OBJECTS                                 
    4143                                // add #objects exclusivly in this node 
    4244                                pvs += (int)(leaf->mObjects.size() - leaf->mMultipleObjects.size()); 
     
    5658                                        } 
    5759                                } 
     60#else 
     61 
     62                                // Objects already accounted for can only be found among those 
     63                                // which are referenced in more than one leaf 
     64                                ObjectContainer::const_iterator oit, oit_end = leaf->mObjects.end(); 
     65                                 
     66                                for (oit = leaf->mObjects.begin(); oit != oit_end; ++ oit) 
     67                                  { 
     68                                        Intersectable *object = *oit;                                            
     69                                         
     70                                        if (!object->Mailed()) 
     71                                          { 
     72                                                object->Mail(); 
     73                                                ++ pvs; 
     74                                          } 
     75                                  } 
     76                                 
     77#endif 
    5878                        } 
    5979                        else // traverse tree 
    60                         { 
     80                          { 
    6181                                KdInterior *interior = static_cast<KdInterior *>(node); 
    6282 
  • GTP/trunk/Lib/Vis/Preprocessing/src/PvsDefinitions.h

    r2634 r2635  
    99//$$ 19.1. 2008 test for speed 
    1010//#define USE_BIT_PVS 
    11 #define USE_HASH_PVS 
     11//#define USE_HASH_PVS 
    1212 
    1313 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp

    r2634 r2635  
    152152        if (!evaluateFilter)  
    153153          pvs = viewcell->GetPvs(); 
    154         else  
     154        else { 
     155 
    155156          mViewCellsManager->ApplyFilter2(viewcell, 
    156157                                                                          false, 
    157158                                                                          mViewCellsManager->GetFilterWidth(), 
    158159                                                                          pvs); 
     160        } 
    159161 
    160162        mUseForcedColors = true; 
     
    516518                                //mMutex.lock(); 
    517519                                // mSpatialFilter size is in range 0.001 - 0.1 
    518                                 mViewCellsManager->ApplyFilter2(viewcell, 
     520                          mViewCellsManager->ApplyFilter2(viewcell, 
    519521                                                                    mUseFilter, 
    520522                                                                    100.0f * mSpatialFilterSize, 
  • GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.cpp

    r2629 r2635  
    99namespace GtpVisibilityPreprocessor { 
    1010 
     11 
     12#define DEBUG_PROCESS_RAY 0 
    1113 
    1214#define DEBUG_RAYCAST 0 
     
    412414        { 
    413415          if (!hitA.mObject && !hitB.mObject) { 
     416#if DEBUG_PROCESS_RAY 
     417                cout<<"I1 "; 
     418#endif 
    414419                return 0; 
    415420          } 
     
    419424        // rays whic degenerate to a point 
    420425        if (EpsilonEqualV3(hitA.mPoint, hitB.mPoint, Limits::Small)) { 
     426#if DEBUG_PROCESS_RAY 
     427                cout<<"I2 "; 
     428#endif 
    421429          return 0; 
    422430        } 
     
    435443          if (0 || pruneInvalidRays) 
    436444                return 0; 
    437            
     445 
     446#if DEBUG_PROCESS_RAY 
     447                cout<<"I2 "; 
     448#endif 
     449 
    438450          // reset both contributions of this ray 
    439451          hitA.mObject = NULL; 
     
    459471                                                          hitB.mPoint, 
    460472                                                          clipA, 
    461                                                           clipB)) 
     473                                                          clipB)) { 
     474#if DEBUG_PROCESS_RAY 
     475                cout<<"I3 "; 
     476#endif 
     477 
    462478                return 0; 
     479          } 
    463480 
    464481          if (!pruneInvalidRays || hitA.mObject) { 
  • GTP/trunk/Lib/Vis/Preprocessing/src/SamplingPreprocessor.cpp

    r2130 r2635  
    141141                if (vssRays[j]->mFlags & VssRay::Valid) { 
    142142                  Intersectable *obj = vssRays[j]->mTerminationObject; 
    143                    
    144143                  if (obj) { 
    145144                        // if ray not outside of view space 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp

    r2634 r2635  
    32063206                                                           ) 
    32073207{ 
    3208         pvs.Reserve(viewCell->GetFilteredPvsSize()); 
    3209  
     3208 
     3209   
     3210  pvs.Reserve(viewCell->GetFilteredPvsSize()); 
     3211         
    32103212        PvsFilterStatistics stats; 
    32113213 
     
    33693371                        // $$ warning collect objects takes only unmailed ones! 
    33703372                        if (mUseKdPvs) { 
    3371                           GetPreprocessor()->mKdTree->CollectKdObjects(box, objects); 
    3372                           //GetPreprocessor()->mKdTree->CollectSmallKdObjects(box, objects, 0.02f); 
     3373                          //                      GetPreprocessor()->mKdTree->CollectKdObjects(box, objects); 
     3374                          GetPreprocessor()->mKdTree->CollectSmallKdObjects(box, objects, 0.02f); 
    33733375 
    33743376                        } else 
     
    34073409        viewCell->SetFilteredPvsSize(pvs.GetSize()); 
    34083410 
     3411        //      cout<<"pvsCost="<<basePvs.EvalPvsCost()<<endl; 
     3412        //      cout<<"fPvsCost="<<pvs.EvalPvsCost()<<endl; 
     3413 
     3414         
    34093415        // warning: not thread-safe! 
    34103416        if (!mUseKdPvs) 
  • GTP/trunk/Lib/Vis/Preprocessing/src/default.env

    r2629 r2635  
    558558  #rayCastMethod 1 
    559559  # Havran - 2 - static scene 
    560   rayCastMethod 2 
     560  # rayCastMethod 2 
    561561  # Havran - 3 - dynamic scene 
    562   rayCastMethod 3 
     562  # rayCastMethod 3 
    563563 
    564564  loadMeshes false 
  • GTP/trunk/Lib/Vis/Preprocessing/src/run_test2

    r2634 r2635  
    44 
    55#COMMAND="./release/preprocessor.exe -preprocessor_quit_on_finish+" 
    6 COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish- -preprocessor_use_gl_renderer+ -preprocessor_evaluate_filter- -samples_per_evaluation=5000000 -samples_per_pass=500000 -total_samples=20000000 -mutation_use_pass_importance- -mutation_silhouette_search_steps=3 -preprocessor_ray_cast_method=2 -preprocessor_detect_empty_viewspace-" 
     6COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish- -preprocessor_use_gl_renderer+ -preprocessor_evaluate_filter- -samples_per_evaluation=5000000 -samples_per_pass=1000000 -total_samples=20000000 -mutation_use_pass_importance- -mutation_silhouette_search_steps=3 -preprocessor_ray_cast_method=1 -preprocessor_detect_empty_viewspace+" 
    77 
    88#SCENE="../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d;../data/vienna/vienna-roads.x3d" 
     
    2929#VIEWCELLS=../data/test1/test-viewcells.xml 
    3030 
    31 SCENE=../data/Arena/arena-high-lods.obj 
    32 VIEWCELLS=../data/Arena/arena-high-lods-5000-viewcells.xml.gz 
     31#SCENE=../data/Arena/arena-high-lods.obj 
     32#VIEWCELLS=../data/Arena/arena-high-lods-5000-viewcells.xml.gz 
    3333#VIEWCELLS=../data/Arena/viewcells-5000.xml.gz 
    3434#VIEWCELLS=../data/Arena/arena-high-lods-57000-viewcells.xml.gz 
    3535 
    3636 
    37 #SCENE=../data/vienna/vienna_cropped.obj 
    38 #VIEWCELLS=../data/vienna/vienna_cropped-gradient-viewcells.xml.gz 
     37SCENE=../data/vienna/vienna_cropped.obj 
     38VIEWCELLS=../data/vienna/vienna_cropped-gradient-viewcells.xml.gz 
    3939 
    4040#VIEWCELLS=../data/vienna/vienna-sequential-30000-single-viewcell.xml 
Note: See TracChangeset for help on using the changeset viewer.