Changeset 148
- Timestamp:
- 06/23/05 00:56:37 (20 years ago)
- Location:
- trunk/VUT
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibility/src/CoherentHierarchicalCullingManager.cpp
r147 r148 64 64 else 65 65 { 66 // if intersects near plane => skip occlusion query because wrong results possible 67 if (intersects) 66 // identify previously visible nodes 67 bool wasVisible = mHierarchyInterface->IsNodeVisible(node) && 68 (mHierarchyInterface->LastVisited(node) == mHierarchyInterface->GetFrameId() - 1); 69 70 // if node is assumed to be visible in this frame => skip query 71 // if intersects near plane => also skip query because wrong results possible 72 bool assumeVisible = intersects || 73 (wasVisible && (mAssumedVisibility > 0) && 74 mHierarchyInterface->HasGeometry(node) && DecideVisible(node)); 75 76 if (assumeVisible) 68 77 { 69 // update octant's visited flag78 // update node's visited flag 70 79 mHierarchyInterface->SetLastVisited(node, mHierarchyInterface->GetFrameId()); 71 80 … … 76 85 } 77 86 78 // identify previously visible nodes 79 bool wasVisible = mHierarchyInterface->IsNodeVisible(node) && 80 (mHierarchyInterface->LastVisited(node) == mHierarchyInterface->GetFrameId() - 1); 81 // if visibility is assumed to be true in this frame 82 bool assumeVisible = wasVisible && (mAssumedVisibility > 0) && DecideVisible(node); 83 84 // identify nodes that we cannot skip queries for 87 // identify nodes that we cannot skip queries for 85 88 // geometry not only in leaves => test for renderable geometry 86 bool issueQuery = !wasVisible || 87 (mHierarchyInterface->HasGeometry(node) && !assumeVisible); 89 bool issueQuery = !wasVisible || mHierarchyInterface->HasGeometry(node); 88 90 89 91 // reset node's visibility classification 90 mHierarchyInterface->SetNodeVisible(node, !issueQuery && assumeVisible);92 mHierarchyInterface->SetNodeVisible(node, false); 91 93 92 94 // update node's visited flag -
trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp
r147 r148 223 223 else 224 224 { 225 // if not the shadow passwe interleave identification225 // for hierarchical culling, we interleave identification 226 226 // and rendering of objects in _renderVisibibleObjects 227 228 // only for the shadow pass we use standard rendering 227 229 if (mShadowTechnique == SHADOWTYPE_TEXTURE_MODULATIVE && 228 230 mIlluminationStage == IRS_RENDER_TO_TEXTURE) … … 242 244 void VisibilityTerrainSceneManager::_renderVisibleObjects() 243 245 { 244 // visualization: apply standard rendering 245 if (mShowVisualization) 246 // visualization or shadow pass: apply standard rendering 247 if (mShowVisualization || (mShadowTechnique == SHADOWTYPE_TEXTURE_MODULATIVE && 248 mIlluminationStage == IRS_RENDER_TO_TEXTURE)) 246 249 { 247 250 IlluminationRenderStage savedStage = mIlluminationStage; 248 251 249 // disable illumination stage so we have no shadow rendering 250 mIlluminationStage = IRS_NONE; 251 252 if (mShowVisualization) 253 // disable illumination stage so we have no shadows in visualization 254 mIlluminationStage = IRS_NONE; 255 256 // standard rendering for shadow maps because of performance 252 257 TerrainSceneManager::_renderVisibleObjects(); 253 258 254 259 mIlluminationStage = savedStage; 255 260 } 256 // normal rendering for shadow maps because of performance 257 else if (mShadowTechnique == SHADOWTYPE_TEXTURE_MODULATIVE && 258 mIlluminationStage == IRS_RENDER_TO_TEXTURE) 259 { 260 TerrainSceneManager::_renderVisibleObjects(); 261 } 262 else 261 else // the hierarchical culling algorithm 263 262 { 264 263 //-- hierarchical culling
Note: See TracChangeset
for help on using the changeset viewer.