Ignore:
Timestamp:
01/25/06 01:44:46 (18 years ago)
Author:
mattausch
Message:

finished function for view cell construction
removed bsp rays from vspbspmanager

File:
1 edited

Legend:

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

    r564 r574  
    2727  environment->GetIntValue("VssPreprocessor.vssSamplesPerPass", mVssSamplesPerPass); 
    2828  environment->GetBoolValue("VssPreprocessor.useImportanceSampling", mUseImportanceSampling); 
    29   environment->GetBoolValue("ViewCells.delayedConstruction", mDelayedViewCellsConstruction); 
    30  
     29  
    3130  environment->GetBoolValue("VssPreprocessor.loadInitialSamples", mLoadInitialSamples); 
    3231  environment->GetBoolValue("VssPreprocessor.storeInitialSamples", mStoreInitialSamples); 
     
    5453  ray.Init(point, direction, Ray::LOCAL_RAY); 
    5554} 
     55 
     56 
     57void 
     58VssPreprocessor::CastRays( 
     59                                                  SimpleRayContainer &rays, 
     60                                                  VssRayContainer &vssRays 
     61                                                  ) 
     62{ 
     63  for (int i=0; i < rays.size(); i++) 
     64        CastRay(rays[i].mOrigin, rays[i].mDirection, vssRays); 
     65} 
     66 
    5667 
    5768int 
     
    529540          mViewCellsManager->LoadViewCells(mViewCellsFilename, &mObjects); 
    530541  } 
    531  
     542  else 
     543  { 
     544          // construct view cells using it's own set of samples 
     545          mViewCellsManager->Construct(this); 
     546 
     547          //-- several visualizations and statistics 
     548          Debug << "view cells after construction: " << endl; 
     549          mViewCellsManager->PrintStatistics(Debug); 
     550  } 
     551         
    532552 
    533553  VssTree *vssTree = NULL; 
     
    634654  } 
    635655 
    636   /// compute view cell contribution of rays if view cells manager already constructed 
    637   mViewCellsManager->ComputeSampleContributions(mVssRays); 
    638  
    639   // construct view cells 
    640   if (!mDelayedViewCellsConstruction) 
    641         mViewCellsManager->Construct(mObjects, mVssRays); 
    642   
    643656  vssTree = new VssTree; 
    644657  // viewcells = Construct(mVssRays); 
     
    712725        cout<<"Average PVS size = "<<avgPvs<<endl; 
    713726 
    714         // construct view cells after vss 
    715         if (!mViewCellsManager->ViewCellsConstructed() &&  
    716                 (samples + mInitialSamples >= mViewCellsManager->GetConstructionSamples())) 
    717         { 
    718                 Debug << "samples " << samples << " initial " << mInitialSamples << " " << samples + mInitialSamples << endl; 
    719                 VssRayContainer constructionRays; 
    720                 vssTree->CollectRays(constructionRays, mViewCellsManager->GetConstructionSamples()); 
    721  
    722                 Debug << "collected rays: " << constructionRays.size() << endl; 
    723  
    724                 // test if we really have enough rays 
    725                 //if (constructionRays.size() >= nSamples)  
    726                 mViewCellsManager->Construct(mObjects, constructionRays); 
    727         } 
    728  
    729727        /// compute view cell contribution of rays 
    730         mViewCellsManager->ComputeSampleContributions(vssRays); 
     728        mViewCellsManager->ComputeSampleContributions(vssRays, true, false); 
    731729         
    732730        if (numExportRays) { 
     
    750748  } 
    751749 
    752  
    753   // at the latest create view cells here 
    754   if (!mViewCellsManager->ViewCellsConstructed()) 
    755   { 
    756           VssRayContainer constructionRays; 
    757  
    758           vssTree->CollectRays(constructionRays,  
    759                                                    mViewCellsManager->GetConstructionSamples()); 
    760           Debug << "collected rays: " << constructionRays.size() << endl; 
    761  
    762           mViewCellsManager->Construct(mObjects, constructionRays); 
    763   } 
    764  
    765   Debug << vssTree->stat << endl; 
    766   VssRayContainer viewCellRays; 
    767    
    768   // compute rays used for view cells construction 
    769   int numRays = Max(mViewCellsManager->GetPostProcessSamples(), 
    770                                         mViewCellsManager->GetVisualizationSamples()); 
    771  
    772   vssTree->CollectRays(viewCellRays, numRays); 
    773    
    774   //-- post process view cells 
    775   mViewCellsManager->PostProcess(mObjects, viewCellRays); 
    776  
    777750  if (mTestBeamSampling && mUseGlRenderer) 
    778751  {      
     
    780753  } 
    781754 
    782   //-- several visualizations and statistics 
    783   Debug << "\nview cells after post processing: " << endl; 
    784   mViewCellsManager->PrintStatistics(Debug); 
    785  
    786   mViewCellsManager->Visualize(mObjects, viewCellRays); 
    787    
     755  Debug << vssTree->stat << endl; 
     756 
     757  if (0) 
     758  { 
     759        VssRayContainer viewCellRays; 
     760   
     761        // compute rays used for view cells construction 
     762        const int numRays = mViewCellsManager->GetVisualizationSamples(); 
     763 
     764        vssTree->CollectRays(viewCellRays, numRays); 
     765  } 
     766 
    788767  //-- render simulation after merge 
    789   cout << "\nevaluating bsp view cells render time after merge ... "; 
     768  cout << "\nevaluating bsp view cells render time after sampling ... "; 
    790769  mRenderSimulator->RenderScene(); 
    791770  SimulationStatistics ss; 
Note: See TracChangeset for help on using the changeset viewer.