Changeset 679


Ignore:
Timestamp:
03/07/06 17:35:50 (18 years ago)
Author:
mattausch
Message:

debug version: fixing render cost with bsp splits
removed natfx trees

Files:
3 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.cpp

    r673 r679  
    5858{ 
    5959        "robot", 
    60         //"athene", 
    61         "natFX_Tree1_LOD2", 
     60        "athene", 
     61        //"natFX_Tree1_LOD2", 
    6262        //"tree2", 
    6363        //"HongKong_Tower", 
  • GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.cpp

    r657 r679  
    306306                // the objects are generated randomly distributed over the terrain 
    307307                generateScene(1000, 0); // create soldiers, trees, ninjas 
    308                 generateScene(500, 1); 
    309                 generateScene(100, 2); 
     308                if (0) 
     309                        generateScene(500, 1); 
     310                generateScene(500, 2); 
    310311        } 
    311312} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp

    r676 r679  
    12791279                                        "false"); 
    12801280 
    1281         RegisterOption("ViewCells.PostProcess.emptyViewCellsMergeAllowed", 
     1281        RegisterOption("ViewCells.PostProcess.emptyViewCellsMerge", 
    12821282                                        optBool, 
    1283                                         "view_cells_post_process_empty_view_cells_merge_allowed=" 
     1283                                        "view_cells_merge_empty=", 
    12841284                                        "false"); 
    12851285 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp

    r678 r679  
    29892989        } 
    29902990 
     2991        //Debug << "center: " << center << " new " << center / (float)n << endl; 
     2992 
    29912993        return center / (float)n; 
    29922994} 
     
    30133015 
    30143016 
    3015 void BspNodeGeometry::SplitGeometry(BspNodeGeometry &front, 
     3017bool BspNodeGeometry::SplitGeometry(BspNodeGeometry &front, 
    30163018                                                                        BspNodeGeometry &back, 
    30173019                                                                        const Plane3 &splitPlane, 
     
    30263028 
    30273029        //-- new polygon splits all other polygons 
    3028         for (int i = 0; i < (int)mPolys.size(); ++ i) 
     3030        for (int i = 0; i < (int)mPolys.size()/* && planePoly*/; ++ i) 
    30293031        { 
    30303032                /// don't use epsilon here to get exact split planes 
     
    30543056                                        else 
    30553057                                        { 
     3058                                                Debug << "no f! " << endl; 
    30563059                                                DEL_PTR(frontPoly); 
    30573060                                        } 
     3061 
    30583062                                        if (backPoly->Valid(epsilon)) 
    30593063                                        { 
     
    30623066                                        else 
    30633067                                        { 
     3068                                                Debug << "no b! " << endl; 
    30643069                                                DEL_PTR(backPoly); 
    30653070                                        } 
     
    30793084 
    30803085                                back.Add(new Polygon3(mPolys[i]->mVertices), mPlanes[i]); 
    3081                                 //front.mPolys.push_back(CreateReversePolygon(mPolys[i])); 
     3086                                //front.Add(CreateReversePolygon(mPolys[i]), mPlanes[i]); 
    30823087                                break; 
    30833088                        default: 
     
    30983103                front.Add(planePoly->CreateReversePolygon(), reversePlane); 
    30993104                //front.mPolys.push_back(planePoly->CreateReversePolygon()); 
    3100         } 
     3105                Debug << "plane poly!" << endl; 
     3106        } 
     3107        else 
     3108                Debug << "no plane poly!" << endl; 
     3109 
     3110        return planePoly != NULL; 
    31013111} 
    31023112 
     
    31603170 
    31613171 
    3162 ViewCell * 
    3163 BspTree::GetViewCell(const Vector3 &point) 
     3172ViewCell *BspTree::GetViewCell(const Vector3 &point) 
    31643173{ 
    31653174  if (mRoot == NULL) 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.h

    r678 r679  
    4646        /** Computes new front and back geometry based on the old cell  
    4747                geometry and a new split plane 
    48         */ 
    49         void SplitGeometry(BspNodeGeometry &front, 
     48                @returns true if the geometry is actually split by this plane 
     49        */ 
     50        bool SplitGeometry(BspNodeGeometry &front, 
    5051                                           BspNodeGeometry &back, 
    5152                                           const Plane3 &splitPlane, 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp

    r678 r679  
    121121        environment->GetBoolValue("VspBspTree.useBreathFirstSplits", mBreathFirstSplits); 
    122122 
    123         environment->GetBoolValue("ViewCells.PostProcess.emptyViewCellsMergeAllowed", mEmptyViewCellsMergeAllowed); 
     123        environment->GetBoolValue("ViewCells.PostProcess.emptyViewCellsMerge", mEmptyViewCellsMergeAllowed); 
    124124         
    125125        char subdivisionStatsLog[100]; 
     
    10131013                                                                           splitPlane, 
    10141014                                                                           mBox, 
    1015                                                                            0.000000001f); 
    1016                                                                            //mEpsilon); 
     1015                                                                           //0.0f); 
     1016                                                                           mEpsilon); 
    10171017                 
    10181018                if (mUseAreaForPvs) 
     
    10271027 
    10281028                        if (frontData.mProbability < -0.00001) 
    1029                                 Debug << "here2 error: " << frontData.mProbability << endl; 
     1029                                Debug << "here2 error f: " << frontData.mProbability << endl; 
    10301030                        if (backData.mProbability < -0.00001) 
    1031                                 Debug << "here2 error: " << backData.mProbability << endl; 
     1031                                Debug << "here2 error b: " << backData.mProbability << endl; 
    10321032 
    10331033                        // clamp because of precision issues 
     
    13881388 
    13891389                                // allows faster split because we have axis aligned kd tree boxes 
    1390                                 if (useKdSplit) 
     1390                                if (0 && useKdSplit) 
    13911391                                { 
    13921392                                        nCostRatio[axis] = EvalAxisAlignedSplitCost(tData, 
     
    15751575     
    15761576 
    1577         if (lowestCost > 10) 
    1578                 Debug << "warning!! lowest cost: " << lowestCost << endl; 
    1579          
    1580 //#ifdef _DEBUG 
     1577//      if (lowestCost > 10) 
     1578//              Debug << "warning!! lowest cost: " << lowestCost << endl; 
     1579         
     1580#ifdef _DEBUG 
    15811581        Debug << "plane lowest cost: " << lowestCost << endl; 
    1582 //#endif 
     1582#endif 
    15831583 
    15841584        if (lowestCost > mTermMaxCostRatio) 
     
    17111711                                                                  candidatePlane, 
    17121712                                                                  mBox, 
    1713                                                                   0.000000001f); 
    1714                                                                   //mEpsilon); 
     1713                                                                  //0.0f); 
     1714                                                                  mEpsilon); 
    17151715 
    17161716        if (!mUseAreaForPvs) // use front and back cell areas to approximate volume 
     
    17191719                pBack = pOverall - pFront; 
    17201720 
    1721                 if ((pFront < 0.001) || (pBack < 0.001)) 
     1721                if ((pFront < 0.0) || (pBack < 0.0)) 
    17221722                { 
    17231723                        Debug << "vol f " << pFront << " b " << pBack << " p " << pOverall << endl; 
     
    18101810 
    18111811        // construct child geometry with regard to the candidate split plane 
    1812         data.mGeometry->SplitGeometry(geomFront, 
    1813                                                                   geomBack, 
    1814                                                                   candidatePlane, 
    1815                                                                   mBox, 
    1816                                                                   0.000000001f); 
    1817                                                                   //mEpsilon); 
     1812        bool splitSuccessFull = data.mGeometry->SplitGeometry(geomFront, 
     1813                                                                                                                  geomBack, 
     1814                                                                                                                  candidatePlane, 
     1815                                                                                                                  mBox, 
     1816                                                                                                                  //0.0f); 
     1817                                                                                                                  mEpsilon); 
    18181818 
    18191819        pOverall = data.mProbability; 
     
    18271827                if (1) 
    18281828                { 
    1829                         if ((pFront <= 0) || (pBack <= 0) ||  
     1829                        if (!splitSuccessFull || (pFront <= 0) || (pBack <= 0) ||  
    18301830                                !geomFront.Valid() || !geomBack.Valid()) 
    18311831                        { 
Note: See TracChangeset for help on using the changeset viewer.