Ignore:
Timestamp:
12/14/05 19:38:39 (19 years ago)
Author:
bittner
Message:

changed the viewcellsmanager interface to use vssrays - some functionality like the bsp merging is now restricted

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/src/VssPreprocessor.cpp

    r465 r466  
    4242                                                  ) 
    4343{ 
    44   ray.intersections.clear(); 
     44  ray.Clear(); 
    4545  // do not store anything else then intersections at the ray 
    4646  ray.Init(point, direction, Ray::LOCAL_RAY); 
     
    450450  } 
    451451         
    452   ObjectContainer objects; 
    453   mSceneGraph->CollectObjects(&objects); 
     452  mSceneGraph->CollectObjects(&mObjects); 
    454453 
    455454  // construct view cells 
    456   mViewCellsManager->Construct(objects, mVssRays, mViewSpaceBox); 
     455  mViewCellsManager->Construct(mObjects, mVssRays, mViewSpaceBox); 
    457456 
    458457  vssTree = new VssTree; 
     
    509508          num = GenerateImportanceRays(vssTree, num, rays); 
    510509        } 
    511                          
     510         
    512511        for (int i=0; i < rays.size(); i++) 
    513512          CastRay(rays[i].mOrigin, rays[i].mDirection, vssRays); 
     
    534533 
    535534        //-- prepare traversal rays for view cell intersections 
    536         RayContainer passRays; 
    537  
    538         VssRayContainer::const_iterator it, it_end = vssRays.end(); 
    539          
    540         for (it = vssRays.begin(); it != it_end; ++ it) 
    541                 passRays.push_back(new Ray(*(*it))); 
    542          
    543         int sampleContributions = 0; 
    544         int contributingSamples = 0; 
    545  
    546535        /// compute view cell contribution of rays 
    547 /*      mViewCellsManager->ComputeSampleContributions(passRays, 
    548                                                                                                   sampleContributions,  
    549                                                                                                   contributingSamples); 
    550          
    551         //-- save rays for post processing 
    552         if (((int)storedRays.size() < mViewCellsManager->GetPostProcessSamples()) || 
    553                 ((int)storedRays.size() < mViewCellsManager->GetVisualizationSamples())) 
    554         { 
    555                 RayContainer::const_iterator it, it_end = passRays.end(); 
    556  
    557                 for (it = passRays.begin(); it != it_end; ++ it) 
    558                         storedRays.push_back(new Ray(*(*it))); 
    559         } 
    560         else 
    561         { 
    562                 CLEAR_CONTAINER(passRays); 
    563         } 
    564 */ 
     536        mViewCellsManager->ComputeSampleContributions(vssRays); 
     537 
    565538        samples+=num; 
    566539        float pvs = vssTree->GetAvgPvsSize(); 
    567540        cout<<"*****************************\n"; 
    568541        cout<<samples<<" avgPVS ="<<pvs<<endl; 
    569         cout<<"sample contributions ="<<sampleContributions<<endl; 
    570         cout<<"contributing sample ="<<contributingSamples<<endl; 
    571542        cout<<"VssTree root PVS size = "<<vssTree->GetRootPvsSize()<<endl; 
    572543        cout<<"*****************************\n"; 
     
    576547  } 
    577548 
    578   cout << "here" << endl; 
    579   //-- post process view cells 
    580   mViewCellsManager->PostProcess(objects, storedRays); 
    581  
    582   //-- several visualizations and statistics 
    583   mViewCellsManager->PrintStatistics(Debug); 
     549  { 
     550        VssRayContainer storedRays; 
     551        vssTree->CollectRays(storedRays, Max( 
     552                                                                                 mViewCellsManager->GetPostProcessSamples(), 
     553                                                                                 mViewCellsManager->GetVisualizationSamples())); 
     554         
     555        //-- post process view cells 
     556        mViewCellsManager->PostProcess(mObjects, storedRays); 
     557         
     558        //-- several visualizations and statistics 
     559        mViewCellsManager->PrintStatistics(Debug); 
     560 
     561        mViewCellsManager->Visualize(mObjects, storedRays); 
     562 
     563        CLEAR_CONTAINER(storedRays); 
     564  } 
    584565 
    585566  //-- render simulation after merge 
    586567  cout << "\nevaluating bsp view cells render time after merge ... "; 
    587                  
     568   
    588569  const SimulationStatistics ss = mViewCellsManager->SimulateRendering(); 
    589                  
     570   
    590571  cout << " finished" << endl; 
    591572  cout << ss << endl; 
    592573  Debug << ss << endl; 
    593  
    594   mViewCellsManager->Visualize(objects, storedRays); 
    595  
    596   CLEAR_CONTAINER(storedRays); 
     574   
    597575   
    598576  delete vssTree; 
    599  
     577   
    600578  return true; 
    601579} 
Note: See TracChangeset for help on using the changeset viewer.