Changeset 2745


Ignore:
Timestamp:
06/09/08 16:35:30 (16 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/scripts/gvs.env

    r2695 r2745  
    3636 
    3737        # internal: 0 intel: 1 2: havran 3: havran dyn 
    38         rayCastMethod 1 
     38        rayCastMethod 3 
    3939 
    4040        exportVisibility false 
  • GTP/trunk/Lib/Vis/Preprocessing/scripts/run_gvs_vps.sh

    r2743 r2745  
    1818SCENE=../data/vienna/city_full_hp.obj 
    1919#SCENE=../data/vienna/vienna_rep.obj 
    20 #SCENE=../data/vienna/vienna_cropped.obj 
     20SCENE=../data/vienna/vienna_cropped.obj 
    2121 
    2222VIEWCELLS=../data/vienna/vienna_cropped-gradient-viewcells.xml.gz  
     
    3838-preprocessor=gvs \ 
    3939-preprocessor_use_vbos- \ 
    40 -gvs_epsilon=0.001 \ 
     40-gvs_epsilon=0.0001 \ 
    4141-gvs_total_samples=1000000 \ 
    4242-gvs_samples_per_pass=1000000 \ 
    43 -gvs_initial_samples=128 \ 
     43-gvs_initial_samples=10000 \ 
    4444-gvs_max_viewcells=1 \ 
    45 -gvs_min_contribution=200 \ 
     45-gvs_min_contribution=50 \ 
    4646-gvs_per_viewcell=true \ 
    47 -gvs_threshold=0.5 \ 
     47-gvs_threshold=0.05 \ 
    4848-gvs_radius_of_influence=5.0 \ 
    49 -gvs_use_deterministic_gvs- \ 
     49-gvs_use_deterministic_gvs+ \ 
    5050-gvs_initial_jitter=0.1 \ 
    5151-preprocessor_detect_empty_viewspace+ \ 
  • GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp

    r2743 r2745  
    3434static VizStruct currentViz; 
    3535 
     36static int successfullReverseRays = 0; 
     37 
    3638 
    3739/////////// 
     
    200202 
    201203        mGvsStats.mReverseSamples += (int)reverseRays.size(); 
    202         EnqueueRays(reverseRays); 
     204        successfullReverseRays = EnqueueRays(reverseRays); 
    203205 
    204206        return (int)reverseRays.size(); 
     
    477479 
    478480        // cast reverse rays if necessary 
    479         if (USE_REVERSE_SAMPLING) castRays += CheckDiscontinuity(*newRay, hitTriangle, oldRay); 
    480          
     481        if (USE_REVERSE_SAMPLING)  
     482        { 
     483                castRays += CheckDiscontinuity(*newRay, hitTriangle, oldRay); 
     484         
     485                // also test reverse direction 
     486                if (newRay->mTerminationObject) 
     487                { 
     488                        TriangleIntersectable *tObj = static_cast<TriangleIntersectable *>(newRay->mTerminationObject); 
     489                        castRays += CheckDiscontinuity(oldRay, tObj->GetItem(), *newRay); 
     490                } 
     491        } 
     492 
    481493        if (GVS_DEBUG) 
    482494                currentViz.enlargedTriangle.push_back(p); 
     
    604616                { 
    605617                        if (USE_REVERSE_SAMPLING) 
     618                        { 
    606619                                castRays += CheckDiscontinuity(*vssRays[i], hitTriangle, currentRay); 
     620                                 
     621                                // also test reverse direction 
     622                                if (vssRays[i]->mTerminationObject) 
     623                                { 
     624                                        TriangleIntersectable *tObj = static_cast<TriangleIntersectable *>(vssRays[i]->mTerminationObject); 
     625                                        castRays += CheckDiscontinuity(currentRay, tObj->GetItem(), *vssRays[i]); 
     626                                } 
     627                        } 
    607628 
    608629                        castRays += SubdivideEdge(hitTriangle, 
     
    946967 
    947968 
    948 void GvsPreprocessor::EnqueueRays(const VssRayContainer &samples) 
    949 { 
     969int GvsPreprocessor::EnqueueRays(const VssRayContainer &samples) 
     970{ 
     971        int success = 0; 
    950972        rayTimer.Entry(); 
    951973 
     
    955977        { 
    956978                VssRay *ray = *vit; 
    957                 HandleRay(ray); 
     979                if (HandleRay(ray)) ++ success; 
    958980        } 
    959981 
    960982        rayTimer.Exit(); 
     983 
     984        return success; 
    961985} 
    962986 
     
    16091633                        cout << "contribution=" << mGvsStats.mPassContribution << " (of " << mMinContribution << ")" << endl; 
    16101634                        cout << "obj contri=" << mCurrentViewCell->GetPvs().GetSize() - oldPvsSize << " (of " << mMinContribution << ")" << endl; 
     1635                        cout << "successful reverse rays=" << successfullReverseRays << endl; 
     1636                        cout << "cast reverse rays=" << mGvsStats.mReverseSamples << endl; 
    16111637 
    16121638                        // termination criterium 
     
    16181644                        mGvsStats.mPassContribution = 0; 
    16191645                        passSamples = 0; 
     1646                        successfullReverseRays = 0; 
    16201647                         
     1648 
    16211649                        // compute the pixel error of this visibility solution 
    16221650                        if (1 && mEvaluatePixelError) 
  • GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.h

    r2743 r2745  
    179179                with respect to the previous ray. 
    180180        */ 
    181         void EnqueueRays(const VssRayContainer &samples); 
     181        int EnqueueRays(const VssRayContainer &samples); 
    182182        /** Hepler function for adaptive border sampling. It finds  
    183183                new sample points around a triangle in a eps environment 
  • GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp

    r2744 r2745  
    815815        direction = UniformRandomVector(r[0], r[1]); 
    816816         
    817 ##if 0 
    818         origin = mViewCell->GetBox().GetRandomPoint(); 
    819 #else 
    820         origin = mViewCell->GetBox().GetUniformRandomSurfacePoint(); 
    821  
    822         //origin = mViewCell->GetBox().GetRandomSurfacePoint(); 
    823         //mViewCell->GetRandomEdgePoint(origin, normal); 
    824         //origin = Vector3(680.682, 189.552, -278.177); 
    825  
    826         // move a little bit back to avoid piercing through walls 
    827         // that bound the view cell 
    828         origin -= 0.01f * normal; 
    829 #endif 
    830                  
     817 
     818        if (1) 
     819        { 
     820                origin = mViewCell->GetBox().GetRandomPoint(); 
     821        } 
     822        else 
     823        { 
     824                origin = mViewCell->GetBox().GetUniformRandomSurfacePoint(); 
     825 
     826                //origin = mViewCell->GetBox().GetRandomSurfacePoint(); 
     827                //mViewCell->GetRandomEdgePoint(origin, normal); 
     828                //origin = Vector3(680.682, 189.552, -278.177); 
     829 
     830                // move a little bit back to avoid piercing through walls 
     831                // that bound the view cell 
     832                origin -= 1e-4f * normal; 
     833        } 
    831834 
    832835        static const float pdf = 1.0f; 
Note: See TracChangeset for help on using the changeset viewer.