Changeset 2008


Ignore:
Timestamp:
01/21/07 23:05:34 (17 years ago)
Author:
bittner
Message:

ray sort update

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

Legend:

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

    r2002 r2008  
    6868 
    6969   
    70   bool mExportAnimation = false; 
    7170  vector<VssRayContainer> rayBuffer; 
    7271   
  • GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp

    r2006 r2008  
    19101910                                        "false");    
    19111911 
    1912    RegisterOption("Preprocessor.Export.rays", optBool, "export_rays=", "false"); 
    1913         RegisterOption("Preprocessor.Export.numRays", optInt, "export_num_rays=", "5000"); 
     1912   RegisterOption("Preprocessor.Export.rays", optBool, "export_rays", "false"); 
     1913   RegisterOption("Preprocessor.Export.animation", optBool, "export_animation", "false"); 
     1914   RegisterOption("Preprocessor.Export.numRays", optInt, "export_num_rays=", "5000"); 
    19141915    
    19151916        /*************************************************************************/ 
  • GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h

    r2002 r2008  
    174174        return mPvsStat.GetAvgError()*GetWidth()*GetHeight(); 
    175175  } 
     176 
     177  virtual float GetMaxPixelError() { 
     178        return mPvsStat.GetMaxError()*GetWidth()*GetHeight(); 
     179  } 
    176180   
    177181public: 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Makefile

    r2006 r2008  
    11############################################################################# 
    22# Makefile for building: preprocessor 
    3 # Generated by qmake (2.00a) (Qt 4.1.2) on: ne 21. I 01:18:19 2007 
     3# Generated by qmake (2.00a) (Qt 4.1.2) on: ne 21. I 22:47:46 2007 
    44# Project:  preprocessor.pro 
    55# Template: app 
     
    6363        $(MAKE) -f $(MAKEFILE).Debug uninstall 
    6464 
    65 Makefile: preprocessor.pro  C:/Qt/4.1.2/mkspecs/win32-msvc2005\qmake.conf C:/Qt/4.1.2/mkspecs/qconfig.pri \ 
     65Makefile: preprocessor.pro  C:/Qt/4.1.2/mkspecs/win32-msvc.net\qmake.conf C:/Qt/4.1.2/mkspecs/qconfig.pri \ 
    6666                C:\Qt\4.1.2\mkspecs\features\qt_config.prf \ 
    6767                C:\Qt\4.1.2\mkspecs\features\exclusive_builds.prf \ 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp

    r2005 r2008  
    167167 
    168168        Environment::GetSingleton()->GetBoolValue("Preprocessor.Export.rays", mExportRays); 
     169        Environment::GetSingleton()->GetBoolValue("Preprocessor.Export.animation", mExportAnimation); 
    169170        Environment::GetSingleton()->GetIntValue("Preprocessor.Export.numRays", mExportNumRays); 
    170  
    171171 
    172172        Environment::GetSingleton()->GetIntValue("Preprocessor.samplesPerPass", mSamplesPerPass); 
     
    12011201  const long t1 = GetTime(); 
    12021202 
    1203 #if 0 
     1203#if 1 
    12041204  mRayCaster->SortRays(rays); 
    12051205  cout<<"Rays sorted in "<<TimeDiff(t1, GetTime())<<" s."<<endl; 
    12061206 
    1207   if (1) { 
     1207  if (0) { 
    12081208        VssRayContainer tmpRays; 
    12091209        int m = 50000; 
     
    14031403  exporter->SetFilled(); 
    14041404  // $$JB temporarily do not export the scene 
    1405   if (1) 
     1405  if (0) 
    14061406        exporter->ExportScene(mSceneGraph->GetRoot()); 
    14071407  exporter->SetWireframe(); 
     
    14391439          "#AvgPvsRenderError\n" <<renderer->mPvsStat.GetAvgError()<<endl<< 
    14401440          "#AvgPixelError\n" <<renderer->GetAvgPixelError()<<endl<< 
     1441          "#MaxPixelError\n" <<renderer->GetMaxPixelError()<<endl<< 
    14411442          "#MaxPvsRenderError\n" <<renderer->mPvsStat.GetMaxError()<<endl<< 
    14421443          "#ErrorFreeFrames\n" <<renderer->mPvsStat.GetErrorFreeFrames()<<endl<< 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h

    r2003 r2008  
    235235 
    236236        bool mExportRays; 
     237        bool mExportAnimation; 
    237238        int mExportNumRays; 
    238239 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp

    r2002 r2008  
    120120   
    121121  SetupCamera(); 
    122   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 
     122  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); 
    123123  glColorMask(GL_FALSE, GL_TRUE, GL_FALSE, GL_FALSE); 
    124    
     124 
     125 
     126  glStencilFunc(GL_EQUAL, 0x0, 0x1); 
     127  glStencilOp(GL_KEEP, GL_KEEP, GL_INCR);  
    125128   
    126129  //    // Render PVS 
     
    137140  //    glColorMask(GL_TRUE, GL_FALSE, GL_FALSE, GL_FALSE); 
    138141  glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 
     142  glEnable(GL_STENCIL_TEST);  
    139143   
    140144  mUseFalseColors = true; 
     
    142146  OcclusionQuery *query = mOcclusionQueries[0]; 
    143147 
     148   
    144149  query->BeginQuery(); 
    145150   
     
    149154   
    150155  query->EndQuery(); 
    151    
     156  glDisable(GL_STENCIL_TEST);  
    152157  // reenable other state 
    153158  //  int wait=0; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/RayCaster.cpp

    r2002 r2008  
    163163  int i; 
    164164 
    165   // if (depth%4==0) 
     165  const int batchsize = 8192; 
     166 
     167  //  if (r - l < 32*batchsize) 
    166168  //    offset = 3; 
     169         
     170  //  if (depth%5==0) 
     171  //    offset = 3; 
    167172   
    168173  for (i=offset; i < offset + 3; i++) { 
     
    174179  } 
    175180 
    176   //  cout<<depth<<" "<<axis<<endl; 
     181  //  cout<<depth<<" "<<axis<<" "<<l<<" "<<r<<endl; 
    177182   
    178183  i=l; 
     
    182187  //  float x = rays[(l+r)/2].GetParam(axis); 
    183188  do { 
    184         while(rays[i].GetParam(axis) < x && i<=j) 
     189        while(i<j && rays[i].GetParam(axis) < x) 
    185190          i++; 
    186         while(x <= rays[j].GetParam(axis) && i<=j) 
     191        while(i<j && x < rays[j].GetParam(axis)) 
    187192          j--; 
    188193         
     
    193198        } 
    194199  } while (i<=j); 
    195    
    196   if (l + 4 < j ) { 
     200 
     201   
     202  if (l + batchsize < j ) { 
    197203        // set new max 
    198204        float save = box[axis+6]; 
     
    200206        _SortRays(rays, l, j, depth+1, box); 
    201207        box[axis+6] = save; 
     208  } else { 
     209        //      for (int k=0; k < 6; k++) 
     210        //        cout<<k<<" "<<box[k]<<" - "<<box[k+6]<<endl; 
    202211  } 
    203212   
    204   if (i + 4 < r) { 
     213  if (i + batchsize < r) { 
    205214        // set new min 
    206215        box[axis] = x; 
    207216    _SortRays(rays, i, r, depth+1, box); 
     217  } else { 
     218        //      for (int k=0; k < 6; k++) 
     219        //        cout<<k<<" "<<box[k]<<" - "<<box[k+6]<<endl; 
    208220  } 
     221         
    209222} 
    210223   
  • GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp

    r2004 r2008  
    653653                                        if (strcmp(curr, "mutation")==0) { 
    654654                                          // temp matt: still no mutationstrategy! 
    655                                           //mDistributions.push_back(new MutationBasedDistribution(mPreprocessor)); 
     655                                           
     656                                          mDistributions.push_back(new MutationBasedDistribution(mPreprocessor)); 
    656657                                        } 
    657658         
  • GTP/trunk/Lib/Vis/Preprocessing/src/default.env

    r2006 r2008  
    6262        detectEmptyViewSpace true 
    6363#       pvsRenderErrorSamples 0 
    64         pvsRenderErrorSamples 5000 
     64        pvsRenderErrorSamples 10000 
    6565        quitOnFinish false 
    6666        computeVisibility true 
     
    8383        } 
    8484        Export { 
    85                 rays true 
     85                rays false 
    8686                numRays 5000 
    8787        } 
  • GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp

    r2003 r2008  
    351351                        // $$matt 
    352352                        preprocessor->renderer =  
    353                                 new QtGlRendererBuffer(512, 512, 
     353                                new QtGlRendererBuffer(1024, 1024, 
    354354                                                                           preprocessor->mSceneGraph, 
    355355                                                                           preprocessor->mViewCellsManager, 
  • GTP/trunk/Lib/Vis/Preprocessing/src/run_test2

    r2006 r2008  
    22 
    33#COMMAND="./release/preprocessor.exe -preprocessor_quit_on_finish+" 
    4 COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish+ -preprocessor_use_gl_renderer- -preprocessor_evaluate_filter+" 
     4COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish+ -preprocessor_use_gl_renderer+ -preprocessor_evaluate_filter-" 
    55 
    66#SCENE="../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d;../data/vienna/vienna-roads.x3d" 
     
    4949$COMMAND -preprocessor=combined -scene_filename=$SCENE -view_cells_filename=$VIEWCELLS \ 
    5050 -rss_distributions=mutation+object_direction+spatial -view_cells_filter_max_size=1 \ 
    51  -preprocessor_visibility_file=$PREFIX-i-mixed-b1-n4g.xml \ 
    52  -preprocessor_stats=$PREFIX-i-mixed-b1-n4g.log \ 
    53  -preprocessor_histogram_file=$PREFIX-i-mixed-b1-n4g.hlog 
     51 -preprocessor_visibility_file=$PREFIX-i-mixed-b1-n4h.xml \ 
     52 -preprocessor_stats=$PREFIX-i-mixed-b1-n4h.log \ 
     53 -preprocessor_histogram_file=$PREFIX-i-mixed-b1-n4h.hlog 
    5454 
    5555 
Note: See TracChangeset for help on using the changeset viewer.