Changeset 645


Ignore:
Timestamp:
02/15/06 18:03:34 (18 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionQueriesQueryManager.cpp

    r370 r645  
    225225        } 
    226226} 
    227 //------j----------------------------------------------------------------- 
     227//------------------------------------------------------------------------ 
    228228void  OcclusionQueriesQueryManager::CollectNodeVisibility( 
    229229                                                GtpVisibility::QueryList::iterator &visQueryIt,  
  • GTP/trunk/Lib/Vis/Preprocessing/scripts/default.env

    r644 r645  
    289289        Construction { 
    290290                samples 500000 
    291                 epsilon 0.005 
     291                epsilon 0.00005 
    292292                randomize false 
    293293                renderCostWeight 1.0 
     
    331331                missTolerance           6 
    332332                 
    333                 maxViewCells            10000 
     333                maxViewCells            50000 
    334334                 
    335335                # used for pvs criterium 
     
    354354BspTree { 
    355355        Construction { 
    356                 samples 500000 
     356                samples 50000 
    357357                epsilon 0.005 
    358358        } 
     
    420420                minProbability 0.001 
    421421                maxRayContribution 9999 
    422                 maxViewCells    2048 
     422                maxViewCells    1000 
    423423 
    424424                # used for pvs criterium 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Polygon3.cpp

    r574 r645  
    224224 
    225225        //TODO: remove for performance 
    226 #if 0 
     226#if 1 
    227227        if (1) 
    228228        { 
     
    234234                } 
    235235        } 
    236         else 
     236         
     237        if (1) 
    237238        { 
    238239                Vector3 vtx = mVertices.back(); 
     
    241242                for (it = mVertices.begin(); it != it_end; ++it) 
    242243                { 
    243                         if (!(EpsilonEqualV3(vtx, *it))) 
     244                        if (EpsilonEqualV3(vtx, *it, 0.0001)) 
    244245                        { 
    245246                                //Debug << "Malformed vertices:\n" << *this << endl; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp

    r644 r645  
    963963                                                           new BoundedRayContainer(), 0, 0, new BspNodeGeometry()); 
    964964 
    965         int pvsData = tData.mPvs; 
    966         float cData = (float)tData.mPvs * tData.mProbability; 
    967965 
    968966        // create new interior node and two leaf nodes 
     
    973971        if (1) 
    974972        { 
     973                int pvsData = tData.mPvs; 
     974                float cData = (float)pvsData * tData.mProbability; 
     975 
    975976                float cFront = (float)tFrontData.mPvs * tFrontData.mProbability; 
    976977                float cBack = (float)tBackData.mPvs * tBackData.mProbability; 
    977978                 
    978                 float costDecr =  
    979                         (cFront + cBack - cData) / mBox.GetVolume(); 
     979                Debug << "front pvs: " << tFrontData.mPvs << " p: " << tFrontData.mProbability << endl; 
     980                Debug << "back pvs: " << tBackData.mPvs << " p: " << tBackData.mProbability << endl; 
     981                Debug << "pvs: " << pvsData << " p: " << tData.mProbability << endl; 
     982 
     983                Debug << "data: " << cData << " front: " << cFront << " back: " << cBack << endl; 
     984                Debug << "cost ratio: " << (cFront + cBack) / cData << endl; 
     985 
     986                if ((cFront + cBack) / cData > 1) 
     987                        Debug << "ERROR!!" << endl; 
     988 
     989                float costDecr = (cFront + cBack - cData) / mBox.GetVolume(); 
    980990 
    981991                 
     
    10171027} 
    10181028 
     1029 
    10191030void BspTree::ExtractViewCells(BspTraversalData &frontData, 
    10201031                                                           BspTraversalData &backData,  
     
    10441055        } 
    10451056} 
     1057 
    10461058 
    10471059BspInterior *BspTree::SubdivideNode(BspTraversalData &tData, 
     
    10911103                                                                           interior->mPlane, 
    10921104                                                                           mBox, 
    1093                                                                            mEpsilon); 
     1105                                                                           0.000000000001); 
     1106                                                                           //mEpsilon); 
    10941107         
    10951108                 
     
    11031116                        frontData.mProbability = frontData.mGeometry->GetVolume(); 
    11041117                        backData.mProbability = tData.mProbability - frontData.mProbability; 
     1118 
     1119                        Debug << "************" << endl; 
     1120                        Debug << "plane: " << interior->mPlane << endl; 
     1121                        Debug << "box: " << mBox << endl; 
     1122                        Debug << "all: " << tData.mProbability << " f: " << frontData.mProbability << " b: " << backData.mProbability << endl; 
     1123                        Debug << "real back: " << backData.mGeometry->GetVolume() << endl; 
     1124                        Debug << "data geom: " << tData.mGeometry->mPolys.size() << " f: " << frontData.mGeometry->mPolys.size() << " b: " << backData.mGeometry->mPolys.size() << endl; 
    11051125                } 
    11061126        } 
     
    14431463                const float candidateCost =  
    14441464                        SplitPlaneCost(poly->GetSupportingPlane(), data); 
     1465 
     1466                Debug << "supporting plane: " << poly->GetSupportingPlane() << endl; 
    14451467 
    14461468                if (candidateCost < lowestCost) 
     
    19822004                        if (!leaf->mViewCell->Mailed()) 
    19832005                        { 
    1984                           //                            ray.bspIntersections.push_back(Ray::BspIntersection(maxt, leaf)); 
     2006                                //ray.bspIntersections.push_back(Ray::BspIntersection(maxt, leaf)); 
    19852007                                leaf->mViewCell->Mail(); 
    19862008                                ++ hits; 
     
    20612083                        else // ray and plane are coincident 
    20622084                        { 
    2063                                 // WHAT TO DO IN THIS CASE ? 
    2064                                 //break; 
    2065                                 node = in->GetFront(); 
    2066                                 continue; 
     2085                                // NOTE: what to do if ray is coincident with plane? 
     2086                                if (extSide < 0) 
     2087                                        node = in->GetBack(); 
     2088                                else  
     2089                                        node = in->GetFront(); 
     2090                                                                 
     2091                                continue; // no far child 
    20672092                        } 
    20682093                 
Note: See TracChangeset for help on using the changeset viewer.