Changeset 567


Ignore:
Timestamp:
01/23/06 10:10:34 (18 years ago)
Author:
bittner
Message:

rss preprocessor simplification - mixed sampling strategies

Location:
trunk/VUT/GtpVisibilityPreprocessor/src
Files:
6 edited

Legend:

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

    r563 r567  
    444444        mViewCellsManager->GetViewPoint(origin); 
    445445         
    446          
    447446        // now get the direction 
    448447        switch (sampleType) { 
  • trunk/VUT/GtpVisibilityPreprocessor/src/RssPreprocessor.cpp

    r563 r567  
    6464          GenerateImportanceRays(mRssTree, number, rays); 
    6565          result = true; 
    66           rays.NormalizePdf(); 
     66          //      rays.NormalizePdf(); 
    6767        } 
    6868        break; 
     
    214214 
    215215 
    216 Vector3 
    217 RssPreprocessor::GetViewpoint(AxisAlignedBox3 *viewSpaceBox) 
    218 { 
    219   AxisAlignedBox3 box; 
    220          
    221   if (viewSpaceBox) 
    222         box =*viewSpaceBox; 
    223   else  
    224         box = mKdTree->GetBox(); 
    225          
    226   // shrink the box in the y direction 
    227   return box.GetRandomPoint(); 
    228 } 
    229216 
    230217 
     
    432419{ 
    433420 
    434   //  connect(this, SIGNAL(EvalPvsStat()), renderer, SLOT(EvalPvsStat()) ); 
    435    
    436421  cout<<"Rss Preprocessor started\n"<<flush; 
    437   cout<<"Memory/ray "<<sizeof(VssRay)+sizeof(RssTreeNode::RayInfo)<<endl; 
     422  //  cout<<"Memory/ray "<<sizeof(VssRay)+sizeof(RssTreeNode::RayInfo)<<endl; 
    438423 
    439424  Randomize(0); 
     
    566551        if (mUseImportanceSampling) { 
    567552          VssRayContainer tmpVssRays; 
    568            
    569           GenerateRays(mRssSamplesPerPass/2, RSS_BASED_DISTRIBUTION, rays); 
     553 
     554          float ratios[] = {1.0f,0,0}; 
     555 
     556           
     557           
     558          GenerateRays(mRssSamplesPerPass*ratios[0], RSS_BASED_DISTRIBUTION, rays); 
    570559          CastRays(rays, tmpVssRays); 
    571560          castRays += rays.size(); 
     
    576565          rays.clear(); 
    577566          tmpVssRays.clear(); 
    578            
    579           GenerateRays(mRssSamplesPerPass/4, SPATIAL_BOX_BASED_DISTRIBUTION, rays); 
    580           CastRays(rays, tmpVssRays); 
    581           castRays += rays.size(); 
    582           float c2 = mViewCellsManager->ComputeSampleContributions(tmpVssRays, false); 
    583           mStats<<"#SpatialRelContrib"<<endl<<c2/rays.size()<<endl; 
    584  
    585           vssRays.insert(vssRays.end(), tmpVssRays.begin(), tmpVssRays.end() ); 
    586            
    587           rays.clear(); 
    588           tmpVssRays.clear(); 
    589            
    590            
    591           GenerateRays(mRssSamplesPerPass/4, DIRECTION_BASED_DISTRIBUTION, rays); 
    592           CastRays(rays, tmpVssRays); 
    593           castRays += rays.size(); 
    594           float c3 = mViewCellsManager->ComputeSampleContributions(tmpVssRays, false); 
    595           mStats<<"#DirectionalRelContrib"<<endl<<c3/rays.size()<<endl; 
    596            
    597           vssRays.insert(vssRays.end(), tmpVssRays.begin(), tmpVssRays.end() ); 
    598            
    599           rays.clear(); 
    600           tmpVssRays.clear(); 
     567 
     568          if (ratios[1]!=0.0f) { 
     569                GenerateRays(mRssSamplesPerPass*ratios[1], SPATIAL_BOX_BASED_DISTRIBUTION, rays); 
     570                CastRays(rays, tmpVssRays); 
     571                castRays += rays.size(); 
     572                float c2 = mViewCellsManager->ComputeSampleContributions(tmpVssRays, false); 
     573                mStats<<"#SpatialRelContrib"<<endl<<c2/rays.size()<<endl; 
     574                 
     575                vssRays.insert(vssRays.end(), tmpVssRays.begin(), tmpVssRays.end() ); 
     576                 
     577                rays.clear(); 
     578                tmpVssRays.clear(); 
     579          } 
     580           
     581           
     582          if (ratios[2]!=0.0f) { 
     583                GenerateRays(mRssSamplesPerPass*ratios[2], DIRECTION_BASED_DISTRIBUTION, rays); 
     584                CastRays(rays, tmpVssRays); 
     585                castRays += rays.size(); 
     586                float c3 = mViewCellsManager->ComputeSampleContributions(tmpVssRays, false); 
     587                mStats<<"#DirectionalRelContrib"<<endl<<c3/rays.size()<<endl; 
     588                 
     589                vssRays.insert(vssRays.end(), tmpVssRays.begin(), tmpVssRays.end() ); 
     590                 
     591                rays.clear(); 
     592                tmpVssRays.clear(); 
     593          } 
    601594           
    602595          // add contributions of all rays at once... 
  • trunk/VUT/GtpVisibilityPreprocessor/src/RssPreprocessor.h

    r563 r567  
    5252 
    5353  virtual bool ComputeVisibility(); 
    54  
    55   Vector3 
    56   GetViewpoint(AxisAlignedBox3 *viewSpaceBox); 
    5754 
    5855 
  • trunk/VUT/GtpVisibilityPreprocessor/src/RssTree.cpp

    r563 r567  
    20972097   
    20982098  float extendedConvexCombinationProb = 0.0f; //0.7f 
    2099   float silhouetteCheckPercentage = 0.0f; //0.5f 
     2099  float silhouetteCheckPercentage = 1.0f; //0.5f 
    21002100  for (int i=0; generated < numberOfRays && i < numberOfTries; i++) { 
    21012101        bool useExtendedConvexCombination = ((nrays >= 2) && (Random(1.0f) < 
     
    21782178                selectedRays.push_back(ray); 
    21792179          } 
    2180  
     2180           
    21812181          // check whether the ray does not intersect already visible objects 
    21822182          Ray traversalRay; 
     
    21862186                  oi++) { 
    21872187                Intersectable *object = *oi; 
     2188                // do not test every object 
     2189                if (Random(1.0f) > 0.5f) 
     2190                  break; 
    21882191                if ( object->CastRay(traversalRay) ) { 
    21892192                  intersects = true; 
     
    23222325                                   ) 
    23232326{ 
    2324   bool globalPrunning = false; 
     2327  bool globalPrunning = true; 
    23252328 
    23262329  stack<RssTreeNode *> tstack; 
     
    23692372          if (node->IsLeaf()) { 
    23702373                RssTreeLeaf *leaf = (RssTreeLeaf *)node; 
    2371                 //              prunned += PruneRaysRandom(leaf, ratio); 
     2374                // prunned += PruneRaysRandom(leaf, ratio); 
    23722375                prunned += PruneRaysContribution(leaf, ratio); 
    23732376          } else { 
     
    24742477// if small very high importance of the last sample 
    24752478// if 1.0f then weighs = 1 1/2 1/3 1/4 
    2476 float passSampleWeightDecay = 0.5f; 
     2479float passSampleWeightDecay = 1.0f; 
    24772480 
    24782481void 
     
    25032506          break; 
    25042507        default: 
    2505           weight = 0.01f; 
     2508          weight = 0.0f; 
    25062509          break; 
    25072510          //    case 1: 
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp

    r565 r567  
    189189  for (it = rays.begin(); it != it_end; ++ it) { 
    190190        sum += ComputeSampleContributions(*(*it), addRays); 
     191        //ComputeSampleContributions(*(*it), addRays); 
     192        //      sum += (*it)->mPvsContribution; 
    191193  } 
    192194  return sum; 
  • trunk/VUT/GtpVisibilityPreprocessor/src/default.env

    r563 r567  
    1414# filename ../data/vienna/viewcells-25-sel.x3d 
    1515# filename ../data/atlanta/atlanta2.x3d 
    16 # filename ../data/soda/soda.dat 
     16#filename ../data/soda/soda.dat 
    1717filename ../data/soda/soda5.dat 
    1818} 
     
    2525#       type vss 
    2626        type rss 
    27         detectEmptyViewSpace false 
     27        detectEmptyViewSpace true 
    2828        pvsRenderErrorSamples 10000 
    2929 
     
    9797RssTree { 
    9898        epsilon         1e-6 
    99         perObjectTree false 
     99        perObjectTree true 
    100100 
    101101        maxDepth        40 
    102102        minPvs          1 
    103         minRays         100 
     103        minRays         50 
    104104        minSize         0.001 
    105105        maxCostRatio 1.0 
    106106        maxRayContribution 0.5 
    107         maxRays         5000000 
     107        maxRays         2000000 
    108108        maxTotalMemory  200 
    109109        maxStaticMemory 100 
     
    118118    dirSplitDepth 0 
    119119 
    120         numberOfEndPointDomains 10000 
    121120        ct_div_ci       0.0 
    122         randomize       false 
    123  
    124         refDirBoxMaxSize        0.1 
    125121} 
    126122 
     
    204200        } 
    205201         
    206 #       filename ../data/soda/viewcells_soda5-2.xml 
    207         filename ../data/atlanta/viewcells_atlanta2.xml 
     202        filename ../data/soda/viewcells_soda5-2.xml 
     203#       filename ../data/atlanta/viewcells_atlanta2.xml 
    208204#       filename ../data/atlanta/atlanta_viewcells_large.x3d 
    209205#       filename ../data/vienna/viewcells-25-sel.x3d 
Note: See TracChangeset for help on using the changeset viewer.