Changeset 430 for trunk


Ignore:
Timestamp:
11/24/05 18:38:19 (19 years ago)
Author:
mattausch
Message:
 
Location:
trunk/VUT/GtpVisibilityPreprocessor
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/scripts/default.env

    r428 r430  
    1010#       filename ../data/vienna/vienna-simple.x3d 
    1111#       filename ../data/vienna/vienna-buildings.x3d 
     12#filename ../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d 
     13#;../data/vienna/vienna-plane.x3d 
    1214#       filename ../data/vienna/viewcells-25-sel.x3d 
    1315        filename ../data/atlanta/atlanta2.x3d 
     
    1618} 
    1719 
     20Preprocessor { 
     21#       type sampling 
     22        type vss 
     23} 
     24 
     25VssPreprocessor { 
     26        samplesPerPass  100000 
     27        initialSamples 200000 
     28        vssSamples 300000 
     29        vssSamplesPerPass 100000 
     30        useImportanceSampling true 
     31} 
     32 
     33VssTree { 
     34        epsilon         1e-6 
     35 
     36        maxDepth        40 
     37        minPvs          3 
     38        minRays         100 
     39        minSize         0.001 
     40  maxCostRatio  0.98 
     41        maxRayContribution 0.05 
     42         
     43        maxTotalMemory  200 
     44        maxStaticMemory 50 
     45 
     46        splitType regular 
     47#       splitType heuristics 
     48 
     49        numberOfEndPointDomains 10000 
     50        ct_div_ci       0.0 
     51        randomize       false 
     52 
     53        refDirBoxMaxSize        0.1 
     54} 
     55 
    1856Limits { 
    1957 
     
    2361} 
    2462 
    25 Preprocessor { 
    26         type sampling 
    27 #       type exact 
    28 #       type vss 
    29 } 
    30  
    3163Unigraphics { 
    3264                meshGrouping 1 
     
    3668        sahUseFaces true 
    3769        Termination { 
    38                 minCost 2 
     70                minCost 1 
    3971                maxDepth 18 
    4072                maxCostRatio 0.9 
     
    4981MeshKdTree { 
    5082        Termination { 
    51                 minCost 4 
     83                minCost 1 
    5284                maxDepth 18 
    5385                maxCostRatio 0.9 
     
    6294 
    6395Sampling { 
    64         totalSamples    600000 
     96        totalSamples 600000 
    6597        samplesPerPass  3 
    6698} 
     
    68100ViewCells { 
    69101        #hierarchy kdTree 
    70         hierarchy vspTree 
    71         #hierarchy bspTree 
    72         # hierarchy sceneDependent 
     102        #hierarchy vspTree 
     103        hierarchy bspTree 
     104        #hierarchy sceneDependent 
    73105         
    74106        height 5.0 
     
    196228 
    197229        maxDepth        40 
    198         minPvs          1 
     230        minPvs          100 
    199231        minRays         50 
    200232        minSize         0.00001 
     
    223255         
    224256        Termination { 
    225                 maxDepth        30 
    226                 minPvs          60 
    227                 minRays         1 
    228                 minSize         0.1 
    229                 maxCostRatio    999.0 
    230                 maxRayContribution 0.2 
     257                maxDepth                10 
     258                minPvs                  500 
     259                minRays                 1 
     260                minSize                 0.1 
     261                maxCostRatio            999.0 
     262                maxRayContribution      0.2 
    231263        } 
    232264         
     
    234266        maxStaticMemory 600 
    235267 
    236         splitType regular 
    237 #       splitType heuristics 
     268        splitType       regular 
     269        #splitType      heuristics 
    238270        ct_div_ci       0.0 
    239271} 
  • trunk/VUT/GtpVisibilityPreprocessor/src/Ray.cpp

    r428 r430  
    223223loc(vssRay.mOrigin), 
    224224sourceObject(0, vssRay.mOriginObject, 0), 
    225 dir(vssRay.GetDir()) 
     225dir(Normalize(vssRay.GetDir())) 
    226226{ 
    227227        intersections.push_back(Intersection(vssRay.mT, vssRay.mTerminationObject, 0)); 
  • trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp

    r429 r430  
    574574                int pvsSize = 0; 
    575575 
     576                Debug << "overall scene size: " << (int)objects.size() << endl; 
     577                 
    576578                BspViewCellsStatistics stat; 
    577                  
    578                 Debug << "overall scene size: " << (int)objects.size() << endl; 
    579579                mBspTree->EvaluateViewCellsStats(stat); 
    580                  
    581580                Debug << "original view cell partition:\n" << stat << endl; 
    582581                 
     
    820819        { 
    821820                // store samples for vsp kd tree construction 
    822                 if ((object || !ray.intersections.empty()) &&  
    823                         ((int)mVspSampleRays.size() < mVspConstructionSamples)) 
    824                 { 
    825                         ray.sourceObject = Ray::Intersection(0.0, object, faceIndex); 
    826                         VssRay *sRay = new VssRay(ray); 
    827                         mVspSampleRays.push_back(sRay); 
     821                if ((int)mVspSampleRays.size() < mVspConstructionSamples) 
     822                { 
     823                        if (object || !ray.intersections.empty()) 
     824                        { 
     825                                ray.sourceObject = Ray::Intersection(0.0, object, faceIndex); 
     826                                VssRay *sRay = new VssRay(ray); 
     827                                mVspSampleRays.push_back(sRay); 
     828                        } 
    828829                } 
    829830                else 
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.cpp

    r419 r430  
    2424                return new BspViewCell(mesh); 
    2525        default: 
    26                 Debug << "should not come here" << endl; 
     26                Debug << "should not come here 3" << endl; 
    2727                return NULL; 
    2828        } 
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.cpp

    r428 r430  
    308308        environment->GetIntValue("BspTree.Termination.AxisAligned.minPolys",  
    309309                                                         mTermMinPolysForAxisAligned); 
    310         environment->GetIntValue("BspTree.Termination.AxisAligned.maxRays",  
     310        environment->GetIntValue("BspTree.Termination.AxisAligned.minRays",  
    311311                                                         mTermMinRaysForAxisAligned); 
    312         environment->GetIntValue("BspTree.Termination.AxisAligned.maxObjects",  
     312        environment->GetIntValue("BspTree.Termination.AxisAligned.minObjects",  
    313313                                                         mTermMinObjectsForAxisAligned); 
    314314        //-- partition criteria 
     
    15531553                                                break; 
    15541554                                        default: 
    1555                                                 Debug << "Should not come here" << endl; 
     1555                                                Debug << "Should not come here 2" << endl; 
    15561556                                                break; 
    15571557                                } 
     
    20932093                        break; 
    20942094                default: 
    2095                         Debug << "Should not come here" << endl; 
     2095                        Debug << "Should not come here 4" << endl; 
    20962096                        break; 
    20972097                } 
  • trunk/VUT/GtpVisibilityPreprocessor/src/VssPreprocessor.cpp

    r429 r430  
    423423        } 
    424424 
    425  
     425        //-- construct BSP view cells 
     426        if (ViewCell::sHierarchy == ViewCell::BSP)  
     427        { 
     428                const int bspSamples = min((int)mVssRays.size(), mBspConstructionSamples); 
     429         
     430                for (int i = 0; i < bspSamples; ++ i) 
     431                        bspRays.push_back(new Ray(*mVssRays[i])); 
     432 
     433                //-- construct BSP tree using the samples 
     434                mBspTree = new BspTree(&mUnbounded);     
     435 
     436                mBspTree->SetGenerateViewCells(true); 
     437                mBspTree->Construct(bspRays); 
     438 
     439                Exporter *exporter = Exporter::GetExporter("vccbsprays.x3d"); 
     440                         
     441                // export rays piercing this view cell 
     442                exporter->ExportRays(bspRays, 1000, RgbColor(0, 1, 0)); 
     443 
     444                // cast remaining initial rays into BSP tree 
     445                for (int i = bspSamples; i < (int)mVssRays.size(); ++ i) 
     446                        CastRay(*mBspTree, *mVssRays[i]); 
     447        } 
    426448 
    427449        vssTree = new VssTree; 
    428          
    429         const int bspSamples = min((int)mVssRays.size(), mBspConstructionSamples); 
    430          
    431         for (int i = 0; i < bspSamples; ++ i) 
    432                 bspRays.push_back(new Ray(*mVssRays[i])); 
    433  
    434         mBspTree = new BspTree(&mUnbounded);     
    435  
    436         mBspTree->SetGenerateViewCells(true); 
    437         mBspTree->Construct(bspRays); 
    438  
    439         for (int i = bspSamples; i < (int)mVssRays.size(); ++ i) 
    440         { 
    441                 CastRay(*mBspTree, *mVssRays[i]); 
    442         } 
    443450 
    444451        vssTree->Construct(mVssRays, mViewSpaceBox); 
     
    486493                } 
    487494 
    488                  
    489                 for (int i = 0; i < (int)vssRays.size(); ++ i) 
     495                // cast rays into BSP tree 
     496                if (ViewCell::sHierarchy == ViewCell::BSP)  
    490497                { 
    491                         CastRay(*mBspTree, *mVssRays[i]); 
    492                 } 
    493                  
     498                        for (int i = 0; i < (int)vssRays.size(); ++ i) 
     499                        { 
     500                                CastRay(*mBspTree, *mVssRays[i]); 
     501                        } 
     502                } 
     503 
    494504                samples+=num; 
    495505                float pvs = vssTree->GetAvgPvsSize(); 
     
    505515        delete vssTree; 
    506516 
    507         ObjectContainer objects; 
    508         ExportSplits(objects, bspRays, 10000); 
    509         ExportBspPvs(objects, bspRays, 10000); 
    510  
    511         CLEAR_CONTAINER(bspRays); 
     517        if (ViewCell::sHierarchy == ViewCell::BSP)  
     518        { 
     519                Debug << mBspTree->GetStatistics(); 
     520 
     521                ObjectContainer objects; 
     522                ExportSplits(objects, bspRays, 10000); 
     523                ExportBspPvs(objects, bspRays, 10000); 
     524 
     525                BspViewCellsStatistics stat; 
     526                mBspTree->EvaluateViewCellsStats(stat); 
     527                Debug << "original view cell partition:\n" << stat << endl; 
     528 
     529                // clear BSP samples 
     530                CLEAR_CONTAINER(bspRays); 
     531        } 
    512532 
    513533        return true; 
     
    519539        Ray ray(vssRay); 
    520540 
     541        /*Debug << ray << endl; 
     542        if (ray.intersections.empty()) 
     543                Debug << "empty ray" << endl; 
     544        else  
     545                Debug << "intersection: " << ray.intersections[0].mT << " " << ray.intersections[0].mObject << endl; 
     546*/ 
    521547        mBspTree->CastRay(ray); 
    522548                                 
  • trunk/VUT/GtpVisibilityPreprocessor/src/VssRay.h

    r429 r430  
    7676                if (!ray.intersections.empty()) 
    7777                { 
    78                         mTermination = ray.Extrap(ray.intersections[0].mT); 
     78                        mT = ray.intersections[0].mT; 
     79                        mTermination = ray.Extrap(mT); 
    7980                        mTerminationObject = ray.intersections[0].mObject; 
    8081                } 
    8182                else 
    8283                { 
    83                         mTermination = mOrigin + ray.GetDir() * 99999; 
     84                        mT = 1e6;//Limits::Infinity; 
     85                        mTermination = mOrigin + ray.GetDir() * mT; 
    8486                        mTerminationObject = NULL; 
    8587                } 
  • trunk/VUT/GtpVisibilityPreprocessor/src/VssTree.cpp

    r427 r430  
    986986                                (*ri).mRay->Unref(); 
    987987 
     988                                Debug << "computed t: " << (*ri).mRay->mT << endl; 
    988989                                // determine the side of this ray with respect to the plane 
    989990                                int side = node->ComputeRayIntersection(*ri, (*ri).mRay->mT); 
  • trunk/VUT/GtpVisibilityPreprocessor/src/default.env

    r427 r430  
    9999 
    100100ViewCells { 
    101         hierarchy kdTree 
     101        #hierarchy kdTree 
     102        hierarchy vspTree 
    102103        #hierarchy bspTree 
    103104        # hierarchy sceneDependent 
     
    106107        maxViewCells 0 
    107108         
     109        PostProcessing { 
    108110        minPvsDif 100 
    109 #       maxPvsSize 200 
     111                minPvs 10 
     112                maxPvs 150 
     113                samples 100000 
     114        } 
     115 
    110116         
    111117#       filename ../data/atlanta/atlanta_viewcells_large.x3d 
     
    117123BspTree { 
    118124        Construction { 
    119                 input fromRays 
     125                input fromSamples 
    120126        #       input fromViewCells 
    121127        #       input fromSceneGeometry 
    122                 samples 100000 
     128                samples 150000 
    123129                sideTolerance 0.005 
    124130        } 
     
    158164        #splitPlaneStrategy 130 
    159165         
    160         splitPlaneStrategy 1024 
    161          
    162         maxCandidates 80 
    163          
    164         Termination { 
    165                 # autopartition 
    166                 maxRays 200 
    167                 maxPolygons 5 
    168                 maxDepth 100 
     166        splitPlaneStrategy 12 
     167         
     168        maxPolyCandidates 70 
     169        maxRayCandidates 100 
     170         
     171        # factors for evaluating split plane costs 
     172        Factor { 
     173                verticalSplits 1.0 
     174                largestPolyArea 1.0 
     175                blockedRays 1.0 
     176                leastRaySplits 1.0 
     177                balancedRays 1.0 
     178                pvsFactor 1.0 
     179                leastSplits 1.0 
     180                balancedPolys 1.0 
     181                balancedViewCells 1.0 
     182        } 
     183         
     184        Termination { 
     185                # parameters used for autopartition 
     186                minRays 200 
     187                minPolygons -1 
     188                maxDepth 40 
     189                minPvs 35 
     190                minArea 0.01 
     191                maxRayContribution 0.005 
     192                #maxAccRayLength 100 
     193                 
     194                # used for pvs criterium 
     195                ct_div_ci 0.0 
    169196                 
    170197                # axis aligned splits 
    171198                AxisAligned { 
    172                         maxPolys 5000 
    173                         maxRays 5000 
    174                         maxObjects 2000 
     199                        minPolys 5000 
     200                        minRays 500 
     201                        minObjects 10 
    175202                        maxCostRatio 0.9 
    176203                        ct_div_ci 0.5 
     
    182209        } 
    183210         
    184         PostProcessing { 
    185                 samples 100000 
    186         } 
    187211                 
    188         # if split polys are stored for visualization 
    189         storeSplitPolys false 
     212        Visualization { 
    190213        # x3d visualization of the split planes 
    191214        exportSplits true 
    192 } 
     215                # how much samples should be used in visualization 
     216                samples 20000 
     217        } 
     218} 
     219 
     220Simulation { 
     221        objRenderCost 1.0 
     222        vcOverhead 7.0 
     223        moveSpeed 3.0 
     224} 
     225 
     226VssTree { 
     227        epsilon         1e-6 
     228 
     229        maxDepth        40 
     230        minPvs          1 
     231        minRays         50 
     232        minSize         0.00001 
     233        maxCostRatio    0.95 
     234        maxRayContribution 0.05 
     235         
     236        maxTotalMemory  400 
     237        maxStaticMemory 20 
     238 
     239        splitType regular 
     240#       splitType heuristics 
     241 
     242        numberOfEndPointDomains 10000 
     243        ct_div_ci       0.0 
     244        randomize       false 
     245 
     246        refDirBoxMaxSize        0.1 
     247} 
     248 
     249VspKdTree { 
     250        epsilon         1e-6 
     251 
     252        Construction { 
     253                samples 500000 
     254        } 
     255         
     256        Termination { 
     257                maxDepth        30 
     258                minPvs          60 
     259                minRays         1 
     260                minSize         0.1 
     261                maxCostRatio    999.0 
     262                maxRayContribution 0.2 
     263        } 
     264         
     265        maxTotalMemory  600 
     266        maxStaticMemory 600 
     267 
     268        splitType regular 
     269#       splitType heuristics 
     270        ct_div_ci       0.0 
     271} 
Note: See TracChangeset for help on using the changeset viewer.