Changeset 558


Ignore:
Timestamp:
01/20/06 03:42:21 (18 years ago)
Author:
mattausch
Message:
 
Location:
trunk/VUT/GtpVisibilityPreprocessor
Files:
3 edited

Legend:

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

    r557 r558  
    2929VssPreprocessor { 
    3030        samplesPerPass  100000 
    31         initialSamples 1000000 
     31        initialSamples 800000 
    3232        vssSamples 0 
    3333        vssSamplesPerPass 500000 
     
    259259VspBspTree { 
    260260        Construction { 
    261                 samples 500000 
     261                samples 300000 
    262262                epsilon 0.005 
    263263                randomize false 
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp

    r557 r558  
    22212221                                lm = vm; 
    22222222                                         
    2223                                 vm.mDiffuseColor.r -= 0.3f; 
    2224                                 vm.mDiffuseColor.g -= 0.3f; 
    2225                                 vm.mDiffuseColor.b -= 0.3f; 
     2223                                vm.mDiffuseColor.r -= 0.45f; 
     2224                                vm.mDiffuseColor.g -= 0.45f; 
     2225                                vm.mDiffuseColor.b -= 0.45f; 
    22262226 
    22272227                                vector<BspLeaf *>::const_iterator lit, lit_end = vc->mLeaves.end(); 
  • trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.cpp

    r557 r558  
    25572557        else // throw them into old view cells container 
    25582558        { 
    2559                 fVc->mMailbox = -1; 
    2560                 bVc->mMailbox = -1; 
     2559                //fVc->mMailbox = -1; 
     2560                //bVc->mMailbox = -1; 
     2561                fVc->SetId(-2); 
     2562                bVc->SetId(-2); 
    25612563 
    25622564                mOldViewCells.push_back(fVc); 
    25632565                mOldViewCells.push_back(bVc); 
    2564  
     2566                 
    25652567                mNewViewCells.push_back(vc); 
    25662568        } 
     
    28162818        int pass = 0; 
    28172819        const int nextPass = 200; 
    2818  
     2820for (int k = 0; k < (int)viewCells.size(); ++ k) 
     2821                                                Debug << "vc mailid4: " << viewCells[k]->mMailbox << endl; 
    28192822        cout << "starting merge ... "; 
    28202823 
     
    28732876                                 
    28742877                                        ViewCellContainer::const_iterator vit, vit_end = viewCells.end(); 
    2875  
    2876                                         Debug << "here2111 " << viewCells.size() << endl; 
    2877                                         for (int i = 0; i < viewCells.size(); ++ i) 
     2878                                         
     2879                                        // find all already merged view cells and remove them from view cells 
     2880                                        int i = 0; 
     2881                                        while (1) 
    28782882                                        { 
    2879                                                 while (!viewCells.empty() && (viewCells.back()->mMailbox == -1)) 
     2883                                                //while (!viewCells.empty() && (viewCells.back()->mMailbox == -1)) 
     2884                                                while (!viewCells.empty() && (viewCells.back()->GetId() == -2)) 
    28802885                                                { 
    2881                                                         Debug << "here244" << endl; 
     2886                                                        DEL_PTR(viewCells.back()); 
    28822887                                                        viewCells.pop_back(); 
    28832888                                                } 
     2889                                                // all merged view cells have been found 
     2890                                                if (i >= viewCells.size())  
     2891                                                        break; 
    28842892 
    28852893                                                // already merged view cell, put it to end of vector 
    2886                                                 if ((i < viewCells.size()) && (viewCells[i]->mMailbox == -1)) 
    2887                                                 { 
    2888                                                         Debug << "here2" << endl; 
     2894                                                //if (viewCells[i]->mMailbox == -1) 
     2895                                                if (viewCells[i]->GetId() == -2) 
    28892896                                                        swap(viewCells[i], viewCells.back()); 
    2890                                                 } 
     2897                                                 
     2898                                                ++ i; 
    28912899                                        } 
    28922900                                 
     2901                                        for (int k = 0; k < (int)viewCells.size(); ++ k) 
     2902                                                //Debug << "vc mailid: " << viewCells[k]->mMailbox << endl; 
     2903                                                Debug << "vc id: " << viewCells[k]->GetId() << endl; 
     2904 
    28932905                                        cout << "finished" << endl; 
    28942906                                        // not part of any leaf 
    2895                                         CLEAR_CONTAINER(mOldViewCells); 
     2907                                        //CLEAR_CONTAINER(mOldViewCells); 
     2908                                        mOldViewCells.clear(); 
    28962909 
    28972910                                        int newVcSize = (int)mNewViewCells.size(); 
     
    29132926                                                ViewCellContainer::const_iterator it, it_end = viewCells.end(); 
    29142927                 
     2928                                                // new view cells are on the back 
    29152929                                                int i = (int)viewCells.size(); 
    29162930                                                for (it = viewCells.begin(); it != it_end; ++ it) 
    29172931                                                { 
    2918                                                         Material m = RandomMaterial(); 
    2919                                                         if (i-- == newVcSize) 
     2932                                                        Material m; 
     2933 
     2934                                                        if (i -- < newVcSize) 
    29202935                                                        { 
    2921                                                                 m.mDiffuseColor.r = 1; 
     2936                                                                m.mDiffuseColor.r = RandomValue(0.5, 1.0); 
    29222937                                                                m.mDiffuseColor.g = 0; 
    29232938                                                                m.mDiffuseColor.b = 0; 
    29242939                                                        } 
     2940                                                        else 
     2941                                                        { 
     2942                                                                float col = RandomValue(0.5, 1.0); 
     2943                                                                m.mDiffuseColor.r = col; 
     2944                                                                m.mDiffuseColor.g = col; 
     2945                                                                m.mDiffuseColor.b = col; 
     2946                                                        } 
     2947 
    29252948                                                        exporter->SetForcedMaterial(m); 
    29262949                                                        mViewCellsManager->ExportVcGeometry(exporter, *it); 
Note: See TracChangeset for help on using the changeset viewer.