Ignore:
Timestamp:
12/15/06 23:40:27 (18 years ago)
Author:
bittner
Message:

experiments with different contribution computations

File:
1 edited

Legend:

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

    r1891 r1900  
    365365         
    366366          RssTreeNode::RayInfo info(*ri); 
    367            
     367          if (!EpsilonEqualV3(info.GetOrigin(), info.GetTermination(), Limits::Small)) { 
     368 
    368369          // first construct a leaf that will get subdivide 
    369370          RssTreeLeaf *leaf = (RssTreeLeaf *) GetRoot(info.GetSourceObject()); 
     371           
    370372 
    371373          leaf->AddRay(info); 
     
    389391          leaf->dirBBox.Include(dVec); 
    390392          dirBBox.Include(dVec); 
     393          } 
    391394  } 
    392395 
     
    14561459  if (stat.rayRefs > mMaxRays) { 
    14571460        Debug<<"Prunning rays..."<<endl<<flush; 
    1458         PruneRays(mMaxRays); 
     1461        PruneRays(0.8f*mMaxRays); 
    14591462        Debug<<"done."<<endl<<flush; 
    14601463        //      UpdateTreeStatistics(); 
    14611464  } 
    1462  
    14631465} 
    14641466 
     
    15531555RssTree::AddRay(RssTreeNode::RayInfo &info) 
    15541556{ 
     1557  if (EpsilonEqualV3(info.GetOrigin(), info.GetTermination(), Limits::Small)) 
     1558        return; 
    15551559 
    15561560  stack<RayTraversalData> tstack; 
     
    15611565  RayTraversalData data; 
    15621566   
     1567 
    15631568  while (!tstack.empty()) { 
    15641569    data = tstack.top(); 
     
    18071812RssTree::UpdateTreeStatistics() 
    18081813{ 
     1814  for (int i=0; i < mRoots.size(); i++) 
     1815        UpdateImportance(mRoots[i]); 
     1816   
     1817#if 0   
    18091818  stack<RssTreeNode *> tstack; 
    18101819         
     
    18191828  int leaves = 0; 
    18201829 
    1821   for (int i=0; i < mRoots.size(); i++) 
    1822         UpdateImportance(mRoots[i]); 
    18231830 
    18241831  PushRoots(tstack); 
    1825  
     1832   
    18261833  while (!tstack.empty()) { 
    18271834    RssTreeNode *node = tstack.top(); 
     
    18711878  stat.avgWeightedRayContribution = sumWeightedRayContribution/(float)sumRays; 
    18721879  stat.rayRefs = (int)sumRays; 
     1880#endif 
    18731881   
    18741882} 
     
    28222830          float c1 = weight*ray->mPvsContribution; 
    28232831          float c2 = weight*ray->mRelativePvsContribution; 
     2832 
    28242833          sumContributions += c1; 
    28252834          if (c1 > maxContribution) 
     
    28322841          sumRelContributions += c2; 
    28332842          if (c2 > maxRelContribution) 
    2834                         maxRelContribution = c2; 
    2835  
     2843                maxRelContribution = c2; 
     2844           
    28362845          //sumWeights += weight; 
    28372846          sumWeights += 1.0f; 
     
    28642873          leaf->mImportance = 
    28652874                pow(((weightAbsContributions*sumContributions + 
    2866                           (1.0f - weightAbsContributions)*sumRelContributions)/sumWeights), 3); 
    2867 #else  
     2875                          (1.0f - weightAbsContributions)*sumRelContributions)/sumWeights), 1.0f); 
     2876#else 1 
    28682877          leaf->mImportance = 
    28692878                (weightAbsContributions*maxContribution + 
Note: See TracChangeset for help on using the changeset viewer.