Changeset 175 for trunk/VUT/work/TestCullingTerrain
- Timestamp:
- 07/14/05 20:54:07 (20 years ago)
- Location:
- trunk/VUT/work/TestCullingTerrain
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.cpp
r174 r175 16 16 String TerrainFrameListener::msAlgorithmCaptions[] = 17 17 { 18 "Coherent Hierarchical Culling", 18 19 "View Frustum Culling", 19 "Stop and Wait Culling", 20 "Coherent Hierarchical Culling" 20 "Stop and Wait Culling" 21 21 }; 22 22 … … 42 42 { 43 43 0, 44 7, 44 0, 45 //7, 45 46 0 46 47 }; … … 49 50 { 50 51 0.1, 51 0.6, 52 0.07 52 0.03, 53 //0.1, 54 0.04 53 55 }; 54 56 … … 56 58 { 57 59 "robot", 58 "athene", 60 //"athene", 61 "natFX_Tree1_LOD2", 59 62 //"tree2", 60 63 //"HongKong_Tower", … … 111 114 mShowOctree(false), 112 115 mUseDepthPass(false), 113 mTestGeometryForVisibleLeaves( true),116 mTestGeometryForVisibleLeaves(false), 114 117 mShowVisualization(false), 115 118 mCullCamera(false), … … 426 429 int itemBufferMode = useItemBuffer ? mItemBufferMode : 0; 427 430 428 int queryModes = GtpVisibility::QueryManager::PATCH_VISIBILITY; 431 int queryModes = 0; 432 queryModes |= GtpVisibility::QueryManager::PATCH_VISIBILITY; 429 433 queryModes |= GtpVisibility::QueryManager::GEOMETRY_VISIBILITY; 430 434 queryModes |= GtpVisibility::QueryManager::NODE_VISIBILITY; 431 435 432 436 mQueryManager = new OcclusionQueriesQueryManager(sm->GetHierarchyInterface(), 433 mWindow->getViewport(0), queryModes, useItemBuffer);437 mWindow->getViewport(0), queryModes, itemBufferMode); 434 438 435 439 //mQueryManager = new PlatformQueryManager(sm->GetHierarchyInterface(), mWindow->getViewport(0), false); … … 455 459 456 460 std::stringstream d; 457 d << msQueryTypeCaptions[fromPoint ? 1 : 0].c_str() << " " 461 d << "Query mode: " << queryModes << ", " 462 << msQueryTypeCaptions[fromPoint ? 1 : 0].c_str() << " " 458 463 << msQueryRelativeVisCaptions[relativeVisibility ? 1 : 0].c_str() << " " 459 464 << msQueryMethodCaptions[useItemBuffer ? 1 : 0].c_str(); … … 744 749 { 745 750 mCurrentAlgorithm = (mCurrentAlgorithm + 1) % 746 GtpVisibility::VisibilityEnvironment::NUM_CULLING_MANAGERS, 747 751 (GtpVisibility::VisibilityEnvironment::NUM_CULLING_MANAGERS - 1); 748 752 setAlgorithm(mCurrentAlgorithm); 749 753 } -
trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp
r173 r175 228 228 { 229 229 // Set ambient light 230 mAmbientLight = ColourValue(0.5 , 0.5, 0.5);230 mAmbientLight = ColourValue(0.5 , 0.5, 0.5); 231 231 mSceneMgr->setAmbientLight(mAmbientLight); 232 232 … … 256 256 257 257 // Create a skybox 258 mSceneMgr->setSkyBox(true, "Examples/ SpaceSkyBox", 5000, false);258 mSceneMgr->setSkyBox(true, "Examples/CloudyNoonSkyBox", 5000, true); 259 259 260 260 std::string terrain_cfg("terrain.cfg"); … … 301 301 if (!mTerrainContentGenerator->LoadObjects("objects.out")) 302 302 { 303 // to provide much occlusion,304 // height is restricted to 50 => no objects are created on peaks305 mTerrainContentGenerator->SetMinPos(Vector3(mTerrainMinPos));306 mTerrainContentGenerator->SetMaxPos(Vector3(mTerrainMaxPos.x, 50.0f, mTerrainMaxPos.z));307 mTerrainContentGenerator->SetOffset(0);308 309 303 // the objects are generated randomly distributed over the terrain 310 generateScene(1500, 0); 304 generateScene(900, 0); 305 generateScene(500, 1); 306 generateScene(100, 2); 307 } 308 309 // no limitations on height => it is possible for the user to put single 310 // objects on peaks of the terrain (only few, not relevant for occlusion) 311 mTerrainContentGenerator->SetMaxPos(mTerrainMaxPos); 312 } 313 //----------------------------------------------------------------------- 314 void TestCullingTerrainApplication::generateScene(int num, int objectType) 315 { 316 Vector3 scale(TerrainFrameListener::msObjectScales[objectType], 317 TerrainFrameListener::msObjectScales[objectType], 318 TerrainFrameListener::msObjectScales[objectType]); 319 320 // to provide much occlusion, 321 // height is restricted to 50 => no objects are created on peaks 322 mTerrainContentGenerator->SetMinPos(Vector3(mTerrainMinPos)); 323 mTerrainContentGenerator->SetMaxPos(Vector3(mTerrainMaxPos.x, 75.0f, mTerrainMaxPos.z)); 324 325 mTerrainContentGenerator->SetScale(scale); 326 mTerrainContentGenerator->SetOffset(TerrainFrameListener::msObjectTerrainOffsets[objectType]); 327 mTerrainContentGenerator->GenerateScene(num, TerrainFrameListener::msObjectCaptions[objectType]); 328 329 if (objectType != 0) // from our objects, only robot has animation phases 330 return; 331 332 EntityList *entList = mTerrainContentGenerator->GetGeneratedEntities(); 333 334 //-- add animation state for new robots (located at the end of the list) 335 for (int i = (int)entList->size() - num; i < (int)entList->size(); ++i) 336 { 337 mEntityStates.push_back(new EntityState((*entList)[i], 338 EntityState::WAITING, Math::RangeRandom(0.5, 1.5))); 311 339 } 312 340 … … 314 342 // objects on peaks of the terrain (only few, not relevant for occlusion) 315 343 mTerrainContentGenerator->SetMaxPos(mTerrainMaxPos); 316 }317 //-----------------------------------------------------------------------318 void TestCullingTerrainApplication::generateScene(int num, int objectType)319 {320 Vector3 scale(TerrainFrameListener::msObjectScales[objectType],321 TerrainFrameListener::msObjectScales[objectType],322 TerrainFrameListener::msObjectScales[objectType]);323 324 mTerrainContentGenerator->SetScale(scale);325 mTerrainContentGenerator->SetOffset(TerrainFrameListener::msObjectTerrainOffsets[objectType]);326 mTerrainContentGenerator->GenerateScene(num, TerrainFrameListener::msObjectCaptions[objectType]);327 328 if (objectType != 0) // from our objects, only robot has animation phases329 return;330 331 EntityList *entList = mTerrainContentGenerator->GetGeneratedEntities();332 333 //-- add animation state for new robots (located at the end of the list)334 for (int i = entList->size() - num; i < (int)entList->size(); ++i)335 {336 mEntityStates.push_back(new EntityState((*entList)[i],337 EntityState::WAITING, Math::RangeRandom(0.5, 1.5)));338 }339 344 } 340 345 //-----------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.