Changeset 723


Ignore:
Timestamp:
04/04/06 00:09:44 (18 years ago)
Author:
mattausch
Message:

found slowdown

Location:
GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE
Files:
4 edited

Legend:

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

    r679 r723  
    1111#include "OgreOcclusionQueriesQueryManager.h" 
    1212#include "TestCullingTerrainApplication.h" 
    13  
     13#include <string> 
    1414 
    1515//-- captions for overlays 
     
    2020        "Stop and Wait Culling" 
    2121}; 
     22 
     23//-- captions for overlays 
     24String TerrainFrameListener::msApprevAlgorithmCaptions[] =  
     25{ 
     26        "CHC", 
     27        "VFC",  
     28        "SWC" 
     29}; 
     30 
    2231 
    2332String TerrainFrameListener::msQueryTypeCaptions[] =  
     
    98107mVisibilityThreshold(0), 
    99108mAssumedVisibility(0), 
     109#if 0 
    100110mCurrentAlgorithm(GtpVisibility::VisibilityEnvironment::COHERENT_HIERARCHICAL_CULLING), 
    101 //mCurrentAlgorithm(GtpVisibility::VisibilityEnvironment::FRUSTUM_CULLING), 
     111#else 
     112mCurrentAlgorithm(GtpVisibility::VisibilityEnvironment::FRUSTUM_CULLING), 
     113#endif 
    102114mNodeVizMode(NODEVIZ_NONE), 
    103 mVizCameraHeight(Real(2500.0)), 
     115mVizCameraHeight(Real(4000.0)), 
    104116mCamNode(camNode), 
    105117mAppState(WALKTHROUGH), 
     
    139151mPureRenderTimeFps(0.0), 
    140152mNumVideoFrames(0), 
    141 mDemoFps(0), 
    142 mUseDemoFps(false), 
     153mPrecomputedFps(0), 
     154mRecordDemo(false), 
     155mSavePrecomputedFps(false), 
    143156mUseArbQueries(false), 
    144 mUseBufferedInputMouse(false) 
     157mUseBufferedInputMouse(false), 
     158mVizScale(25) 
    145159{ 
    146160        //mInputDevice = PlatformManager::getSingleton().createInputReader(); 
     
    163177         
    164178        //-- overlays 
     179         
    165180        mDebugOverlay = OverlayManager::getSingleton().getByName("Core/DebugOverlay"); 
    166181        mHelpOverlay = OverlayManager::getSingleton().getByName("Example/Visibility/HelpOverlay");  
     
    168183        mCullStatsOverlay = OverlayManager::getSingleton().getByName("Example/Visibility/CullStatsOverlay");  
    169184 
    170         initVisStatsOverlay(); // visibility stats overlay 
    171         initHelpOverlay();     // help overlay 
    172         initQueryOverlay();    // visibility query stats overlay 
    173  
    174         // show stats overlays 
    175         showStats(true); 
    176          
     185        String ext = "Example/Visibility/"; 
     186 
     187        //-- overlays 
     188        mMyStatsOverlay = OverlayManager::getSingleton().getByName("Example/Visibility/MyStatsOverlay"); 
     189        mMyStatsAlgorithmInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/MyAlgorithmInfo"); 
     190        mMyStatsAlgorithmInfo->setCaption("hehaah2"); 
     191 
     192        char str[100]; sprintf(str,": %d", 0); 
     193        mMyStatsFpsInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/MyFpsInfo"); 
     194        mMyStatsFpsInfo->setCaption(str); 
     195        //mMyStatsAlgorithmInfo->setTop(top); 
     196 
     197        mMyStatsOverlay->show(); 
     198 
     199        if (1) 
     200        { 
     201                initVisStatsOverlay(); // visibility stats overlay 
     202                initHelpOverlay();     // help overlay 
     203                initQueryOverlay();    // visibility query stats overlay 
     204         
     205                // show stats overlays 
     206                showStats(false); 
     207        } 
     208 
     209        // the scale factor for the visualized bounding boxes 
     210        mSceneMgr->setOption("NodeVizScale", &mVizScale); 
     211 
    177212        // set culling algorithm type 
    178213        setAlgorithm(mCurrentAlgorithm); 
     
    186221        mSceneMgr->setOption("CullCamera", &mCullCamera); 
    187222        mSceneMgr->setOption("PrepareVisualization", &mShowVisualization); 
    188  
     223         
    189224        setObjectType(mCurrentObjectType); 
    190225 
     
    201236        // reset statistics 
    202237        mWalkthroughStats.Reset(); 
    203 }  
     238} 
     239//----------------------------------------------------------------------- 
     240void TerrainFrameListener::switchMouseMode() 
     241{ 
     242        mUseBufferedInputMouse = !mUseBufferedInputMouse; 
     243        mInputDevice->setBufferedInput(true, mUseBufferedInputMouse); 
     244 
     245        if (!mUseBufferedInputMouse) 
     246                CEGUI::MouseCursor::getSingleton().hide(); 
     247        else 
     248                CEGUI::MouseCursor::getSingleton().show(); 
     249} 
    204250//----------------------------------------------------------------------- 
    205251TerrainFrameListener::~TerrainFrameListener() 
     
    410456                /// set the current camera data to loaded frame information  
    411457                setCurrentFrameInfo(evt.timeSinceLastFrame); 
    412                 // HACK for demo 
    413                 //addFrameInfo(mSavedFrameInfo, mCamNode, evt.timeSinceLastFrame); 
     458 
     459                // HACK for demo: save new frame rates for different methods on the  
     460                // same walkthrough 
     461                if (mSavePrecomputedFps) 
     462                { 
     463                        addFrameInfo(mPrecomputedFpsFrameInfo, mCamNode, evt.timeSinceLastFrame); 
     464                } 
     465 
    414466                break; 
    415467        case WALKTHROUGH: 
     
    420472                        // print recording message 
    421473                        mWindow->setDebugText("Recording frame " +  
    422                                 StringConverter::toString(mFrameInfo.size() - 1)); 
     474                                StringConverter::toString((int)mFrameInfo.size() - 1)); 
    423475                }        
    424476                // move camera according to input 
     
    654706} 
    655707//----------------------------------------------------------------------- 
    656 void TerrainFrameListener::writeFrames() 
    657 { 
    658         std::ofstream ofstr(frames_out_filename); 
    659          
     708void TerrainFrameListener::writeFrames(const std::string filename,  
     709                                                                           const FrameInfoContainer &frameInfo) const 
     710{ 
     711        std::ofstream ofstr(filename.c_str()); 
    660712        std::vector<frame_info>::const_iterator it, it_end; 
    661  
    662         it_end = mFrameInfo.end(); 
    663         for (it = mFrameInfo.begin(); it < it_end; ++it) 
     713        it_end = frameInfo.end(); 
     714 
     715        int i = 0; 
     716 
     717        for (it = frameInfo.begin(); it < it_end; ++ it, ++ i) 
    664718        { 
    665719                ofstr << StringConverter::toString((*it).position) << " "  
     
    668722                          << StringConverter::toString((*it).fps) << "\n"; 
    669723        } 
     724 
     725        std::stringstream d; d << "saved " << i << " frames to file " << filename; 
     726        Ogre::LogManager::getSingleton().logMessage(d.str()); 
     727 
    670728        ofstr.close(); 
    671729} 
    672 // quick hack 
    673 void TerrainFrameListener::writeNewFrameInfo() 
    674 { 
    675         std::ofstream ofstr("newframe.out"); 
    676          
    677         std::vector<frame_info>::const_iterator it, it_end; 
    678  
    679         it_end = mSavedFrameInfo.end(); 
    680         for (it = mSavedFrameInfo.begin(); it < it_end; ++it) 
    681         { 
    682                 ofstr << StringConverter::toString((*it).position) << " "  
    683                           << StringConverter::toString((*it).orientation) << " " 
    684                           << StringConverter::toString((*it).timeElapsed) << " " 
    685                           << StringConverter::toString((*it).fps) << "\n"; 
    686         } 
    687         ofstr.close(); 
    688 } 
    689 //----------------------------------------------------------------------- 
    690 void TerrainFrameListener::loadFrames() 
    691 { 
    692         std::ifstream ifstr(frames_out_filename); 
     730//----------------------------------------------------------------------- 
     731void TerrainFrameListener::loadFrames(const std::string filename,   
     732                                                                          FrameInfoContainer &frameInfo) 
     733{ 
     734        std::ifstream ifstr(filename.c_str()); 
    693735        char line[256]; 
    694736        frame_info info; 
    695737 
    696738        // reset current values 
    697         mFrameInfo.clear(); 
     739        frameInfo.clear(); 
     740         
    698741        mCurrentFrame = 0; 
    699          
     742        int i = 0; 
    700743        while (!ifstr.eof())  
    701744        { 
     
    709752                // std::stringstream d; d << StringConverter::toString(info.position) << " " << StringConverter::toString(info.orientation); 
    710753                // LogManager::getSingleton().logMessage(d.str()); 
    711         } 
     754                ++ i; 
     755        } 
     756         
     757        std::stringstream d;  
     758        d << "loaded " << i << " frames from file " << filename; 
     759        Ogre::LogManager::getSingleton().logMessage(d.str()); 
     760 
    712761        ifstr.close(); 
    713762} 
     
    721770        mAppState = (mAppState + 1) % STATE_NUM; 
    722771 
    723         // if last state was replay state 
     772        // if last state was replay state: post process 
    724773        if (lastState == REPLAY) 
    725774        { 
     
    727776                mWindow->setDebugText(""); 
    728777                                 
    729                 // hack for producing demo 
    730                 writeNewFrameInfo(); 
    731                 mSavedFrameInfo.clear(); 
     778                // hack for producing demo: 
     779                // we produced precomputed fps during the last replay => 
     780                // save them to file 
     781                if (mSavePrecomputedFps) //!mPrecomputedFpsFrameInfo.empty()) 
     782                { 
     783                        std::string filename = msApprevAlgorithmCaptions[mCurrentAlgorithm] + "_frames.out"; 
     784 
     785                        writeFrames(filename, mPrecomputedFpsFrameInfo); 
     786                        mPrecomputedFpsFrameInfo.clear(); 
     787                } 
    732788 
    733789                std::stringstream d; 
    734                 mWalkthroughStats.Print(d, msAlgorithmCaptions[mCurrentAlgorithm]); 
     790                mWalkthroughStats.Print(d, msApprevAlgorithmCaptions[mCurrentAlgorithm]); 
    735791                 
    736792                LogManager::getSingleton().logMessage(d.str()); 
    737793        } 
    738794         
    739         // replay recorded walkthrough 
     795        //-- replay recorded walkthrough 
    740796        if (mAppState == REPLAY) 
    741797        { 
    742                 // no recording during replay 
    743                 mRecordFrames = false; mWindow->setDebugText(""); 
    744  
    745                 // load recorded walkthrough from disk 
    746                 if (mFrameInfo.size() == 0) 
     798                // no standard recording during replay 
     799                mRecordFrames = false; 
     800 
     801                // no stats information 
     802                mWindow->setDebugText(""); 
     803 
     804                // clear previous walktrough 
     805                mFrameInfo.clear(); 
     806 
     807                std::string filename; 
     808                 
     809                // if recording demo, 
     810                // we use precomputed fps which corresponds to current method,  
     811                // e.g., for chc we load precomputed chc fps from disc. 
     812                if (mRecordDemo) 
    747813                { 
    748                         loadFrames(); 
     814                        filename = msApprevAlgorithmCaptions[mCurrentAlgorithm] + "_frames.out"; 
    749815                } 
    750                  
    751                 // if there are no recorded frames => set next state 
    752                 if (mFrameInfo.size() == 0)  
     816                else // standard filename 
     817                { 
     818                        filename = frames_out_filename; 
     819                } 
     820 
     821                //-- load recorded walkthrough from disk 
     822                loadFrames(filename, mFrameInfo); 
     823                 
     824                 
     825                // if there are still no recorded frames,  
     826                // no walkthrough was recorded => set next state 
     827                if (mFrameInfo.empty())  
    753828                { 
    754829                        nextAppState(); 
    755830                } 
    756                 else // replay 
     831                else // actual replay 
    757832                { 
    758833                        mWindow->setDebugText("Replay"); 
    759834                         
    760                         // reset, because we measure fps stats during walkthrough (warning: average fps broken) 
     835                        // reset, because we measure fps stats during walkthrough  
     836                        // (warning: average fps broken) 
    761837                        mWindow->resetStatistics(); 
    762838                        mWalkthroughStats.Reset(); 
     
    781857                mFrameInfo.clear(); 
    782858        } 
    783         else 
    784         { 
    785                 writeFrames(); // write frame info to file 
     859        else // recording just ended => write frame info to file 
     860        { 
     861                writeFrames(frames_out_filename, mFrameInfo);  
    786862                mWindow->setDebugText(""); 
    787863        } 
     
    818894} 
    819895//----------------------------------------------------------------------- 
     896void TerrainFrameListener::changeVizScale(const int incr) 
     897{ 
     898        mVizScale += incr;  
     899 
     900        if (mVizScale < 1)  
     901        {        
     902                mVizScale = 1; 
     903        } 
     904 
     905        mSceneMgr->setOption("NodeVizScale", &mVizScale); 
     906} 
     907 
     908//----------------------------------------------------------------------- 
    820909void TerrainFrameListener::zoomVizCamera(int zoom) 
    821910{ 
    822         mVizCameraHeight += zoom;  
    823         if(mVizCameraHeight < 0) mVizCameraHeight = 0; 
     911        mVizCameraHeight += zoom; 
     912 
     913        if(mVizCameraHeight < 0) 
     914                mVizCameraHeight = 0; 
    824915} 
    825916//----------------------------------------------------------------------- 
     
    861952        static String trisString = "Triangle Count: "; 
    862953 
    863         int currentFps = mWindow->getStatistics().lastFPS; 
    864          
    865         // HACK for demo: use precomputed FPS 
    866         if (mUseDemoFps) 
    867                 currentFps = mDemoFps; 
     954        int currentFps; 
     955         
     956        // HACK for demo: use precomputed FPS instead of real FPS 
     957        if (mRecordDemo) 
     958        { 
     959                currentFps = mPrecomputedFps; 
     960        } 
     961        else 
     962        { 
     963                currentFps = mWindow->getStatistics().lastFPS; 
     964        } 
     965 
    868966#if 0 
    869967        // HACK: take pure rendering time, only measures the render call 
     
    885983 
    886984 
    887         mWalkthroughStats.UpdateFrame(currentFps, mWindow->getBestFPS(), mWindow->getWorstFPS(), 
    888                                                                   (int)mWindow->getTriangleCount(), nodeInfo[0], nodeInfo[1], nodeInfo[2]); 
     985        mWalkthroughStats.UpdateFrame(currentFps,  
     986                                                                  mWindow->getBestFPS(),  
     987                                                                  mWindow->getWorstFPS(), 
     988                                                                  (int)mWindow->getTriangleCount(),  
     989                                                                  nodeInfo[0],  
     990                                                                  nodeInfo[1],  
     991                                                                  nodeInfo[2]); 
    889992 
    890993        // HACK: compute average fps ourselfs, because ogre avg. fps is wrong 
     
    9091012                        //guiCurr->setCaption(currFpsString + StringConverter::toString(currentFps)); 
    9101013                } 
     1014 
     1015                /*std::stringstream d; 
     1016                d << "fps: " << StringConverter::toString(currentFps) << ", " 
     1017                  << "avg fps: " << StringConverter::toString(avgFps); 
     1018                LogManager::getSingleton().logMessage(d.str());*/ 
     1019 
    9111020                //guiAvg->setCaption(avgFps + StringConverter::toString(stats.avgFPS)); 
    9121021                guiCurr->setCaption(currFpsString + StringConverter::toString(currentFps)); 
     
    9161025 
    9171026                guiBest->setCaption(bestFpsString + StringConverter::toString(stats.bestFPS) 
    918                         +" "+StringConverter::toString(stats.bestFrameTime) + " ms"); 
     1027                                                        + " " + StringConverter::toString(stats.bestFrameTime) + " ms"); 
    9191028                guiWorst->setCaption(worstFpsString + StringConverter::toString(stats.worstFPS) 
    920                         +" "+StringConverter::toString(stats.worstFrameTime) + " ms"); 
     1029                                                         + " " + StringConverter::toString(stats.worstFrameTime) + " ms"); 
    9211030 
    9221031                OverlayElement* guiTris = OverlayManager::getSingleton().getOverlayElement("Core/NumTris"); 
     
    9471056                // take old value into account in order to create no sudden changes 
    9481057                mSceneMgr->getOption("NumQueriesIssued", &opt);  
    949                 mDelayedQueriesIssued = mDelayedQueriesIssued * 0.8 + (float)opt * 0.2; 
     1058                mDelayedQueriesIssued = mDelayedQueriesIssued * 0.8 + (float)opt * 0.2f; 
    9501059                sprintf(str,": %d", (int)mDelayedQueriesIssued);  
    9511060                mQueriesIssuedInfo->setCaption(str); 
    9521061 
    9531062                mSceneMgr->getOption("NumTraversedNodes", &opt);  
    954                 mDelayedTraversedNodes = mDelayedTraversedNodes * 0.8 + (float)opt * 0.2; 
     1063                mDelayedTraversedNodes = mDelayedTraversedNodes * 0.8 + (float)opt * 0.2f; 
    9551064                sprintf(str,": %d", (int)mDelayedTraversedNodes);  
    9561065                mTraversedNodesInfo->setCaption(str); 
     1066 
     1067                // update stats for demo 
     1068                mMyStatsAlgorithmInfo->setCaption(msApprevAlgorithmCaptions[mCurrentAlgorithm]); 
     1069                sprintf(str,": %d", (int)currentFps);  
     1070                mMyStatsFpsInfo->setCaption(str); 
    9571071 
    9581072        } 
     
    12051319                mTerrainContentGenerator->WriteObjects(objects_out_filename); 
    12061320                break; 
    1207  
    12081321        case KC_8: 
    12091322                changeAssumedVisibility(-1); 
     
    12181331                mDeleteObjects = true; 
    12191332                break; 
    1220         case KC_M: // hack 
    1221                 mUseDemoFps = !mUseDemoFps; 
    1222                 break; 
     1333        case KC_M: // hack for recording demo using precomputed fps 
     1334                mRecordDemo = !mRecordDemo; 
     1335                break; 
     1336    case KC_E: // hack for recording demo using precomputed fps 
     1337                mSavePrecomputedFps = !mSavePrecomputedFps; 
     1338                break; 
     1339         
    12231340        case KC_Q: 
    12241341                toggleUseArbQueries(); 
     
    12551372} 
    12561373//----------------------------------------------------------------------- 
    1257 void TerrainFrameListener::addFrameInfo(FrameInfoContainer &frameInfos, SceneNode *camNode, Real timeElapsed) 
     1374void TerrainFrameListener::addFrameInfo(FrameInfoContainer &frameInfos,  
     1375                                                                                SceneNode *camNode,  
     1376                                                                                Real timeElapsed) 
    12581377{ 
    12591378        frame_info info; 
     
    12671386} 
    12681387//----------------------------------------------------------------------- 
    1269 void TerrainFrameListener::setCurrentFrameInfo(Real timeElapsed) 
     1388void TerrainFrameListener::setCurrentFrameInfo(const Real timeElapsed) 
    12701389{ 
    12711390        //-- find current frame relative to elapsed frame time           
     
    12791398 
    12801399        // TODO: crashes here if recording / replaying on the same time!! 
    1281         frame_info new_frame = mFrameInfo[mCurrentFrame];  
    1282         frame_info old_frame = mFrameInfo[mCurrentFrame - 1]; 
     1400        const frame_info new_frame = mFrameInfo[mCurrentFrame];  
     1401        const frame_info old_frame = mFrameInfo[mCurrentFrame - 1]; 
    12831402                 
    12841403        //-- interpolate frames 
     
    12901409        } 
    12911410 
    1292         Vector3 camPos = old_frame.position + factor  
     1411        const Vector3 camPos = old_frame.position + factor  
    12931412                * (new_frame.position - old_frame.position); 
    12941413 
    12951414        // interpolate the orientation 
    1296         Quaternion camOrienation = Quaternion::Slerp(factor, old_frame.orientation,  
    1297                 new_frame.orientation, true); 
    1298  
    1299         // HACK: interpolate fps 
    1300         mDemoFps = old_frame.fps + factor * (new_frame.fps -old_frame.fps); 
     1415        const Quaternion camOrienation =  
     1416                Quaternion::Slerp(factor, old_frame.orientation, new_frame.orientation, true); 
     1417 
     1418        // HACK for demo: interpolate precomputed fps 
     1419        mPrecomputedFps = old_frame.fps + factor * (new_frame.fps - old_frame.fps); 
    13011420 
    13021421        mCamNode->setPosition(camPos); 
     
    13621481        { 
    13631482                zoomVizCamera(-50); 
     1483        } 
     1484 
     1485        if (mInputDevice->isKeyDown(KC_5)) 
     1486        { 
     1487                changeVizScale(-1); 
     1488        } 
     1489 
     1490        if (mInputDevice->isKeyDown(KC_6)) 
     1491        { 
     1492                changeVizScale(1); 
    13641493        } 
    13651494 
  • GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.h

    r639 r723  
    8181                        << "best FPS: " << mBestFps << "\n" 
    8282                        << "worst FPS: " << mWorstFps << "\n" 
     83                        << "#frames: " << mFrameCount << "\n" 
    8384                        << "avg. #triangles: " << avgTris << " M\n" 
    84                         << "#frames: " << mFrameCount << "\n" 
    8585                        << "avg. #query culled nodes: " << avgFrustumCulledNodes << "\n" 
    8686                        << "avg. #frustum culled nodes: " << avgQueryCulledNodes << "\n" 
     
    151151 
    152152   // visualization modes for scene nodes 
    153    enum {NODEVIZ_NONE, NODEVIZ_RENDER_NODES, NODEVIZ_RENDER_NODES_AND_CONTENT, NODEVIZ_MODES_NUM}; 
     153   enum { 
     154                 NODEVIZ_NONE,  
     155                 NODEVIZ_RENDER_NODES,  
     156                 NODEVIZ_RENDER_NODES_AND_CONTENT,  
     157                 NODEVIZ_MODES_NUM}; 
     158 
    154159   //enum {NODEVIZ_NONE, NODEVIZ_RENDER_GEOMETRY, NODEVIZ_MODES_NUM}; 
    155160 
     
    163168   void moveCamera(); 
    164169 
    165    void writeFrames(); 
    166    void loadFrames(); 
    167  
    168         // quick hack 
    169         void writeNewFrameInfo(); 
    170      
     170   void writeFrames(const std::string filename, const FrameInfoContainer &frameInfo) const; 
     171   void loadFrames(const std::string filename, FrameInfoContainer &frameInfo); 
     172 
    171173    bool processUnbufferedKeyInput(const FrameEvent& evt); 
    172174    bool processUnbufferedMouseInput(const FrameEvent& evt); 
    173175 
    174         void switchMouseMode()  
    175         { 
    176         mUseBufferedInputMouse = !mUseBufferedInputMouse; 
    177                 mInputDevice->setBufferedInput(true, mUseBufferedInputMouse); 
    178  
    179                 if (!mUseBufferedInputMouse) 
    180                         CEGUI::MouseCursor::getSingleton().hide(); 
    181                 else 
    182                         CEGUI::MouseCursor::getSingleton().show(); 
    183         } 
    184  
     176        void switchMouseMode(); 
     177         
    185178        /** Shows the frame / algorithm statistics. 
    186179        */  
     
    213206    void changeThreshold(int incr); 
    214207        void changeAssumedVisibility(int incr); 
     208        void changeVizScale(const int incr); 
    215209        void setTestGeometryForVisibleLeaves(bool testGeometryForVisibleLeaves); 
    216210        /** Shows octree hierarchy of the scene. 
     
    248242 
    249243        static String msAlgorithmCaptions[]; 
     244        static String msApprevAlgorithmCaptions[]; 
    250245        static String msQueryTypeCaptions[];  
    251246        static String msQueryRelativeVisCaptions[]; 
     
    288283        WalkthroughStats mWalkthroughStats; 
    289284 
    290         /// HACK for demo 
    291         float mDemoFps; 
    292         bool mUseDemoFps; 
     285        /// visualization scale 
     286        float mVizScale; 
     287 
     288        //////////////////////////////////////////////////////////////////////// 
     289 
     290        /** HACK for recording demo:  
     291                1) the walkthrough must be recorded.  
     292                2) the walktrough must be replayed using the different options, e.g., CHC  
     293                   with the mSavePrecomputedFps option. This saves the frame rates 
     294                   for the different methods. 
     295            3) the walkthrough must then be replayed with the mRecordDemo options turned on. 
     296                   for the video recording we are using FRAPS. 
     297        */ 
     298 
     299        /// the currently interpolated FPS 
     300        float mPrecomputedFps; 
     301        /// saves the precomputed fps for the different methods. 
     302        bool mSavePrecomputedFps; 
     303        /// displayes the precomputed fps 
     304        bool mRecordDemo; 
     305         
     306        //////////////////////////////////////////////////////////////////////////// 
     307 
    293308 
    294309        OverlayElement *mAlgorithmInfo; 
     
    309324        OverlayElement *mCurrentObjectTypeInfo; 
    310325 
     326        OverlayElement *mMyStatsAlgorithmInfo; 
     327        OverlayElement *mMyStatsFpsInfo; 
     328 
    311329        OverlayElement *mQueryTypeInfo; 
    312330        OverlayElement *mQueryVisibleNodesInfo; 
     
    334352        bool mShowHelp; 
    335353        bool mStatsOn; 
    336         bool mLMouseDown, mRMouseDown;     // True if the mouse buttons are down 
     354        bool mLMouseDown; 
     355        bool mRMouseDown;     // True if the mouse buttons are down 
    337356        bool mShutdownRequested; 
    338357        bool mDisplayCameraDetails; 
     
    349368        /// Per frame data stored for a walkthrough 
    350369        FrameInfoContainer mFrameInfo; 
    351         /// HACK: for demo 
    352         FrameInfoContainer mSavedFrameInfo; 
     370        /// HACK for demo 
     371        FrameInfoContainer mPrecomputedFpsFrameInfo; 
    353372         
    354373        Real mReplayTimeElapsed; 
     
    379398        Overlay* mCullStatsOverlay; 
    380399        Overlay* mQueryOverlay; 
     400        Overlay* mMyStatsOverlay; 
    381401 
    382402        Light *mSunLight; 
  • GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.cpp

    r679 r723  
    227227void TestCullingTerrainApplication::createScene() 
    228228{ 
    229         Real scale = 3; 
    230         mSceneMgr->setOption("NodeVizScale", &scale); 
    231  
    232229        // Set ambient light 
    233230        mAmbientLight = ColourValue(0.5, 0.5, 0.5); 
     
    305302        { 
    306303                // the objects are generated randomly distributed over the terrain 
    307                 generateScene(1000, 0); // create soldiers, trees, ninjas 
    308                 if (0) 
    309                         generateScene(500, 1); 
    310                 generateScene(500, 2); 
     304                if (1) generateScene(500, 0); // create robots 
     305                if (0) generateScene(100, 1); // create trees 
     306                if (0) generateScene(100, 2); // create ninjas 
    311307        } 
    312308} 
  • GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrainApplication.h

    r639 r723  
    1010 
    1111#include <OgreEntity.h> 
     12#include <string> 
    1213 
    1314// z order index of visualizaion viewport 
Note: See TracChangeset for help on using the changeset viewer.