Ignore:
Timestamp:
11/02/05 17:57:29 (19 years ago)
Author:
mattausch
Message:

fixed specular bug in trees
added batched query manager
added t information to ray bsp leaves

Location:
trunk/VUT/GtpVisibilityPreprocessor
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/scripts/Preprocessor.vcproj

    r361 r370  
    347347                        </File> 
    348348                </Filter> 
     349                <File 
     350                        RelativePath=".\VTune\Preprocessor.vpj"> 
     351                </File> 
    349352        </Files> 
    350353        <Globals> 
  • trunk/VUT/GtpVisibilityPreprocessor/scripts/default.env

    r367 r370  
    5656 
    5757Sampling { 
    58         totalSamples    300000 
     58        totalSamples    1000000 
    5959        samplesPerPass  3 
    6060} 
     
    8282        #       input fromViewCells 
    8383        #       input fromSceneGeometry 
    84                 samples 10000 
     84                samples 200000 
    8585                sideTolerance 0.005 
    8686        } 
     
    120120        #splitPlaneStrategy 130 
    121121         
    122         splitPlaneStrategy 1024 
     122        splitPlaneStrategy 130 
    123123         
    124124        maxCandidates 80 
     
    128128                maxRays 200 
    129129                maxPolygons 5 
    130                 maxDepth 100 
     130                maxDepth 50 
    131131                 
    132132                # axis aligned splits 
    133133                AxisAligned { 
    134134                        maxPolys 5000 
    135                         maxRays 5000 
    136                         maxObjects 2000 
     135                        maxRays 600 
     136                        maxObjects 20 
    137137                        maxCostRatio 0.9 
    138138                        ct_div_ci 0.5 
     
    145145         
    146146        PostProcessing { 
    147                 samples 100000 
     147                samples 200000 
    148148        } 
    149149                 
  • trunk/VUT/GtpVisibilityPreprocessor/src/Camera.cpp

    r362 r370  
    132132  ray.kdLeaves.clear(); 
    133133  ray.meshes.clear(); 
    134   ray.bspLeaves.clear(); 
     134  ray.bspIntersections.clear(); 
    135135 
    136136  ray.Init(mPosition, target, Ray::LOCAL_RAY); 
  • trunk/VUT/GtpVisibilityPreprocessor/src/Ray.h

    r369 r370  
    5656  }; 
    5757 
     58  struct BspIntersection { 
     59    // the point of intersection 
     60    float mT; 
     61 
     62    BspLeaf *mLeaf; 
     63 
     64    BspIntersection(const float t, BspLeaf *l): 
     65        mT(t), mLeaf(l) {} 
     66 
     67    BspIntersection() {} 
     68 
     69    bool operator<(const BspIntersection &b) const { 
     70      return mT <b.mT; } 
     71  }; 
    5872 
    5973  // I should have some abstract cell data type !!! here 
     
    6377   
    6478  vector<Intersection> intersections; 
    65   vector<BspLeaf *> bspLeaves; 
     79  vector<BspIntersection> bspIntersections; 
    6680  vector<KdLeaf *> kdLeaves; 
    6781  vector<MeshInstance *> meshes; 
  • trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp

    r369 r370  
    3434  ray.kdLeaves.clear(); 
    3535  ray.meshes.clear(); 
    36   ray.bspLeaves.clear(); 
     36  ray.bspIntersections.clear(); 
    3737 
    3838  //  cout<<point<<" "<<direction<<endl; 
     
    124124  
    125125        // object can be seen from the view cell => add to view cell pvs 
    126         for (j=0; j < ray.bspLeaves.size(); ++ j)  
    127         {       // if ray not in unbounded space 
    128                 if (ray.bspLeaves[j]->GetViewCell() != &mUnbounded) 
     126        for (j=0; j < ray.bspIntersections.size(); ++ j) 
     127        {        
     128                BspLeaf *leaf = ray.bspIntersections[j].mLeaf; 
     129                // if ray not in unbounded space 
     130                if (leaf->GetViewCell() != &mUnbounded) 
    129131                        contributingSamples +=  
    130                                 ray.bspLeaves[j]->GetViewCell()->GetPvs().AddSample(obj); 
     132                                leaf->GetViewCell()->GetPvs().AddSample(obj); 
    131133        } 
    132134  
    133135        // rays passing through this viewcell 
    134136        if (mPass > 1) 
    135                 for (j=1; j < ((int)ray.bspLeaves.size() - 1); ++ j)  
    136                 { 
    137                         BspLeaf *leaf = ray.bspLeaves[j]; 
     137                for (j=1; j < ((int)ray.bspIntersections.size() - 1); ++ j)  
     138                { 
     139                        BspLeaf *leaf = ray.bspIntersections[j].mLeaf; 
    138140 
    139141                        if (leaf->GetViewCell() != &mUnbounded) 
     
    679681        int merged = 0; 
    680682        RayContainer::const_iterator rit, rit_end = rays.end(); 
    681         vector<BspLeaf *>::const_iterator lit; 
     683        vector<Ray::BspIntersection>::const_iterator iit; 
    682684 
    683685        for (rit = rays.begin(); rit != rays.end(); ++ rit) 
     
    685687                // traverse leaves stored in the rays and compare and merge consecutive 
    686688                // leaves (i.e., the neighbors in the tree) 
    687                 if ((*rit)->bspLeaves.empty()) 
     689                if ((*rit)->bspIntersections.empty()) 
    688690                        continue; 
    689691 
    690                 lit = (*rit)->bspLeaves.begin(); 
    691  
    692                 BspLeaf *previousLeaf = *lit; 
    693                 ++ lit; 
    694                  
    695                 for (; lit != (*rit)->bspLeaves.end(); ++ lit) 
    696                 { 
    697                         BspLeaf *leaf = *lit; 
     692                iit = (*rit)->bspIntersections.begin(); 
     693 
     694                BspLeaf *previousLeaf = (*iit).mLeaf; 
     695                ++ iit; 
     696                 
     697                for (; iit != (*rit)->bspIntersections.end(); ++ iit) 
     698                { 
     699                        BspLeaf *leaf = (*iit).mLeaf; 
    698700 
    699701                        if (mBspTree->ShouldMerge(leaf, previousLeaf)) 
     
    784786                Ray *ray = mSampleRays[k]; 
    785787 
    786                 for (int j = 0; j < (int)ray->bspLeaves.size(); ++ j) 
    787                 { 
     788                for (int j = 0; j < (int)ray->bspIntersections.size(); ++ j) 
     789                { 
     790                        BspLeaf *leaf = ray->bspIntersections[j].mLeaf; 
     791 
    788792                        for (int i = 0; i < (int)bspLeaves.size(); ++ i) 
    789793                        { 
    790                                 if (bspLeaves[i]->GetViewCell() == ray->bspLeaves[j]->GetViewCell())  
     794                                if (bspLeaves[i]->GetViewCell() == leaf->GetViewCell())  
    791795                                { 
    792796                                        vcRays[i].push_back(*ray); 
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.cpp

    r367 r370  
    321321                } 
    322322 
    323                 ray->bspLeaves.push_back(this); 
     323                // warning: not ordered 
     324                ray->bspIntersections.push_back(Ray::BspIntersection((*it)->mMinT, this)); 
    324325        } 
    325326} 
     
    16211622                        if (!leaf->mViewCell->Mailed()) 
    16221623                        { 
    1623                                 ray.bspLeaves.push_back(leaf); 
     1624                                ray.bspIntersections.push_back(Ray::BspIntersection(maxt, leaf)); 
    16241625                                leaf->mViewCell->Mail(); 
    16251626                                ++ hits; 
     
    22992300 
    23002301        BoundedRayContainer::const_iterator rit, rit_end = rays.end(); 
    2301         vector<BspLeaf *>::const_iterator lit; 
     2302        vector<Ray::BspIntersection>::const_iterator iit; 
    23022303 
    23032304        ViewCell::NewMail(); 
     
    23072308                Ray *ray = (*rit)->mRay; 
    23082309                 
    2309                 for (lit = ray->bspLeaves.begin(); lit != ray->bspLeaves.end(); ++ lit) 
    2310                 { 
    2311                         if ((*lit)->mViewCell->Mailed()) 
     2310                for (iit = ray->bspIntersections.begin(); iit != ray->bspIntersections.end(); ++ iit) 
     2311                { 
     2312                        BspViewCell *vc = (*iit).mLeaf->mViewCell; 
     2313 
     2314                        if (vc->Mailed()) 
    23122315                        { 
    2313                                 pvsSize += (*lit)->mViewCell->GetPvs().GetSize(); 
     2316                                pvsSize += vc->GetPvs().GetSize(); 
    23142317                        } 
    23152318                } 
  • trunk/VUT/GtpVisibilityPreprocessor/src/default.env

    r369 r370  
    6161 
    6262ViewCells { 
    63         hierarchy kdTree 
    64         #hierarchy bspTree 
     63        #hierarchy kdTree 
     64        hierarchy bspTree 
    6565        # hierarchy sceneDependent 
    6666         
    6767        height 5.0 
    6868        maxViewCells 0 
     69         
     70        minPvsDif 100 
     71#       maxPvsSize 200 
    6972         
    7073#       filename ../data/atlanta/atlanta_viewcells_large.x3d 
     
    7477} 
    7578 
    76  
    77  
    78  
    7979BspTree { 
    8080        Construction { 
     
    8282        #       input fromViewCells 
    8383        #       input fromSceneGeometry 
    84                 samples 100000 
     84                samples 10000 
    8585                sideTolerance 0.005 
    8686        } 
     
    9797        # least ray splits     = 256 
    9898        # balanced rays        = 512 
     99        # pvs                  = 1024 
    99100 
    100101        # least splits + balanced polygons 
     
    119120        #splitPlaneStrategy 130 
    120121         
    121         splitPlaneStrategy 130 
     122        splitPlaneStrategy 1024 
    122123         
    123124        maxCandidates 80 
    124125         
    125126        Termination { 
    126         # autopartition 
    127                 maxRays 80 
    128                 maxPolygons 0 
     127                # autopartition 
     128                maxRays 200 
     129                maxPolygons 5 
    129130                maxDepth 100 
    130131                 
    131132                # axis aligned splits 
    132133                AxisAligned { 
    133                         maxPolys 500 
    134                         maxRays 300 
    135                         maxObjects 20 
     134                        maxPolys 5000 
     135                        maxRays 5000 
     136                        maxObjects 2000 
    136137                        maxCostRatio 0.9 
    137138                        ct_div_ci 0.5 
     
    142143                splitBorder 0.01 
    143144        } 
     145         
     146        PostProcessing { 
     147                samples 100000 
     148        } 
    144149                 
    145150        # if split polys are stored for visualization 
Note: See TracChangeset for help on using the changeset viewer.