Changeset 2722


Ignore:
Timestamp:
05/28/08 01:24:20 (16 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/scripts/run_demo_vienna

    r2717 r2722  
    4040 -preprocessor_detect_empty_viewspace+ \ 
    4141 -preprocessor_use_vbos- \ 
    42  -preprocessor_ray_cast_method=3 \ 
     42 -preprocessor_ray_cast_method=1 \ 
    4343 -view_cells_random_viewpoint_list=$VIEWPOINTS \ 
    4444 demo1.env 
  • GTP/trunk/Lib/Vis/Preprocessing/scripts/run_gvs_vps.sh

    r2721 r2722  
    22 
    33# add bin to path 
    4 export PATH=../bin:$PATH 
     4export PATH=../bin:../:$PATH 
    55 
    66#TARGET=debug 
     
    1414SCENE=../data/Arena/arena_trees.obj 
    1515VIEWCELLS=../data/Arena/arena-high-lods-5000-viewcells.xml.gz 
    16 #SCENE=../data/vienna/vienna_cropped.obj 
    17 #SCENE=../data/roofs_new.obj 
     16SCENE=../data/vienna/vienna_cropped.obj 
    1817#SCENE=../data/vienna/city_full_hp.obj 
    1918#SCENE=../data/vienna/vienna_rep.obj 
  • GTP/trunk/Lib/Vis/Preprocessing/src/GtpVisibility05.vcproj.UNKNOWN.matt.user

    r2563 r2722  
    6262                        /> 
    6363                </Configuration> 
     64                <Configuration 
     65                        Name="Engine|Win32" 
     66                        > 
     67                        <DebugSettings 
     68                                Command="" 
     69                                WorkingDirectory="" 
     70                                CommandArguments="" 
     71                                Attach="false" 
     72                                DebuggerType="3" 
     73                                Remote="1" 
     74                                RemoteMachine="UNKNOWN" 
     75                                RemoteCommand="" 
     76                                HttpUrl="" 
     77                                PDBPath="" 
     78                                SQLDebugging="" 
     79                                Environment="" 
     80                                EnvironmentMerge="true" 
     81                                DebuggerFlavor="" 
     82                                MPIRunCommand="" 
     83                                MPIRunArguments="" 
     84                                MPIRunWorkingDirectory="" 
     85                                ApplicationCommand="" 
     86                                ApplicationArguments="" 
     87                                ShimCommand="" 
     88                                MPIAcceptMode="" 
     89                                MPIAcceptFilter="" 
     90                        /> 
     91                </Configuration> 
    6492        </Configurations> 
    6593</VisualStudioUserFile> 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp

    r2720 r2722  
    16981698float Preprocessor::_HackComputeRenderCost(ViewCell *vc) 
    16991699{ 
    1700         ObjectPvs basePvs; 
    1701          
    1702         basePvs = vc->CopyPvs(); 
    1703         ObjectPvsIterator pit = basePvs.GetIterator(); 
     1700        ObjectPvsIterator pit = vc->GetPvs().GetIterator(); 
    17041701 
    17051702        float renderCost = 0; 
    1706  
     1703        int i = 0; 
     1704        cout<<"size: " << vc->GetPvs().GetSize() << endl; 
    17071705        // first mark all objects from this pvs 
    17081706        while (pit.HasMoreEntries())     
    17091707        { 
    17101708                Intersectable *obj = pit.Next(); 
    1711  
    17121709                if (obj->Type() == Intersectable::KD_INTERSECTABLE) 
    17131710                { 
    1714                         KdIntersectable *kdObj = static_cast<KdIntersectable *>(pit.Next()); 
     1711                        KdIntersectable *kdObj = static_cast<KdIntersectable *>(obj); 
    17151712 
    17161713                        /*if (mShowDistanceWeightedPvs) 
     
    17561753  int maxPlanes = 0; 
    17571754  int allEntries = 0; 
     1755 
     1756  int viewCells = 0; 
     1757 
    17581758  // now search for pvss which contained any mailed node 
    1759   for (vit = mViewCellsManager->GetViewCells().begin(); vit != vit_end; ++ vit) { 
     1759  for (vit = mViewCellsManager->GetViewCells().begin(); vit != vit_end; ++ vit)  
     1760  { 
    17601761          ObjectPvs &pvs = (*vit)->GetPvs(); 
    1761           if (Overlap(box, (*vit)->GetBox())) { 
     1762 
     1763          bool pvsChanged = false; 
     1764 
     1765          if (Overlap(box, (*vit)->GetBox()))  
     1766          { 
    17621767                  pvs.Clear(); 
    17631768                  removedEntries += pvs.GetSize(); 
    1764           } else { 
     1769                  pvsChanged = true; 
     1770          }  
     1771          else  
     1772          { 
    17651773                  //    cout<<(*vit)->GetBox()<<" "<<box<<endl; 
    17661774                  shadowVolume.Init((*vit)->GetBox(), box); 
     
    17691777 
    17701778                  int j = 0; 
    1771                   for (int i=0; i < pvs.mEntries.size(); i++) { 
     1779                  for (int i=0; i < pvs.mEntries.size(); i++)  
     1780                  { 
    17721781                          allEntries++; 
    17731782                          Intersectable *o = pvs.mEntries[i].mObject; 
    1774                           if (o == inter) { 
     1783                          if (o == inter)  
     1784                          { 
    17751785                                  removedSelfEntries++; 
    1776                           } else { 
    1777                                   if (!shadowVolume.TestIsInsideShaft(o->GetBox())) { 
     1786                                  pvsChanged = true; 
     1787                          }  
     1788                          else  
     1789                          { 
     1790                                  if (!shadowVolume.TestIsInsideShaft(o->GetBox()))  
     1791                                  { 
    17781792                                          if (j != i) 
    17791793                                                  pvs.mEntries[j] = pvs.mEntries[i]; 
    17801794                                          j++; 
    1781                                   } else { 
     1795                                  }  
     1796                                  else  
     1797                                  { 
    17821798                                          removedEntries++; 
     1799                                          pvsChanged = true; 
    17831800                                  } 
    17841801                          } 
    17851802                  } 
     1803 
    17861804                  // now the pvs has to be resorted 
    17871805                  pvs.mLastSorted = 0; 
    17881806                  if (j==0) 
    17891807                          pvs.mEntries.clear(); 
    1790                   else { 
     1808                  else  
     1809                  { 
    17911810                          pvs.mEntries.resize(j); 
    17921811                          if (j>1) 
     
    17951814          } 
    17961815 
    1797           ViewCell *vc = *vit; 
    1798  
    1799           // recompute render cost 
    1800           float renderCost = _HackComputeRenderCost(vc); 
    1801           vc->GetPvs().mStats.mWeightedTriangles = renderCost; 
     1816          if (pvsChanged) 
     1817          { 
     1818                  ViewCell *vc = *vit; 
     1819 
     1820                  // recompute render cost 
     1821                  float renderCost = _HackComputeRenderCost(vc); 
     1822                  vc->GetPvs().mStats.mWeightedTriangles = renderCost; 
     1823          } 
    18021824  } 
    1803    
     1825 
    18041826  cerr<<"Number of removed pvs entries = "<<removedEntries<<" ("<< 
    18051827        100.0f*removedEntries/(float)allEntries<<"%)"<<endl; 
Note: See TracChangeset for help on using the changeset viewer.