Changeset 155 for trunk/VUT/work
- Timestamp:
- 07/05/05 18:35:47 (20 years ago)
- Location:
- trunk/VUT/work
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/work/TestCulling/TestCullingApplication.cpp
r139 r155 112 112 mShowOctree(false), 113 113 mUseDepthPass(false), 114 m UseOptimization(true),114 mTestGeometryForVisibleLeaves(true), 115 115 mShowVisualization(false), 116 116 mVisualizeCulledNodes(false) … … 137 137 mRenderedNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/RenderedNodesInfo"); 138 138 mObjectsInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/ObjectsInfo"); 139 m UseOptimizationInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/UseOptimizationInfo");139 mTestGeometryForVisibleLeavesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/TestGeometryForVisibleLeavesInfo"); 140 140 mQueriesIssuedInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/QueriesIssuedInfo"); 141 141 142 142 143 mAlgorithmInfo->setCaption(": " + mCurrentAlgorithmCaptions[mCurrentAlgorithm]); … … 148 149 mRenderedNodesInfo->setCaption(": 0"); 149 150 mObjectsInfo->setCaption(": 0"); 150 m UseOptimizationInfo->setCaption(": true");151 mTestGeometryForVisibleLeavesInfo->setCaption(": true"); 151 152 mQueriesIssuedInfo->setCaption(": 0"); 153 152 154 153 155 setAlgorithm(mCurrentAlgorithm); 154 156 155 mSceneMgr->setOption(" UseOptimization", &mUseOptimization);157 mSceneMgr->setOption("TestGeometryForVisibleLeaves", &mTestGeometryForVisibleLeaves); 156 158 mSceneMgr->setOption("UseDepthPass", &mUseDepthPass); 157 159 mSceneMgr->setOption("ShowVizualisation", &mShowVisualization); … … 236 238 KEY_PRESSED(KC_SUBTRACT, 0, changeThreshold(-10)); 237 239 KEY_PRESSED(KC_ADD, 0, changeThreshold(10)); 238 KEY_PRESSED(KC_O, 0.3, toggle UseOptimization());240 KEY_PRESSED(KC_O, 0.3, toggleTestGeometryForVisibleLeaves()); 239 241 KEY_PRESSED(KC_C, 0.3, toggleUseDepthPass()); 240 242 KEY_PRESSED(KC_V, 0.3, toggleShowViz()); … … 264 266 } 265 267 //----------------------------------------------------------------------- 266 void TerrainFrameListener::toggle UseOptimization()267 { 268 m UseOptimization = !mUseOptimization;269 270 mSceneMgr->setOption(" UseOptimization", &mUseOptimization);271 272 if(m UseOptimization)273 m UseOptimizationInfo->setCaption(": true");268 void TerrainFrameListener::toggleTestGeometryForVisibleLeaves() 269 { 270 mTestGeometryForVisibleLeaves = !mTestGeometryForVisibleLeaves; 271 272 mSceneMgr->setOption("TestGeometryForVisibleLeaves", &mTestGeometryForVisibleLeaves); 273 274 if(mTestGeometryForVisibleLeaves) 275 mTestGeometryForVisibleLeavesInfo->setCaption(": true"); 274 276 else 275 m UseOptimizationInfo->setCaption(": false");277 mTestGeometryForVisibleLeavesInfo->setCaption(": false"); 276 278 } 277 279 //----------------------------------------------------------------------- -
trunk/VUT/work/TestCulling/TestCullingApplication.h
r133 r155 64 64 void changeThreshold(int incr); 65 65 void updateStats(); 66 void toggle UseOptimization();66 void toggleTestGeometryForVisibleLeaves(); 67 67 void toggleShowOctree(); 68 68 void toggleUseDepthPass(); … … 87 87 OverlayElement *mRenderedNodesInfo; 88 88 OverlayElement *mObjectsInfo; 89 OverlayElement *m UseOptimizationInfo;89 OverlayElement *mTestGeometryForVisibleLeavesInfo; 90 90 OverlayElement *mQueriesIssuedInfo; 91 91 92 92 SceneContentGenerator *mSceneContentGenerator; 93 93 94 bool m UseOptimization;94 bool mTestGeometryForVisibleLeaves; 95 95 bool mShowOctree; 96 96 bool mUseDepthPass; -
trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.cpp
r154 r155 89 89 mShowOctree(false), 90 90 mUseDepthPass(false), 91 m UseOptimization(true),91 mTestGeometryForVisibleLeaves(true), 92 92 mShowVisualization(false), 93 93 mCullCamera(false), … … 101 101 mShowQueryStats(false), 102 102 mQueryManager(NULL), 103 mVisibilityManager(NULL) 103 mVisibilityManager(NULL), 104 mDelayedQueriesIssued(0.0), 105 mDelayedTraversedNodes(0.0) 104 106 { 105 107 //mInputDevice = PlatformManager::getSingleton().createInputReader(); … … 129 131 mAlgorithmInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/AlgorithmInfo"); 130 132 mThresholdInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/ThresholdInfo"); 131 m UseOptimizationInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/UseOptimizationInfo");133 mTestGeometryForVisibleLeavesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/TestGeometryForVisibleLeavesInfo"); 132 134 mUseDepthPassInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/UseDepthPassInfo"); 133 135 mAssumedVisibilityInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/AssumedVisibilityInfo"); … … 140 142 mObjectsInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/ObjectsInfo"); 141 143 mQueriesIssuedInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/QueriesIssuedInfo"); 142 144 mDelayedQueriesIssuedInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/DelayedQueriesIssuedInfo"); 145 mDelayedTraversedNodesInfo = OverlayManager::getSingleton().getOverlayElement("Example/Visibility/DelayedTraversedNodesInfo"); 146 143 147 mAlgorithmInfo->setCaption(": " + currentAlgorithmCaptions[mCurrentAlgorithm]); 144 148 mThresholdInfo->setCaption(": 0"); … … 149 153 mRenderedNodesInfo->setCaption(": 0"); 150 154 mObjectsInfo->setCaption(": 0"); 151 m UseOptimizationInfo->setCaption(": true");155 mTestGeometryForVisibleLeavesInfo->setCaption(": true"); 152 156 mUseDepthPassInfo->setCaption(": false"); 153 157 mQueriesIssuedInfo->setCaption(": 0"); 154 158 mAssumedVisibilityInfo->setCaption(": 0"); 155 159 mDelayedQueriesIssuedInfo->setCaption(": 0"); 160 mDelayedTraversedNodesInfo->setCaption(": 0"); 156 161 157 162 //-- visibility query stats overlay … … 170 175 171 176 // set scene manager options 172 mSceneMgr->setOption(" UseOptimization", &mUseOptimization);177 mSceneMgr->setOption("TestGeometryForVisibleLeaves", &mTestGeometryForVisibleLeaves); 173 178 174 179 // apply delayed rendering (i.e., transparents after hierarchical culling pass) 175 180 // only if optimization is not used 176 bool delayRenderTransparents = !m UseOptimization;181 bool delayRenderTransparents = !mTestGeometryForVisibleLeaves; 177 182 178 183 mSceneMgr->setOption("DelayRenderTransparents", &delayRenderTransparents); … … 736 741 mSceneMgr->getOption("NumFrustumCulledNodes", &opt); sprintf(str,": %d", opt); 737 742 mFrustumCulledNodesInfo->setCaption(str); 738 739 mSceneMgr->getOption("NumQueriesIssued", &opt); sprintf(str,": %d", opt); 743 744 // delay so there is no jump 745 mSceneMgr->getOption("NumQueriesIssued", &opt); 746 sprintf(str,": %d", (int)opt); 740 747 mQueriesIssuedInfo->setCaption(str); 741 748 … … 754 761 sprintf(str,": %d", mTerrainContentGenerator->GetObjectCount()); 755 762 mObjectsInfo->setCaption(str); 763 764 // delay so there is no jump 765 mSceneMgr->getOption("NumQueriesIssued", &opt); 766 mDelayedQueriesIssued = mDelayedQueriesIssued * 0.8 + (float)opt * 0.2; 767 sprintf(str,": %d", (int)mDelayedQueriesIssued); 768 mDelayedQueriesIssuedInfo->setCaption(str); 769 770 mSceneMgr->getOption("NumTraversedNodes", &opt); 771 mDelayedTraversedNodes = mDelayedTraversedNodes * 0.8 + (float)opt * 0.2; 772 sprintf(str,": %d", (int)mDelayedTraversedNodes); 773 mDelayedTraversedNodesInfo->setCaption(str); 774 756 775 } 757 776 catch (...) … … 761 780 } 762 781 //----------------------------------------------------------------------- 763 void TerrainFrameListener::toggle UseOptimization()764 { 765 m UseOptimization = !mUseOptimization;766 mSceneMgr->setOption(" UseOptimization", &mUseOptimization);782 void TerrainFrameListener::toggleTestGeometryForVisibleLeaves() 783 { 784 mTestGeometryForVisibleLeaves = !mTestGeometryForVisibleLeaves; 785 mSceneMgr->setOption("TestGeometryForVisibleLeaves", &mTestGeometryForVisibleLeaves); 767 786 768 787 // disable optimization which tests geometry instead of aabb 769 788 // for delayed rendering (i.e., render transparents after all the solids) 770 789 // because otherwise visible transparents could be skipped 771 bool delayedRendering = !mUseOptimization; 790 bool delayedRendering = !mTestGeometryForVisibleLeaves; 791 772 792 mSceneMgr->setOption("DelayRenderTransparents", &delayedRendering); 773 793 774 if (m UseOptimization)775 { 776 m UseOptimizationInfo->setCaption(": true");794 if (mTestGeometryForVisibleLeaves) 795 { 796 mTestGeometryForVisibleLeavesInfo->setCaption(": true"); 777 797 } 778 798 else 779 799 { 780 m UseOptimizationInfo->setCaption(": false");800 mTestGeometryForVisibleLeavesInfo->setCaption(": false"); 781 801 } 782 802 } … … 898 918 toggleDisplayCameraDetails(); 899 919 break; 900 case KC_ O:901 toggle UseOptimization();920 case KC_G: 921 toggleTestGeometryForVisibleLeaves(); 902 922 break; 903 923 case KC_T: -
trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.h
r154 r155 109 109 void changeThreshold(int incr); 110 110 void changeAssumedVisibility(int incr); 111 void toggle UseOptimization();111 void toggleTestGeometryForVisibleLeaves(); 112 112 void toggleShowOctree(); 113 113 void toggleUseDepthPass(); … … 159 159 OverlayElement *mTraversedNodesInfo; 160 160 OverlayElement *mHierarchyNodesInfo; 161 OverlayElement *m UseOptimizationInfo;161 OverlayElement *mTestGeometryForVisibleLeavesInfo; 162 162 OverlayElement *mUseDepthPassInfo; 163 163 OverlayElement *mRenderedNodesInfo; 164 164 OverlayElement *mObjectsInfo; 165 165 OverlayElement *mQueriesIssuedInfo; 166 OverlayElement *mDelayedQueriesIssuedInfo; 167 OverlayElement *mDelayedTraversedNodesInfo; 166 168 167 169 OverlayElement *mQueryTypeInfo; … … 175 177 TerrainContentGenerator *mTerrainContentGenerator; 176 178 177 bool m UseOptimization;179 bool mTestGeometryForVisibleLeaves; 178 180 bool mShowOctree; 179 181 bool mUseDepthPass; … … 236 238 //bool mUseBufferedInputKeys, mUseBufferedInputMouse, mInputTypeSwitchingOn; 237 239 PlatformQueryManager *mQueryManager; 240 241 float mDelayedQueriesIssued; 242 float mDelayedTraversedNodes; 238 243 }; 239 244 -
trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp
r150 r155 162 162 163 163 // the objects are generated on the whole terrain 164 //mTerrainContentGenerator->GenerateScene(1500, "robot");165 mTerrainContentGenerator->GenerateScene(1500, "athene");164 mTerrainContentGenerator->GenerateScene(1500, "robot"); 165 //mTerrainContentGenerator->GenerateScene(1500, "athene"); 166 166 //mTerrainContentGenerator->GenerateScene(500, "ninja"); 167 167 }
Note: See TracChangeset
for help on using the changeset viewer.