Changeset 346
- Timestamp:
- 10/21/05 20:28:11 (19 years ago)
- Location:
- trunk/VUT
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibility/src/CoherentHierarchicalCullingManager.cpp
r345 r346 25 25 unsigned int visiblePixels = 0; 26 26 bool isAvailable = false; 27 Ogre::LogManager::getSingleton().logMessage("Coherent Hierarchical Culling\n");27 //Ogre::LogManager::getSingleton().logMessage("Coherent Hierarchical Culling"); 28 28 29 29 //-- PART 1: process finished occlusion queries … … 37 37 38 38 queryQueue.pop(); 39 40 std::stringstream d2; d2 << "fetch node from query queue " << node;41 Ogre::LogManager::getSingleton().logMessage(d2.str());42 39 43 40 if (visiblePixels > mVisibilityThreshold) … … 63 60 mHierarchyInterface->GetQueue()->pop(); 64 61 65 std::stringstream d2; d2 << "fetch node from hierarchy queue " << node;66 Ogre::LogManager::getSingleton().logMessage(d2.str());67 68 62 bool intersects = false; 69 63 … … 87 81 bool wasVisible = mHierarchyInterface->IsNodeVisible(node) && 88 82 (mHierarchyInterface->LastVisited(node) == mHierarchyInterface->GetFrameId() - 1); 89 if (mHierarchyInterface->LastVisited(node) == mHierarchyInterface->GetFrameId()) 90 { 91 std::stringstream d2; d2 << "!!!!lastVisited: " << mHierarchyInterface->LastVisited(node) << " " << node; 92 Ogre::LogManager::getSingleton().logMessage(d2.str()); 93 std::stringstream d; d << "!!!!!frameid: " << mHierarchyInterface->GetFrameId() << " " << node << "\n"; 94 Ogre::LogManager::getSingleton().logMessage(d.str()); 95 } 83 96 84 // if we assume node to be visible in this frame => skip query 97 85 // TODO: check this (not the expected speed up) … … 105 93 // identify nodes that we cannot skip queries for 106 94 // geometry not only in leaves => test for renderable geometry 95 // we also need to test if node was processed in current frame, otherwise 96 // node is tested several times because of priority queue 107 97 bool issueQuery = (mHierarchyInterface->LastVisited(node) != mHierarchyInterface->GetFrameId()) 108 98 && (!wasVisible || mHierarchyInterface->HasGeometry(node)); … … 113 103 // update node's visited flag 114 104 mHierarchyInterface->SetLastVisited(node, mHierarchyInterface->GetFrameId()); 115 116 std::stringstream d2; d2 << "lastVisited: " << mHierarchyInterface->LastVisited(node) << " " << node;117 Ogre::LogManager::getSingleton().logMessage(d2.str());118 105 119 106 // skip testing previously visible nodes without geometry … … 129 116 if (wasVisible) 130 117 { 131 std::stringstream d2; d2 << "traversing node " << node;132 Ogre::LogManager::getSingleton().logMessage(d2.str());133 118 mHierarchyInterface->TraverseNode(node); 134 119 } … … 162 147 { 163 148 // -- set node to be visible in this frame, then traverse it 164 std::stringstream d2; d2 << "skipping node " << node;165 Ogre::LogManager::getSingleton().logMessage(d2.str());166 149 mHierarchyInterface->SetLastVisited(node, mHierarchyInterface->GetFrameId()); 167 150 168 mHierarchyInterface->SetNodeVisible(node, true);169 151 mHierarchyInterface->PullUpVisibility(node); 170 152 mHierarchyInterface->TraverseNode(node); -
trunk/VUT/GtpVisibility/src/StopAndWaitCullingManager.cpp
r345 r346 19 19 bool intersects = false; 20 20 21 //if (mHierarchyInterface->HasGeometry(node) && (!mHierarchyInterface->IsLeaf(node))) ++ mNumFrustumCulledNodes;22 // Ogre::LogManager::getSingleton().logMessage("no geometry");23 //else if (!mHierarchyInterface->IsLeaf(node)) ++ mNumQueriesIssued;// Ogre::LogManager::getSingleton().logMessage("has geometry");24 /*if (!mHierarchyInterface->HasGeometry(node))25 Ogre::LogManager::getSingleton().logMessage("no geometry");26 else Ogre::LogManager::getSingleton().logMessage("has geometry");*/27 21 if (!mHierarchyInterface->CheckFrustumVisible(node, intersects)) 28 22 { -
trunk/VUT/Ogre/resources/terrain.cfg
r192 r346 26 26 27 27 # How large is each tile? Must be (2^n)+1 and be smaller than PageSize 28 TileSize= 6528 TileSize=129 29 29 30 30 # The maximum error allowed when determining which LOD to use … … 32 32 33 33 # The size of a terrain page, in world units 34 PageWorldX= 300035 PageWorldZ= 300034 PageWorldX=5000 35 PageWorldZ=5000 36 36 # Maximum height of the terrain 37 MaxHeight= 30037 MaxHeight=500 38 38 39 39 # Upper LOD limit -
trunk/VUT/Ogre/src/OgreOctreeHierarchyInterface.cpp
r345 r346 36 36 if (nextChild) 37 37 { 38 std::stringstream d2; d2 << "pushing node " << nextChild;39 Ogre::LogManager::getSingleton().logMessage(d2.str());40 38 mDistanceQueue->push(nextChild); 41 39 } -
trunk/VUT/chcdemo/RenderTraverser.cpp
r345 r346 182 182 // update node's visited flag 183 183 node->SetLastVisited(mFrameID); 184 184 node->SetVisible(true); 185 185 PullUpVisibility(node); 186 186 TraverseNode(node); … … 192 192 193 193 // identify nodes that we cannot skip queries for 194 bool leafOrWasInvisible = !wasVisible || node->IsLeaf();194 bool leafOrWasInvisible = (node->LastVisited() != mFrameID) && (!wasVisible || node->IsLeaf()); 195 195 196 196 // reset node's visibility classification … … 199 199 // update node's visited flag 200 200 node->SetLastVisited(mFrameID); 201 //if (mFrameID == node->LastVisited()) mNumFrustumCulledNodes ++;201 202 202 // skip testing previously visible interior nodes 203 203 if(leafOrWasInvisible) … … 215 215 { 216 216 // for stats 217 //mNumFrustumCulledNodes ++;217 mNumFrustumCulledNodes ++; 218 218 } 219 219 } … … 331 331 // get next available test id 332 332 unsigned int occlusionQuery = mOcclusionQueries[mCurrentTestIdx++]; 333 mNumFrustumCulledNodes ++;333 334 334 node->SetOcclusionQuery(occlusionQuery); 335 335 // do the actual occlusion query for this node -
trunk/VUT/work/TestCullingTerrain/TerrainFrameListener.cpp
r345 r346 52 52 0.03, 53 53 //0.1, 54 0.0 454 0.03 55 55 }; 56 56 … … 423 423 424 424 // clamp camera so we always walk along the terrain 425 mApplication->Clamp2Terrain(mCamNode, 10);425 mApplication->Clamp2Terrain(mCamNode, 5); 426 426 break; 427 427 -
trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp
r345 r346 297 297 298 298 mTerrainMinPos = EntityState::msMinPos = Vector3(0, 0, 0); 299 mTerrainMaxPos = EntityState::msMaxPos = Vector3( 3000, 5000, 3000);299 mTerrainMaxPos = EntityState::msMaxPos = Vector3(5000, 5000, 5000); 300 300 301 301 mTerrainContentGenerator = new TerrainContentGenerator(mSceneMgr); 302 302 303 303 // if no objects in file, we generate new objects 304 //if (!mTerrainContentGenerator->LoadObjects("objects.out"))305 //{304 if (!mTerrainContentGenerator->LoadObjects("objects.out")) 305 { 306 306 // the objects are generated randomly distributed over the terrain 307 generateScene( 900, 0); // create soldiers, trees, ninjas308 generateScene( 500, 1);309 generateScene( 100, 2);310 //}307 generateScene(1000, 0); // create soldiers, trees, ninjas 308 generateScene(1000, 1); 309 generateScene(200, 2); 310 } 311 311 312 312 // no limitations on height => it is possible for the user to put single … … 319 319 float val = TerrainFrameListener::msObjectScales[objectType]; 320 320 Vector3 scale(val, val, val); 321 321 const float maxHeight = 100; 322 322 // to provide much occlusion, 323 323 // height is restricted to 50 => no objects are created on peaks 324 324 mTerrainContentGenerator->SetMinPos(Vector3(mTerrainMinPos)); 325 mTerrainContentGenerator->SetMaxPos(Vector3(mTerrainMaxPos.x, 75.0f, mTerrainMaxPos.z));325 mTerrainContentGenerator->SetMaxPos(Vector3(mTerrainMaxPos.x, maxHeight, mTerrainMaxPos.z)); 326 326 std::stringstream d; d << "objscale: " << scale[0]; 327 327 Ogre::LogManager::getSingleton().logMessage(d.str());
Note: See TracChangeset
for help on using the changeset viewer.