Changeset 1899


Ignore:
Timestamp:
12/15/06 18:01:34 (17 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
6 edited

Legend:

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

    r1895 r1899  
    646646                                                                  renderCostDecr); 
    647647         
    648         if (0) 
     648        if (USE_AVGRAYCONTRI) 
    649649        { 
    650650                // this leaf is a pvs entry in all the view cells 
     
    657657                        AvgRayContribution(pvs, splitCandidate.mParentData.mNumRays); 
    658658 
    659                 Debug << "bvh avgRayContri: " << avgRayContri << " #pvs: " << pvs << " #rays: " << splitCandidate.mParentData.mNumRays << endl; 
    660                 cout << "bvh avgRayContri: " << avgRayContri << endl; 
     659                //Debug << "bvh avgRayContri: " << avgRayContri << " #pvs: " << pvs << " #rays: " << splitCandidate.mParentData.mNumRays << endl; 
     660                //cout << "bvh avgRayContri: " << avgRayContri << endl; 
    661661 
    662662                // high avg ray contri, the result is influenced by undersampling 
     
    665665                { 
    666666                        const float factor = 1.0f + avgRayContri - mHierarchyManager->mMaxAvgRayContri; 
    667                         cout << "here5 " << factor << endl; 
    668  
    669667                        priority /= factor; 
    670668                } 
  • GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp

    r1895 r1899  
    780780        // high avg ray contri, the result is influenced by undersampling 
    781781        // => decrease priority 
    782         if (0 && (sc->GetAvgRayContribution() > mMaxAvgRayContri)) 
     782        if (USE_AVGRAYCONTRI && (sc->GetAvgRayContribution() > mMaxAvgRayContri)) 
    783783        { 
    784784                const float factor = 1.0f + sc->GetAvgRayContribution() - mMaxAvgRayContri; 
    785                 cout << "here5 " << factor << endl; 
     785                cout << "h " << factor << endl; 
    786786 
    787787                mem *= factor; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.h

    r1895 r1899  
    4545 
    4646#define COUNT_ORIGIN_OBJECTS 1 
    47  
     47#define USE_AVGRAYCONTRI 1 
    4848/** View space / object space hierarchy statistics. 
    4949*/ 
  • GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp

    r1898 r1899  
    99namespace GtpVisibilityPreprocessor { 
    1010 
    11 HaltonSequence SamplingStrategy::sHalton; 
     11 
     12HaltonSequence ObjectBasedDistribution::sHalton; 
     13HaltonSequence MixtureDistribution::sHalton; 
     14HaltonSequence GlobalLinesDistribution::sHalton; 
     15HaltonSequence SpatialBoxBasedDistribution::sHalton; 
     16HaltonSequence ObjectDirectionBasedDistribution::sHalton; 
     17 
    1218 
    1319SamplingStrategy::SamplingStrategy(Preprocessor &preprocessor):  
     
    132138  direction = Normalize(CosineRandomVector(r[2], r[3], normal)); 
    133139   
    134   origin += 1e-2*direction; 
     140  origin += 1e-2f*direction; 
    135141   
    136142  // $$ jb the pdf is yet not correct for all sampling methods! 
  • GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.h

    r1898 r1899  
    8484 
    8585        Preprocessor &mPreprocessor; 
    86         static HaltonSequence sHalton; 
    8786}; 
    8887 
     
    9190{ 
    9291 public: 
    93   //HaltonSequence mHalton; 
     92  
    9493   
    9594  ObjectBasedDistribution(Preprocessor &preprocessor): 
     
    10099private: 
    101100  virtual bool GenerateSample(SimpleRay &ray); 
     101 
     102   static HaltonSequence sHalton; 
    102103}; 
    103104 
     
    119120class ObjectDirectionBasedDistribution: public SamplingStrategy 
    120121{ 
    121   //HaltonSequence mHalton; 
    122122   
    123123public: 
     
    126126           mType = OBJECT_DIRECTION_BASED_DISTRIBUTION; 
    127127         } 
    128 private: 
     128 
     129private: 
     130 
     131        static HaltonSequence sHalton; 
    129132        virtual bool GenerateSample(SimpleRay &ray); 
    130133}; 
     
    159162{ 
    160163 public: 
    161   //HaltonSequence mHalton; 
    162   SpatialBoxBasedDistribution(Preprocessor &preprocessor): 
     164          
     165        SpatialBoxBasedDistribution(Preprocessor &preprocessor): 
    163166        SamplingStrategy(preprocessor){ 
    164167        mType = SPATIAL_BOX_BASED_DISTRIBUTION; 
     
    167170private: 
    168171           virtual bool GenerateSample(SimpleRay &ray); 
     172 
     173           static HaltonSequence sHalton; 
    169174}; 
    170175 
     
    196201 
    197202 
    198  
    199  
    200203class ViewCellBorderBasedDistribution: public SamplingStrategy 
    201204{ 
     
    206209 
    207210  } 
    208    
     211 
     212private: 
    209213  virtual bool GenerateSample(SimpleRay &ray); 
    210214}; 
     
    213217{ 
    214218public: 
    215   //Halton<4> halton; 
    216   //HaltonSequence mHalton; 
    217  
     219  
    218220  GlobalLinesDistribution(Preprocessor &preprocessor): 
    219221        SamplingStrategy(preprocessor) { 
     
    221223  } 
    222224   
    223   virtual bool GenerateSample(SimpleRay &ray); 
     225private: 
     226 
     227  virtual bool GenerateSample(SimpleRay &ray); 
     228 
     229   static HaltonSequence sHalton; 
    224230}; 
    225231 
     
    238244*/ 
    239245 
    240 class MixtureDistribution : public SamplingStrategy  
    241 { 
    242 public: 
    243   // halton sequence generator for deciding between distributions 
    244   //HaltonSequence mHalton; 
    245    
     246class MixtureDistribution: public SamplingStrategy  
     247{ 
     248public: 
     249    
    246250  // container for the distributions 
    247251  vector<SamplingStrategy *> mDistributions; 
     
    259263  Reset(); 
    260264   
    261   // Generate a new sample according to a mixture distribution 
    262   virtual bool GenerateSample(SimpleRay &ray); 
    263  
    264265  // add contributions of the sample to the strategies 
    265266  void ComputeContributions(VssRayContainer &vssRays); 
     
    272273  Construct(char *str); 
    273274 
     275private: 
     276 
     277   // Generate a new sample according to a mixture distribution 
     278  virtual bool GenerateSample(SimpleRay &ray); 
     279 
     280// halton sequence generator for deciding between distributions 
     281  static HaltonSequence sHalton; 
    274282   
    275283}; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp

    r1895 r1899  
    860860        // avg ray contri 
    861861 
    862         if (0) 
     862        if (USE_AVGRAYCONTRI) 
    863863        { 
    864864                const int pvs = EvalPvsEntriesSize(*splitCandidate.mParentData.mRays); 
    865865                const float avgRayContri = (float)pvs / ((float)splitCandidate.mParentData.mRays->size() + Limits::Small); 
    866866 
    867                 Debug << "vsp avgRayContri: " << avgRayContri << " #pvs: " << pvs << " #rays: " << splitCandidate.mParentData.mRays->size() << endl; 
    868                 cout << "vsp avgRayContri: " << avgRayContri << endl; 
     867                //Debug << "vsp avgRayContri: " << avgRayContri << " #pvs: " << pvs << " #rays: " << splitCandidate.mParentData.mRays->size() << endl; 
     868                //cout << "vsp avgRayContri: " << avgRayContri << endl; 
    869869 
    870870                // high avg ray contri very, the result is influenced by undersampling 
Note: See TracChangeset for help on using the changeset viewer.