Ignore:
Timestamp:
01/25/06 01:44:46 (18 years ago)
Author:
mattausch
Message:

finished function for view cell construction
removed bsp rays from vspbspmanager

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp

    r573 r574  
    2020ViewCellsManager::ViewCellsManager(): 
    2121mRenderer(NULL), 
     22mInitialSamples(0), 
    2223mConstructionSamples(0), 
    2324mPostProcessSamples(0), 
     
    3536 
    3637 
    37 ViewCellsManager::ViewCellsManager(int constructionSamples): 
    38 mConstructionSamples(constructionSamples), 
    39 mRenderer(NULL), 
    40 mPostProcessSamples(0), 
    41 mVisualizationSamples(0), 
    42 mTotalAreaValid(false), 
    43 mTotalArea(0.0f), 
    44 mViewCellsFinished(false), 
    45 mMaxPvsSize(9999999), 
    46 mMinPvsSize(0), // one means only empty view cells are invalid 
    47 mMaxPvsRatio(1.0) 
    48 { 
    49         mViewSpaceBox.Initialize(); 
    50         ParseEnvironment(); 
    51 } 
    52  
    53  
    5438void ViewCellsManager::ParseEnvironment() 
    5539{ 
     
    6145        environment->GetBoolValue("ViewCells.pruneEmptyViewCells", emptyViewCells); 
    6246        environment->GetBoolValue("ViewCells.processOnlyValidViewCells", mOnlyValidViewCells); 
     47 
     48        environment->GetIntValue("ViewCells.Construction.samples", mConstructionSamples); 
     49        environment->GetIntValue("ViewCells.PostProcess.samples", mPostProcessSamples); 
     50        environment->GetIntValue("ViewCells.Visualization.samples", mVisualizationSamples); 
     51 
     52        environment->GetIntValue("ViewCells.Construction.samplesPerPass", mSamplesPerPass); 
    6353 
    6454        mMinPvsSize = emptyViewCells ? 1 : 0; 
     
    8878 
    8979 
    90 int ViewCellsManager::CastPassSamples(int samplesPerPass,  
    91                                                                           int sampleType,  
    92                                                                           VssRayContainer *outRays) const 
    93 { 
    94         VssRayContainer passSamples; 
     80int ViewCellsManager::CastPassSamples(const int samplesPerPass,  
     81                                                                          const int sampleType,  
     82                                                                          VssRayContainer &passSamples) const 
     83{ 
    9584        SimpleRayContainer simpleRays; 
    9685 
     
    10291        preprocessor->CastRays(simpleRays, passSamples); 
    10392 
    104         const int numSamples = (int)passSamples.size(); 
    105  
     93        return (int)passSamples.size(); 
     94} 
     95 
     96 
     97/// helper function which destroys rays or copies them into the output ray container 
     98inline void addOutRays(VssRayContainer &rays, VssRayContainer *outRays) 
     99{ 
     100        cout << "disposing samples ... "; 
    106101        if (outRays) 
    107102        { 
    108                 while (!passSamples.empty()) 
    109                         outRays->push_back(passSamples.back()); 
     103                VssRayContainer::const_iterator it, it_end = rays.end(); 
     104 
     105                for (it = rays.begin(); it != it_end; ++ it) 
     106                { 
     107                        outRays->push_back(*it); 
     108                } 
    110109        } 
    111110        else 
    112111        { 
    113                 CLEAR_CONTAINER(passSamples); 
    114         } 
    115  
    116         return numSamples; 
     112                CLEAR_CONTAINER(rays); 
     113        } 
     114        cout << "finished" << endl; 
    117115} 
    118116 
     
    123121        SimpleRayContainer simpleRays; 
    124122         
    125         VssRayContainer constructionSamples; 
    126  
     123        VssRayContainer initialSamples; 
     124 
     125        cout << "view cell construction: casting " << mInitialSamples << " initial samples ... "; 
    127126        //-- construction rays => we use uniform samples for this 
    128         CastPassSamples(mConstructionSamples,  
    129                                         Preprocessor::SPATIAL_BOX_BASED_DISTRIBUTION,  
    130                                         &constructionSamples); 
     127        CastPassSamples(mInitialSamples,  
     128                                        Preprocessor::DIRECTION_BASED_DISTRIBUTION, 
     129                                        //Preprocessor::SPATIAL_BOX_BASED_DISTRIBUTION,  
     130                                        initialSamples); 
    131131         
     132        cout << "finished" << endl; 
     133 
    132134        // construct view cells 
    133         const int initialSamples = Construct(preprocessor->mObjects, constructionSamples); 
    134  
    135         numSamples += initialSamples; 
    136  
    137         if (outRays) 
    138         { 
    139                 while (!constructionSamples.empty()) 
    140                         outRays->push_back(constructionSamples.back()); 
    141         } 
    142         else 
    143         { 
    144                 CLEAR_CONTAINER(constructionSamples); 
    145         } 
    146  
     135        const int numInitialSamples =  
     136                ConstructSubdivision(preprocessor->mObjects, initialSamples); 
     137 
     138        numSamples += numInitialSamples; 
     139 
     140        // rays can be passed or deleted 
     141        addOutRays(initialSamples, outRays); 
     142         
    147143 
    148144        //-- guided rays are used for further sampling 
    149         const int desiredImportanceSamples = 5000000; 
    150         const int importanceRayPerPass = 1000000; 
    151  
    152         const int n = desiredImportanceSamples; //+initialSamples; 
     145        const int n = mConstructionSamples; //+initialSamples; 
     146 
     147        bool dirSamples = false; 
    153148 
    154149        while (numSamples < n) 
    155150        { 
    156                 numSamples += CastPassSamples(importanceRayPerPass,  
    157                                                                           Preprocessor::RSS_BASED_DISTRIBUTION,  
    158                                                                           //Preprocessor::SPATIAL_BOX_BASED_DISTRIBUTION, 
    159                                                                           outRays); 
     151                cout << "casting " << mSamplesPerPass << " samples ... "; 
     152                VssRayContainer constructionSamples; 
     153 
     154                const int samplingType =  
     155                        dirSamples ?  
     156                                                Preprocessor::DIRECTION_BASED_DISTRIBUTION : 
     157                                                Preprocessor::SPATIAL_BOX_BASED_DISTRIBUTION; 
     158 
     159                dirSamples = !dirSamples; // toggle sampling 
     160                numSamples += CastPassSamples(mSamplesPerPass,  
     161                                                                          samplingType, 
     162                                                                          constructionSamples); 
     163 
     164                cout << "finished" << endl; 
     165 
     166                cout << "computing sample contribution for " << (int)constructionSamples.size() << " samples ... "; 
     167 
     168                // TODO: leak? 
     169                ComputeSampleContributions(constructionSamples, true, false); 
     170                cout << "finished" << endl; 
     171 
     172 
     173                addOutRays(constructionSamples, outRays); 
     174 
     175                cout << "total samples: " << numSamples << endl; 
    160176        } 
    161177         
     
    165181 
    166182        //-- construction rays => we use uniform samples for this 
    167         CastPassSamples(max(mPostProcessSamples, mVisualizationSamples), 
    168                                     Preprocessor::SPATIAL_BOX_BASED_DISTRIBUTION,  
    169                                         &postProcessSamples); 
     183        CastPassSamples(mPostProcessSamples, 
     184                                    Preprocessor::DIRECTION_BASED_DISTRIBUTION,  
     185                                        postProcessSamples); 
    170186         
     187        cout << "starting post processing and visualization" << endl; 
     188 
     189        // store viewCells for postprocessing 
     190        const bool storeViewCells = true; 
     191        ComputeSampleContributions(postProcessSamples, true, storeViewCells); 
    171192        // merge the view cells 
    172193        PostProcess(preprocessor->mObjects, postProcessSamples); 
    173         // several visualizations 
    174         Visualize(preprocessor->mObjects, postProcessSamples); 
    175  
    176         if (outRays) 
    177         { 
    178                 while (!postProcessSamples.empty()) 
    179                         outRays->push_back(postProcessSamples.back()); 
    180         } 
    181         else 
    182         { 
    183                 CLEAR_CONTAINER(postProcessSamples); 
    184         } 
     194 
     195 
     196        //-- visualization 
     197        VssRayContainer visualizationSamples; 
     198 
     199        //-- construction rays => we use uniform samples for this 
     200        CastPassSamples(mVisualizationSamples, 
     201                                    Preprocessor::DIRECTION_BASED_DISTRIBUTION,  
     202                                        visualizationSamples); 
     203 
     204        ComputeSampleContributions(visualizationSamples, true, storeViewCells); 
     205 
     206        //Debug << "visualizationsamples: " << mVisualizationSamples << " " << visualizationSamples.size() << endl; 
     207        // different visualizations 
     208        Visualize(preprocessor->mObjects, visualizationSamples); 
     209 
     210        addOutRays(visualizationSamples, outRays); 
    185211 
    186212        return numSamples; 
     
    293319float 
    294320ViewCellsManager::ComputeSampleContributions(const VssRayContainer &rays, 
    295                                                                                          const bool addRays 
     321                                                                                         const bool addRays, 
     322                                                                                         const bool storeViewCells 
    296323                                                                                         ) 
    297324{ 
     
    304331  float sum = 0.0f; 
    305332  for (it = rays.begin(); it != it_end; ++ it) { 
    306         sum += ComputeSampleContributions(*(*it), addRays); 
     333        sum += ComputeSampleContributions(*(*it), addRays, storeViewCells); 
    307334        //ComputeSampleContributions(*(*it), addRays); 
    308335        //      sum += (*it)->mPvsContribution; 
     
    466493{ 
    467494        mConstructionSamples = constructionSamples; 
     495} 
     496 
     497 
     498void ViewCellsManager::SetInitialSamples(const int initialSamples) 
     499{ 
     500        mInitialSamples = initialSamples; 
    468501} 
    469502 
     
    554587{ 
    555588        mViewCells.clear(); 
    556  
    557589        CollectViewCells(); 
    558590 
     
    610642} 
    611643 
     644 
    612645float ViewCellsManager::ComputeSampleContributions(VssRay &ray, 
    613                                                                                                    const bool addRays) 
     646                                                                                                   const bool addRays, 
     647                                                                                                   const bool storeViewCells) 
    614648{ 
    615649        ViewCellContainer viewcells; 
     
    635669 
    636670        // copy viewcells memory efficiently 
    637         const bool storeViewcells = !addRays; 
    638  
    639         if (storeViewcells) 
     671        //const bool storeViewcells = !addRays; 
     672 
     673        if (storeViewCells) 
    640674        { 
    641675                ray.mViewCells.reserve(viewcells.size()); 
     
    732766        for (it = mViewCells.begin(); it != it_end; ++ it) 
    733767        { 
    734                 ExportColor(exporter, *it); 
    735                 ExportVcGeometry(exporter, *it); 
     768                if (!mOnlyValidViewCells || (*it)->GetValid()) 
     769                { 
     770                        ExportColor(exporter, *it); 
     771                        ExportVcGeometry(exporter, *it); 
     772                } 
    736773        } 
    737774} 
     
    778815 
    779816 
    780 BspViewCellsManager::BspViewCellsManager(BspTree *bspTree, 
    781                                                                                  int constructionSamples): 
    782 ViewCellsManager(constructionSamples), 
    783 mBspTree(bspTree) 
    784 { 
     817BspViewCellsManager::BspViewCellsManager(BspTree *bspTree): 
     818ViewCellsManager(), mBspTree(bspTree) 
     819{ 
     820        environment->GetIntValue("BspTree.Construction.samples", mInitialSamples); 
    785821} 
    786822 
     
    798834 
    799835 
    800 int BspViewCellsManager::Construct(const ObjectContainer &objects, 
    801                                                                    const VssRayContainer &rays) 
     836int BspViewCellsManager::ConstructSubdivision(const ObjectContainer &objects, 
     837                                                                                          const VssRayContainer &rays) 
    802838{ 
    803839        // if view cells were already constructed 
     
    811847        VssRayContainer savedRays; 
    812848 
    813         const int limit = min(mConstructionSamples, (int)rays.size()); 
     849        const int limit = min(mInitialSamples, (int)rays.size()); 
    814850 
    815851        VssRayContainer::const_iterator it, it_end = rays.end(); 
     
    846882 
    847883        // recast rest of the rays 
    848         ComputeSampleContributions(savedRays); 
     884        ComputeSampleContributions(savedRays, true, false); 
    849885 
    850886 
     
    937973 
    938974 
    939         // $$JB we do not have connectivity information from the ray in the moment 
    940         // perhaps we could recast the rays or remember the cells traversed inside the 
    941         // vssray (which would on other hand create some overhead) 
    942975        //-- merge or subdivide view cells 
    943976        int merged = 0; 
    944977 
    945         vector<BspIntersection>::const_iterator iit; 
    946         CLEAR_CONTAINER(mBspRays); 
    947         ConstructBspRays(rays, mPostProcessSamples); 
    948  
    949         for (int i = 0; i < (int)mBspRays.size(); ++ i) 
    950         { 
    951                 BspRay *ray = mBspRays[i]; 
    952  
    953                 // traverse leaves stored in the rays and compare and merge consecutive 
    954                 // leaves (i.e., the neighbors in the tree) 
    955                 if (ray->intersections.size() < 2) 
    956                         continue; 
    957 #if 0 
    958                 iit = ray->intersections.begin(); 
    959  
    960                 BspLeaf *previousLeaf = (*iit).mLeaf; 
    961                 ++ iit; 
    962  
    963                 for (; iit != ray->intersections.end(); ++ iit) 
    964                 { 
    965                         BspLeaf *leaf = (*iit).mLeaf; 
    966  
    967                         if (ShouldMerge(leaf, previousLeaf)) 
    968                         { 
    969                                 MergeBspLeafViewCells(leaf, previousLeaf); 
    970  
    971                                 ++ merged; 
    972                         } 
    973  
    974                         previousLeaf = leaf; 
    975                 } 
    976 #endif 
    977         } 
    978  
     978        // TODO 
     979         
    979980        //-- stats and visualizations 
    980981        cout << "finished" << endl; 
     
    984985        Debug << "Postprocessing: Merged " << merged << " view cells in " 
    985986                  << TimeDiff(startTime, GetTime()) *1e-3 << " secs" 
    986                   << "using " << (int)mBspRays.size() << " samples" << endl << endl; 
    987  
    988         CLEAR_CONTAINER(mBspRays); 
     987                  << "using " << (int)rays.size() << " samples" << endl << endl; 
    989988 
    990989        // reset view cells and stats 
     
    997996BspViewCellsManager::~BspViewCellsManager() 
    998997{ 
    999         CLEAR_CONTAINER(mBspRays); 
    1000998} 
    1001999 
     
    10121010        if (!ViewCellsConstructed()) 
    10131011                return; 
    1014         CLEAR_CONTAINER(mBspRays); 
    1015         ConstructBspRays(sampleRays, mVisualizationSamples); 
    1016  
     1012         
    10171013        if (1) // export view cells 
    10181014        { 
     
    10701066 
    10711067                exporter->SetFilled(); 
    1072  
    1073                 // export rays 
    1074                 if (0) 
    1075                 { 
    1076                         VssRayContainer outRays; 
    1077  
    1078                         int raysSize = min((int)mBspRays.size(), mVisualizationSamples); 
    1079  
    1080                         for (int i = 0; i < raysSize; ++ i) 
    1081                                 // only rays piercing geometry 
    1082                                 outRays.push_back(mBspRays[i]->vssRay); 
    1083  
    1084                         // export rays 
    1085                         exporter->ExportRays(outRays, RgbColor(1, 1, 0)); 
    1086                 } 
    10871068 
    10881069                if (mExportGeometry) 
     
    13451326 
    13461327 
    1347 int KdViewCellsManager::Construct(const ObjectContainer &objects, 
     1328int KdViewCellsManager::ConstructSubdivision(const ObjectContainer &objects, 
    13481329                                                                  const VssRayContainer &rays) 
    13491330{ 
     
    13591340 
    13601341        // cast rays 
    1361         ComputeSampleContributions(rays); 
     1342        ComputeSampleContributions(rays, true, false); 
    13621343 
    13631344        EvaluateViewCellsStats(); 
     
    16051586 
    16061587 
    1607 VspKdViewCellsManager::VspKdViewCellsManager(VspKdTree *vspKdTree, 
    1608                                                                                          int constructionSamples): 
    1609 ViewCellsManager(constructionSamples), 
    1610 mVspKdTree(vspKdTree) 
    1611 { 
     1588VspKdViewCellsManager::VspKdViewCellsManager(VspKdTree *vspKdTree): 
     1589ViewCellsManager(), mVspKdTree(vspKdTree) 
     1590{ 
     1591        environment->GetIntValue("VspKdTree.Construction.samples", mInitialSamples); 
    16121592        mVspKdTree->SetViewCellsManager(this); 
    16131593} 
     
    16361616 
    16371617 
    1638 int VspKdViewCellsManager::Construct(const ObjectContainer &objects, 
    1639                                                                          const VssRayContainer &rays) 
     1618int VspKdViewCellsManager::ConstructSubdivision(const ObjectContainer &objects, 
     1619                                                                                                const VssRayContainer &rays) 
    16401620{ 
    16411621        // if view cells already constructed 
     
    16471627 
    16481628        GetRaySets(rays, 
    1649                            mConstructionSamples, 
     1629                           mInitialSamples, 
    16501630                           constructionRays, 
    16511631                           &savedRays); 
     
    16761656        long startTime = GetTime(); 
    16771657        // recast rest of rays 
    1678         ComputeSampleContributions(savedRays); 
     1658        ComputeSampleContributions(savedRays, true, false); 
    16791659 
    16801660        Debug << "Computed remaining ray contribution in " << TimeDiff(startTime, GetTime()) * 1e-3 
     
    19501930} 
    19511931 
     1932 
     1933 
    19521934/**************************************************************************/ 
    19531935/*                   VspBspViewCellsManager implementation                */ 
     
    19551937 
    19561938 
    1957 VspBspViewCellsManager::VspBspViewCellsManager(VspBspTree *vspBspTree, 
    1958                                                                                            int constructionSamples): 
    1959 ViewCellsManager(constructionSamples), 
    1960 mVspBspTree(vspBspTree) 
    1961 { 
     1939VspBspViewCellsManager::VspBspViewCellsManager(VspBspTree *vspBspTree): 
     1940ViewCellsManager(), mVspBspTree(vspBspTree) 
     1941{ 
     1942        environment->GetIntValue("VspBspTree.Construction.samples", mInitialSamples); 
    19621943        mVspBspTree->SetViewCellsManager(this); 
    19631944} 
     
    19801961void VspBspViewCellsManager::CollectViewCells() 
    19811962{ 
    1982         mVspBspTree->CollectViewCells(mViewCells, mOnlyValidViewCells); 
     1963        mVspBspTree->CollectViewCells(mViewCells, true); 
    19831964} 
    19841965 
     
    20031984 
    20041985 
    2005 int VspBspViewCellsManager::Construct(const ObjectContainer &objects, 
     1986int VspBspViewCellsManager::ConstructSubdivision(const ObjectContainer &objects, 
    20061987                                                                          const VssRayContainer &rays) 
    20071988{ 
     
    20161997        VssRayContainer sampleRays; 
    20171998 
    2018         int limit = min (mConstructionSamples, (int)rays.size()); 
     1999        int limit = min (mInitialSamples, (int)rays.size()); 
    20192000 
    20202001        VssRayContainer constructionRays; 
    20212002        VssRayContainer savedRays; 
    20222003 
    2023         Debug << "construction samples: " << mConstructionSamples << " rays: " << (int)rays.size() << endl; 
    2024         GetRaySets(rays, mConstructionSamples, constructionRays, &savedRays); 
    2025  
    2026         Debug << "construction rays: " << (int)constructionRays.size() << endl; 
     2004        Debug << "samples used for subdivision: " << mInitialSamples << " rays: " << (int)rays.size() << endl; 
     2005        GetRaySets(rays, mInitialSamples, constructionRays, &savedRays); 
     2006 
     2007        Debug << "initial rays: " << (int)constructionRays.size() << endl; 
    20272008        Debug << "saved rays: " << (int)savedRays.size() << endl; 
    20282009 
     
    20752056        cout << "Computing remaining ray contributions ... "; 
    20762057        // recast rest of rays 
    2077         ComputeSampleContributions(savedRays); 
     2058        ComputeSampleContributions(savedRays, true, false); 
    20782059        cout << "finished" << endl; 
    20792060 
     
    21162097                  << TimeDiff(startTime, GetTime()) *1e-3 << " secs" << endl << endl; 
    21172098 
    2118         cout << "reseting view cell stats ... "; 
    2119         ResetViewCells(); 
    2120         cout << "finished" << endl; 
    21212099 
    21222100        //BspLeaf::NewMail(); 
    21232101        if (1) // export merged view cells 
    21242102        { 
     2103 
     2104                cout << "reseting view cells ... "; 
     2105                ResetViewCells(); 
     2106                cout << "finished" << endl; 
     2107 
    21252108                Exporter *exporter = Exporter::GetExporter("merged_view_cells.x3d"); 
    21262109                Debug << "\nView cells after merge:\n" << mViewCellsStats << endl; 
     
    21982181 
    21992182        // check if new view cells turned invalid 
     2183        SetValidity(mMinPvsSize, mMaxPvsSize);  
     2184        // update valid view space according to valid view cells 
    22002185        mVspBspTree->ValidateTree(); 
    2201         ResetViewCells(); 
     2186 
     2187        // recompute view cell statistics 
     2188        mViewCellsStats.Reset(); 
     2189        EvaluateViewCellsStats(); 
     2190        // has to be recomputed 
     2191        mTotalAreaValid = false; 
    22022192 
    22032193 
     
    22832273        // collapse sibling leaves that share the same view cell 
    22842274        mVspBspTree->CollapseTree(); 
    2285  
     2275        // recompute view cell list and statistics 
    22862276        ResetViewCells(); 
    22872277 
     
    24472437#if 1 
    24482438        //-- some rays for output 
    2449         vector<BspRay *> bspRays; 
    2450         mVspBspTree->ConstructBspRays(bspRays, rays); 
    2451  
    2452         const int raysOut = min((int)bspRays.size(), mVisualizationSamples); 
     2439        const int raysOut = min((int)rays.size(), mVisualizationSamples); 
     2440 
    24532441#endif 
    24542442 
     
    24592447                VssRayContainer vcRays; 
    24602448                Intersectable::NewMail(); 
    2461 #if 0 // largest view cell pvs first 
    2462                 BspViewCell *vc = dynamic_cast<BspViewCell *>(mViewCells[i]); 
    2463 #else 
    2464                 BspViewCell *vc = dynamic_cast<BspViewCell *> 
    2465                         (mViewCells[Random((int)mViewCells.size())]); 
    2466 #endif 
    2467  
    2468 #if 1 
    2469                 // check whether we can add the current ray to the output rays 
    2470                 for (int k = 0; k < raysOut; ++ k) 
    2471                 { 
    2472                         BspRay *ray = bspRays[k]; 
    2473                         for     (int j = 0; j < (int)ray->intersections.size(); ++ j) 
     2449                BspViewCell *vc; 
     2450         
     2451                if (0) // largest view cell pvs first 
     2452                { 
     2453                        vc = dynamic_cast<BspViewCell *>(mViewCells[i]); 
     2454                } 
     2455                else 
     2456                { 
     2457                        vc = dynamic_cast<BspViewCell *> 
     2458                                (mViewCells[Random((int)mViewCells.size())]); 
     2459                } 
     2460 
     2461        if (1) 
     2462                { 
     2463                        // check whether we can add the current ray to the output rays 
     2464                        for (int k = 0; k < raysOut; ++ k) 
    24742465                        { 
    2475                                 BspLeaf *leaf = ray->intersections[j].mLeaf; 
    2476                                 if (vc == leaf->GetViewCell()) 
    2477                                         vcRays.push_back(ray->vssRay); 
     2466                                VssRay *ray = rays[k]; 
     2467                                for     (int j = 0; j < (int)ray->mViewCells.size(); ++ j) 
     2468                                { 
     2469                                        BspViewCell *bspVc = dynamic_cast<BspViewCell *>(ray->mViewCells[j]); 
     2470                                        BspLeaf *leaf = bspVc->mLeaves[0]; 
     2471                                        if (vc == bspVc) 
     2472                                                vcRays.push_back(ray); 
     2473                                } 
    24782474                        } 
    24792475                } 
    2480 #endif 
     2476 
    24812477                //bspLeaves[j]->Mail(); 
    24822478                char s[64]; sprintf(s, "bsp-pvs%04d.x3d", i); 
     
    24952491                          << ", leaves=" << (int)vc->mLeaves.size() << endl; 
    24962492 
     2493                 
    24972494                //-- export rays piercing this view cell 
    2498 #if 1 
    2499                 exporter->ExportRays(vcRays, RgbColor(1, 1, 1)); 
    2500 #endif 
    2501 #if 0 
    2502                 vector<BspLeaf *>::const_iterator lit, lit_end = vc->mLeaves.end(); 
    2503  
    2504                 for (lit = vc->mLeaves.begin(); lit != lit_end; ++ lit) 
    2505                         exporter->ExportRays((*lit)->mVssRays); 
    2506 #endif 
     2495                if (1) 
     2496                { 
     2497                        exporter->ExportRays(vcRays, RgbColor(1, 1, 1)); 
     2498                } 
     2499                else 
     2500                { 
     2501                        vector<BspLeaf *>::const_iterator lit, lit_end = vc->mLeaves.end(); 
     2502 
     2503                        for (lit = vc->mLeaves.begin(); lit != lit_end; ++ lit) 
     2504                                exporter->ExportRays((*lit)->mVssRays); 
     2505                } 
     2506 
     2507         
    25072508                m.mDiffuseColor = RgbColor(1, 0, 0); 
    25082509                exporter->SetForcedMaterial(m); 
     
    25132514                exporter->SetFilled(); 
    25142515 
     2516         
    25152517                // output PVS of view cell 
    25162518                for (it = vc->GetPvs().mEntries.begin(); it != it_end; ++ it) 
    25172519                { 
     2520                 
    25182521                        Intersectable *intersect = (*it).first; 
    25192522 
     
    25282531                } 
    25292532 
     2533                 
    25302534                DEL_PTR(exporter); 
    25312535                cout << "finished" << endl; 
    25322536        } 
    25332537 
    2534 #if 1 
    2535         CLEAR_CONTAINER(bspRays); 
    2536 #endif 
    25372538        Debug << endl; 
    25382539} 
Note: See TracChangeset for help on using the changeset viewer.