Changeset 2741


Ignore:
Timestamp:
06/06/08 09:58:57 (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/run_gvs_vps.sh

    r2740 r2741  
    1414SCENE=../data/Arena/arena_trees.obj 
    1515#VIEWCELLS=../data/Arena/arena-high-lods-5000-viewcells.xml.gz 
    16 #SCENE=../data/vienna/2vienna_cropped.obj 
     16#SCENE=../data/vienna/vienna_cropped.obj 
    1717#SCENE=../data/roofs_new.obj 
    1818SCENE=../data/vienna/city_full_hp.obj 
    19 #SCENE=../data/vienna/vienna_rep.obj 
     19SCENE=../data/vienna/vienna_rep.obj 
     20#SCENE=../data/vienna/vienna_cropped.obj 
    2021 
    21 SCENE=../data/vienna/vienna_cropped.obj 
    2222VIEWCELLS=../data/vienna/vienna_cropped-gradient-viewcells.xml.gz  
    2323VIEWPOINTS=../data/vienna/testwalk.vp 
     
    2525 
    2626#LOG_PREFIX=../src/SG08/rebut-arena-pixel2 
    27 LOG_PREFIX=../src/SG08/test_jitter_0.1 
     27LOG_PREFIX=../src/SG08/test 
    2828 
    2929ENVIRONMENT=gvs.env 
     
    4343-gvs_initial_samples=16 \ 
    4444-gvs_max_viewcells=1 \ 
    45 -gvs_min_contribution=200 \ 
     45-gvs_min_contribution=50 \ 
    4646-gvs_per_viewcell=true \ 
    4747-gvs_radius_of_influence=5.0 \ 
  • GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp

    r2740 r2741  
    234234        simpleRays.clear(); 
    235235 
    236         CreateRandomizedReverseRays(currentRay.mOrigin, predictedHit, hitTriangle, simpleRays, 16); 
     236        CreateRandomizedReverseRays(currentRay, predictedHit, simpleRays, 16); 
    237237 
    238238        static VssRayContainer reverseRays; 
     
    679679 
    680680 
    681 #if 0 
     681#if 1 
    682682        for (size_t i = 0; i < vssRays.size(); ++ i) 
    683683        { 
     
    15771577                         
    15781578                        // compute the pixel error of this visibility solution 
    1579                         if (0 && mEvaluatePixelError) 
     1579                        if (1 && mEvaluatePixelError) 
    15801580                                ComputeRenderError(); 
    15811581                } 
     
    20402040 
    20412041 
    2042 void GvsPreprocessor::CreateRandomizedReverseRays(const Vector3 &origin,  
    2043                                                                                                   const Vector3 &termination,  
    2044                                                                                                   const Triangle3 &triangle,                    
     2042void GvsPreprocessor::CreateRandomizedReverseRays(const VssRay &ray,  
     2043                                                                                                  const Vector3 &predictedPoint,  
    20452044                                                                                                  SimpleRayContainer &rays,  
    20462045                                                                                                  int number) 
     
    20522051        while (((rays.size() - currentNumber) < number) && (tries ++ < 20)) 
    20532052        { 
    2054                 SimpleRay ray; 
    2055                 if (CreateRandomizedReverseRay(origin, termination, triangle, ray)) 
    2056                         rays.push_back(ray); 
     2053                SimpleRay simpleRay; 
     2054                if (CreateRandomizedReverseRay(ray, predictedPoint, simpleRay)) 
     2055                        rays.push_back(simpleRay); 
    20572056        } 
    20582057 
     
    20612060 
    20622061 
    2063 bool GvsPreprocessor::CreateRandomizedReverseRay(const Vector3 &origin,  
    2064                                                                                                  const Vector3 &termination,  
    2065                                                                                                  const Triangle3 &triangle,                    
    2066                                                                                                  SimpleRay &ray) 
    2067 { 
    2068         //Vector3 nd = triangle.GetNormal(); 
     2062bool GvsPreprocessor::CreateRandomizedReverseRay(const VssRay &ray,  
     2063                                                                                                 const Vector3 &predictedPoint,  
     2064                                                                                                 SimpleRay &simpleRay) 
     2065{ 
     2066        //Vector3 nd = ray.GetNormalizedDir(); 
    20692067        const AxisAlignedBox3 box = mCurrentViewCell->GetBox(); 
    2070         Vector3 nd = box.GetNearestFace(origin).GetNormal(); 
     2068        //Vector3 nd = box.GetNearestFace(origin).GetNormal(); 
    20712069        //cout << "pt: " << origin << " face: " << box.GetNearestFace(origin) << endl; 
    2072         nd.Normalize(); 
    20732070 
    20742071        // Compute right handed coordinate system from direction 
    2075         Vector3 U, V; 
     2072        /*Vector3 U, V; 
    20762073        nd.RightHandedBase(U, V); 
    20772074         
     
    20822079 
    20832080        Vector2 vr2(rr[0], rr[1]); 
    2084         const float sigma = triangle.GetBoundingBox().Radius() * mRadiusOfInfluence; 
     2081        const float sigma = 1.0f;//triangle.GetBoundingBox().Radius() * mRadiusOfInfluence; 
    20852082        Vector2 gaussvec2; 
    20862083 
     
    20902087        const Vector3 shift = gaussvec2.xx * U + gaussvec2.yy * V; 
    20912088 
    2092         Vector3 newOrigin = origin + shift; 
     2089        Vector3 newOrigin = ray.mOrigin + shift; 
     2090        */ 
    20932091        //cout << "o: " << origin << " new o: " << newOrigin << endl; 
    2094  
    2095         Vector3 direction = termination - newOrigin; 
     2092        Vector3 newOrigin = box.GetRandomPoint(); 
     2093        Vector3 direction = predictedPoint - newOrigin; 
    20962094 
    20972095        const float len = Magnitude(direction); 
     
    21022100        direction /= len; 
    21032101 
    2104         if (!IntersectsViewCell(newOrigin, -direction)) 
     2102        if (0 && !IntersectsViewCell(newOrigin, -direction)) 
    21052103        { 
    21062104                //cout << "x"; 
     
    21112109        // $$ jb the pdf is yet not correct for all sampling methods! 
    21122110        const float pdf = 1.0f; 
    2113         ray = SimpleRay(newOrigin, direction, SamplingStrategy::GVS, pdf); 
     2111        simpleRay = SimpleRay(newOrigin, direction, SamplingStrategy::GVS, pdf); 
    21142112         
    21152113        return true; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.h

    r2740 r2741  
    297297        void PrepareProbablyVisibleSampling(); 
    298298         
    299         void CreateRandomizedReverseRays(const Vector3 &origin,  
    300                                              const Vector3 &termination,  
    301                                                                          const Triangle3 &triangle,                    
     299        void CreateRandomizedReverseRays(const VssRay &ray,  
     300                                             const Vector3 &predictedPoint,  
    302301                                                                         SimpleRayContainer &rays,  
    303302                                                                         int number); 
    304303 
    305         bool CreateRandomizedReverseRay(const Vector3 &origin,  
    306                                             const Vector3 &termination, 
    307                                                                         const Triangle3 &triangle, 
    308                                                                         SimpleRay &ray); 
     304        bool CreateRandomizedReverseRay(const VssRay &ray,  
     305                                            const Vector3 &predictedPoint, 
     306                                                                        SimpleRay &simpleray); 
    309307 
    310308        inline bool IntersectsViewCell(Vector3 &origin, const Vector3 &dir) const; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp

    r2738 r2741  
    257257                GLfloat mat_ambient[] = {0.5f, 0.5f, 0.5f, 1.0f}; 
    258258                GLfloat mat_diffuse[] = {1.0f, 1.0f, 1.0f, 1.0f}; 
    259                 GLfloat mat_specular[] = {0.3f, 0.3f, 0.3f, 1.0f}; 
     259                GLfloat mat_specular[] = {0.5f, 0.5f, 0.5f, 1.0f}; 
    260260                GLfloat mat_shininess[] = {1.0f}; 
    261261 
     
    285285                glEnable(GL_COLOR_MATERIAL); 
    286286 
    287                 GLfloat lmodel_ambient[] = {0.3f, 0.3f, 0.3f, 1.0f}; 
    288                 glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); 
     287                GLfloat lmodel_ambient[] = {0.5f, 0.5f, 0.5, 1.0f}; 
     288                //glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); 
    289289 
    290290                glShadeModel(GL_SMOOTH); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp

    r2735 r2741  
    829829        { 
    830830                //mViewCell->GetRandomEdgePoint(origin, normal); 
    831                 origin = mViewCell->GetBox().GetRandomSurfacePoint(); 
     831                //origin = mViewCell->GetBox().GetRandomSurfacePoint(); 
     832                origin = mViewCell->GetBox().GetRandomPoint(); 
    832833 
    833834                // move a little bit back to avoid piercing through walls 
Note: See TracChangeset for help on using the changeset viewer.